@Override public float getFloatProperty(final String name) throws JMSException { try { return message.getFloatProperty(name); } catch (ActiveMQPropertyConversionException e) { throw new MessageFormatException(e.getMessage()); } }
@Override public float getFloatProperty(final String name) throws JMSException { try { return message.getFloatProperty(name); } catch (ActiveMQPropertyConversionException e) { throw new MessageFormatException(e.getMessage()); } }
@Override public float getFloatProperty(final String name) throws JMSException { try { return message.getFloatProperty(name); } catch (ActiveMQPropertyConversionException e) { throw new MessageFormatException(e.getMessage()); } }
@Override public float getFloatProperty(final String name) throws JMSException { try { return message.getFloatProperty(name); } catch (ActiveMQPropertyConversionException e) { throw new MessageFormatException(e.getMessage()); } }
@Override public float getFloatProperty(final String name) throws JMSException { try { return message.getFloatProperty(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(i * 2.5F, msg.getFloatProperty("myFloatProperty"), 0.000001); Assert.assertEquals(i, msg.getIntProperty("myIntProperty").intValue()); Assert.assertEquals(Long.MAX_VALUE - i, msg.getLongProperty("myLongProperty").longValue());
assertEquals(i * 2.5F, msg.getFloatProperty("myFloatProperty"), 0.000001); assertEquals(i, msg.getIntProperty("myIntProperty").intValue()); assertEquals(Long.MAX_VALUE - i, msg.getLongProperty("myLongProperty").longValue());