@Override public short getShortProperty(final String name) throws JMSException { try { return message.getShortProperty(name); } catch (ActiveMQPropertyConversionException e) { throw new MessageFormatException(e.getMessage()); } }
@Override public short getShortProperty(final String name) throws JMSException { try { return message.getShortProperty(name); } catch (ActiveMQPropertyConversionException e) { throw new MessageFormatException(e.getMessage()); } }
@Override public short getShortProperty(final String name) throws JMSException { try { return message.getShortProperty(name); } catch (ActiveMQPropertyConversionException e) { throw new MessageFormatException(e.getMessage()); } }
@Override public short getShortProperty(final String name) throws JMSException { try { return message.getShortProperty(name); } catch (ActiveMQPropertyConversionException e) { throw new MessageFormatException(e.getMessage()); } }
@Override public short getShortProperty(final String name) throws JMSException { try { return message.getShortProperty(name); } catch (ActiveMQPropertyConversionException e) { throw new MessageFormatException(e.getMessage()); } }
private void receiveMessages() throws Exception { ClientSession session = sf.createSession(true, true); session.start(); try (ClientConsumer consumer = session.createConsumer(ADDRESS)) { for (int i = 0; i < numMessages; i++) { ClientMessage message = consumer.receive(100); assertNotNull("Expecting a message " + i, message); assertMessageBody(i, message); assertEquals(i, message.getIntProperty("int").intValue()); assertEquals((short) i, message.getShortProperty("short").shortValue()); assertEquals((byte) i, message.getByteProperty("byte").byteValue()); assertEquals(floatValue(i), message.getFloatProperty("float").floatValue(), 0.001); assertEquals(new SimpleString(Integer.toString(i)), message.getSimpleStringProperty(SIMPLE_STRING_KEY.toString())); assertEqualsByteArrays(byteArray(i), message.getBytesProperty("byte[]")); assertTrue(message.containsProperty("null-value")); assertEquals(message.getObjectProperty("null-value"), null); message.acknowledge(); } assertNull("no more messages", consumer.receive(50)); } session.commit(); }
Assert.assertEquals(Long.MAX_VALUE - i, msg.getLongProperty("myLongProperty").longValue()); Assert.assertEquals(i, msg.getObjectProperty("myObjectProperty")); Assert.assertEquals(new Integer(i).shortValue(), msg.getShortProperty("myShortProperty").shortValue()); Assert.assertEquals("myStringPropertyValue_" + i, msg.getStringProperty("myStringProperty")); Assert.assertEquals(international.toString(), msg.getStringProperty("myNonAsciiStringProperty"));
assertEquals(true, msg.getPropertyNames().contains(SimpleString.toSimpleString("myNullObjectProperty"))); assertEquals(null, msg.getObjectProperty("myNullObjectProperty")); assertEquals(new Integer(i).shortValue(), msg.getShortProperty("myShortProperty").shortValue()); assertEquals("myStringPropertyValue_" + i, msg.getStringProperty("myStringProperty")); assertEquals(true, msg.getPropertyNames().contains(SimpleString.toSimpleString("myNullStringProperty")));