@Override public void setObjectProperty(final String name, final Object value) throws JMSException { if (handleCoreProperty(name, value, MessageUtil.JMSXGROUPID, org.apache.activemq.artemis.api.core.Message.HDR_GROUP_ID)) { return; } if (handleCoreProperty(name, value, MessageUtil.JMSXUSERID, org.apache.activemq.artemis.api.core.Message.HDR_VALIDATED_USER)) { return; } if (ActiveMQJMSConstants.JMS_ACTIVEMQ_OUTPUT_STREAM.equals(name)) { setOutputStream((OutputStream) value); return; } else if (ActiveMQJMSConstants.JMS_ACTIVEMQ_SAVE_STREAM.equals(name)) { saveToOutputStream((OutputStream) value); return; } checkProperty(name); if (ActiveMQJMSConstants.JMS_ACTIVEMQ_INPUT_STREAM.equals(name)) { setInputStream((InputStream) value); return; } try { message.putObjectProperty(name, value); } catch (ActiveMQPropertyConversionException e) { throw new MessageFormatException(e.getMessage()); } }
/** * Adds properties to a ClientMessage * * @param message * @param properties */ public static void addMessageProperties(ClientMessage message, Map<String, Object> properties) { if (properties != null && properties.size() > 0) { for (Map.Entry<String, Object> property : properties.entrySet()) { message.putObjectProperty(property.getKey(), property.getValue()); } } }
/** * Adds properties to a ClientMessage * * @param message * @param properties */ public static void addMessageProperties(ClientMessage message, Map<String, Object> properties) { if (properties != null && properties.size() > 0) { for (Map.Entry<String, Object> property : properties.entrySet()) { message.putObjectProperty(property.getKey(), property.getValue()); } } }
/** * Adds properties to a ClientMessage * * @param message * @param properties */ public static void addMessageProperties(ClientMessage message, Map<String, Object> properties) { if (properties != null && properties.size() > 0) { for (Map.Entry<String, Object> property : properties.entrySet()) { message.putObjectProperty(property.getKey(), property.getValue()); } } }
/** * Adds properties to a ClientMessage * * @param message * @param properties */ public static void addMessageProperties(ClientMessage message, Map<String, Object> properties) { if (properties != null && properties.size() > 0) { for (Map.Entry<String, Object> property : properties.entrySet()) { message.putObjectProperty(property.getKey(), property.getValue()); } } }
@Override public void setObjectProperty(final String name, final Object value) throws JMSException { if (handleCoreProperty(name, value, MessageUtil.JMSXGROUPID, org.apache.activemq.artemis.api.core.Message.HDR_GROUP_ID)) { return; } if (handleCoreProperty(name, value, MessageUtil.JMSXUSERID, org.apache.activemq.artemis.api.core.Message.HDR_VALIDATED_USER)) { return; } if (ActiveMQJMSConstants.JMS_ACTIVEMQ_OUTPUT_STREAM.equals(name)) { setOutputStream((OutputStream) value); return; } else if (ActiveMQJMSConstants.JMS_ACTIVEMQ_SAVE_STREAM.equals(name)) { saveToOutputStream((OutputStream) value); return; } checkProperty(name); if (ActiveMQJMSConstants.JMS_ACTIVEMQ_INPUT_STREAM.equals(name)) { setInputStream((InputStream) value); return; } try { message.putObjectProperty(name, value); } catch (ActiveMQPropertyConversionException e) { throw new MessageFormatException(e.getMessage()); } }
@Override public void setObjectProperty(final String name, final Object value) throws JMSException { if (handleCoreProperty(name, value, MessageUtil.JMSXGROUPID, org.apache.activemq.artemis.api.core.Message.HDR_GROUP_ID)) { return; } if (handleCoreProperty(name, value, MessageUtil.JMSXUSERID, org.apache.activemq.artemis.api.core.Message.HDR_VALIDATED_USER)) { return; } if (ActiveMQJMSConstants.JMS_ACTIVEMQ_OUTPUT_STREAM.equals(name)) { setOutputStream((OutputStream) value); return; } else if (ActiveMQJMSConstants.JMS_ACTIVEMQ_SAVE_STREAM.equals(name)) { saveToOutputStream((OutputStream) value); return; } checkProperty(name); if (ActiveMQJMSConstants.JMS_ACTIVEMQ_INPUT_STREAM.equals(name)) { setInputStream((InputStream) value); return; } try { message.putObjectProperty(name, value); } catch (ActiveMQPropertyConversionException e) { throw new MessageFormatException(e.getMessage()); } }
msg.putIntProperty("myIntProperty", i); msg.putLongProperty("myLongProperty", Long.MAX_VALUE - i); msg.putObjectProperty("myObjectProperty", i); msg.putShortProperty("myShortProperty", new Integer(i).shortValue()); msg.putStringProperty("myStringProperty", "myStringPropertyValue_" + i);
private void sendMessages() throws Exception { ClientSession session = sf.createSession(true, true); String filter = null; session.createAddress(SimpleString.toSimpleString(ADDRESS), RoutingType.MULTICAST, false); session.createQueue(ADDRESS, RoutingType.MULTICAST, ADDRESS, filter, true); ClientProducer producer = session.createProducer(ADDRESS); for (int i = 0; i < numMessages; i++) { ClientMessage message = session.createMessage(true); setBody(i, message); message.putIntProperty("int", i); message.putShortProperty("short", (short) i); message.putByteProperty("byte", (byte) i); message.putFloatProperty("float", floatValue(i)); message.putStringProperty(SIMPLE_STRING_KEY, new SimpleString(Integer.toString(i))); message.putBytesProperty("byte[]", byteArray(i)); message.putObjectProperty("null-value", null); producer.send(message); } session.commit(); }
msg.putIntProperty("myIntProperty", i); msg.putLongProperty("myLongProperty", Long.MAX_VALUE - i); msg.putObjectProperty("myObjectProperty", i); msg.putObjectProperty("myNullObjectProperty", null); msg.putShortProperty("myShortProperty", new Integer(i).shortValue()); msg.putStringProperty("myStringProperty", "myStringPropertyValue_" + i);