/** * @return Returns the message in Map form, useful when encoding to JSON */ default Map<String, Object> toMap() { Map map = toPropertyMap(); map.put("messageID", getMessageID()); Object userID = getUserID(); if (getUserID() != null) { map.put("userID", "ID:" + userID.toString()); } map.put("address", getAddress() == null ? "" : getAddress()); map.put("durable", isDurable()); map.put("expiration", getExpiration()); map.put("timestamp", getTimestamp()); map.put("priority", (int)getPriority()); return map; }
targetBinding = remoteQueueBinding; if (logger.isDebugEnabled()) { logger.debug("Message now destined for " + remoteQueueBinding.getRoutingName() + " with ID: " + remoteQueueBinding.getRemoteQueueID() + " on address " + copyMessage.getAddress() + " on node " + targetNodeID);
default void referenceOriginalMessage(final Message original, String originalQueue) { String queueOnMessage = original.getAnnotationString(Message.HDR_ORIGINAL_QUEUE); if (queueOnMessage != null) { setAnnotation(Message.HDR_ORIGINAL_QUEUE, queueOnMessage); } else if (originalQueue != null) { setAnnotation(Message.HDR_ORIGINAL_QUEUE, originalQueue); } Object originalID = original.getAnnotation(Message.HDR_ORIG_MESSAGE_ID); if (originalID != null) { setAnnotation(Message.HDR_ORIGINAL_ADDRESS, original.getAnnotationString(Message.HDR_ORIGINAL_ADDRESS)); setAnnotation(Message.HDR_ORIG_MESSAGE_ID, originalID); } else { setAnnotation(Message.HDR_ORIGINAL_ADDRESS, original.getAddress()); setAnnotation(Message.HDR_ORIG_MESSAGE_ID, original.getMessageID()); } // reset expiry setExpiration(0); }
context.clear().setReusable(false); routeUsingStrictOrdering(message, context, groupingHandler, groupId, 0); } else if (CompositeAddress.isFullyQualified(message.getAddress())) { Binding theBinding = bindingsNameMap.get(CompositeAddress.extractQueueName(message.getAddressSimpleString())); if (theBinding != null) {
private void applyPrefixForLegacyConsumer(Message message) { /** * check to see if: * 1) This is a "core" connection * 2) The "core" connection belongs to a JMS client * 3) The JMS client is an "old" client which needs address prefixes * * If 1, 2, & 3 are true then apply the "old" prefix for queues and topics as appropriate. */ if (requiresLegacyPrefix) { if (anycast) { if (!message.getAddress().startsWith(PacketImpl.OLD_QUEUE_PREFIX.toString())) { message.setAddress(PacketImpl.OLD_QUEUE_PREFIX + message.getAddress()); } } else { if (!message.getAddress().startsWith(PacketImpl.OLD_TOPIC_PREFIX.toString())) { message.setAddress(PacketImpl.OLD_TOPIC_PREFIX + message.getAddress()); } } } }
/** * @return Returns the message in Map form, useful when encoding to JSON */ default Map<String, Object> toMap() { Map map = toPropertyMap(); map.put("messageID", getMessageID()); Object userID = getUserID(); if (getUserID() != null) { map.put("userID", "ID:" + userID.toString()); } map.put("address", getAddress() == null ? "" : getAddress()); map.put("durable", isDurable()); map.put("expiration", getExpiration()); map.put("timestamp", getTimestamp()); map.put("priority", (int)getPriority()); return map; }
/** * @return Returns the message in Map form, useful when encoding to JSON */ default Map<String, Object> toMap() { Map map = toPropertyMap(); map.put("messageID", getMessageID()); Object userID = getUserID(); if (getUserID() != null) { map.put("userID", "ID:" + userID.toString()); } map.put("address", getAddress() == null ? "" : getAddress()); map.put("durable", isDurable()); map.put("expiration", getExpiration()); map.put("timestamp", getTimestamp()); map.put("priority", (int)getPriority()); return map; }
/** * @return Returns the message in Map form, useful when encoding to JSON */ default Map<String, Object> toMap() { Map map = toPropertyMap(); map.put("messageID", getMessageID()); Object userID = getUserID(); if (getUserID() != null) { map.put("userID", "ID:" + userID.toString()); } map.put("address", getAddress() == null ? "" : getAddress()); map.put("durable", isDurable()); map.put("expiration", getExpiration()); map.put("timestamp", getTimestamp()); map.put("priority", (int)getPriority()); return map; }
/** * @return Returns the message in Map form, useful when encoding to JSON */ default Map<String, Object> toMap() { Map map = toPropertyMap(); map.put("messageID", getMessageID()); Object userID = getUserID(); if (getUserID() != null) { map.put("userID", "ID:" + userID.toString()); } map.put("address", getAddress() == null ? "" : getAddress()); map.put("durable", isDurable()); map.put("expiration", getExpiration()); map.put("timestamp", getTimestamp()); map.put("priority", (int)getPriority()); return map; }
/** * @return Returns the message in Map form, useful when encoding to JSON */ default Map<String, Object> toMap() { Map map = toPropertyMap(); map.put("messageID", getMessageID()); Object userID = getUserID(); if (getUserID() != null) { map.put("userID", "ID:" + userID.toString()); } map.put("address", getAddress() == null ? "" : getAddress()); map.put("durable", isDurable()); map.put("expiration", getExpiration()); map.put("timestamp", getTimestamp()); map.put("priority", (int)getPriority()); return map; }
/** * @return Returns the message in Map form, useful when encoding to JSON */ default Map<String, Object> toMap() { Map map = toPropertyMap(); map.put("messageID", getMessageID()); Object userID = getUserID(); if (getUserID() != null) { map.put("userID", "ID:" + userID.toString()); } map.put("address", getAddress() == null ? "" : getAddress()); map.put("durable", isDurable()); map.put("expiration", getExpiration()); map.put("timestamp", getTimestamp()); map.put("priority", (int)getPriority()); return map; }
/** * We convert the core address to an ActiveMQ Destination. We use the actual address on the message rather than the * destination set on the consumer because it maybe different and the JMS spec says that it should be what ever was * set on publish/send so a divert or wildcard may mean thats its different to the destination subscribed to by the * consumer */ public static ActiveMQDestination toAMQAddress(Message message, ActiveMQDestination actualDestination) { String address = message.getAddress(); if (address == null || address.equals(actualDestination.getPhysicalName())) { return actualDestination; } if (actualDestination.isQueue()) { return new ActiveMQQueue(address); } else { return new ActiveMQTopic(address); } }
default void referenceOriginalMessage(final Message original, String originalQueue) { String queueOnMessage = original.getAnnotationString(Message.HDR_ORIGINAL_QUEUE); if (queueOnMessage != null) { setAnnotation(Message.HDR_ORIGINAL_QUEUE, queueOnMessage); } else if (originalQueue != null) { setAnnotation(Message.HDR_ORIGINAL_QUEUE, originalQueue); } Object originalID = original.getAnnotation(Message.HDR_ORIG_MESSAGE_ID); if (originalID != null) { setAnnotation(Message.HDR_ORIGINAL_ADDRESS, original.getAnnotationString(Message.HDR_ORIGINAL_ADDRESS)); setAnnotation(Message.HDR_ORIG_MESSAGE_ID, originalID); } else { setAnnotation(Message.HDR_ORIGINAL_ADDRESS, original.getAddress()); setAnnotation(Message.HDR_ORIG_MESSAGE_ID, original.getMessageID()); } // reset expiry setExpiration(0); }
default void referenceOriginalMessage(final Message original, String originalQueue) { String queueOnMessage = original.getAnnotationString(Message.HDR_ORIGINAL_QUEUE); if (queueOnMessage != null) { setAnnotation(Message.HDR_ORIGINAL_QUEUE, queueOnMessage); } else if (originalQueue != null) { setAnnotation(Message.HDR_ORIGINAL_QUEUE, originalQueue); } Object originalID = original.getAnnotation(Message.HDR_ORIG_MESSAGE_ID); if (originalID != null) { setAnnotation(Message.HDR_ORIGINAL_ADDRESS, original.getAnnotationString(Message.HDR_ORIGINAL_ADDRESS)); setAnnotation(Message.HDR_ORIG_MESSAGE_ID, originalID); } else { setAnnotation(Message.HDR_ORIGINAL_ADDRESS, original.getAddress()); setAnnotation(Message.HDR_ORIG_MESSAGE_ID, original.getMessageID()); } // reset expiry setExpiration(0); }
default void referenceOriginalMessage(final Message original, String originalQueue) { String queueOnMessage = original.getAnnotationString(Message.HDR_ORIGINAL_QUEUE); if (queueOnMessage != null) { setAnnotation(Message.HDR_ORIGINAL_QUEUE, queueOnMessage); } else if (originalQueue != null) { setAnnotation(Message.HDR_ORIGINAL_QUEUE, originalQueue); } Object originalID = original.getAnnotation(Message.HDR_ORIG_MESSAGE_ID); if (originalID != null) { setAnnotation(Message.HDR_ORIGINAL_ADDRESS, original.getAnnotationString(Message.HDR_ORIGINAL_ADDRESS)); setAnnotation(Message.HDR_ORIG_MESSAGE_ID, originalID); } else { setAnnotation(Message.HDR_ORIGINAL_ADDRESS, original.getAddress()); setAnnotation(Message.HDR_ORIG_MESSAGE_ID, original.getMessageID()); } // reset expiry setExpiration(0); }
default void referenceOriginalMessage(final Message original, String originalQueue) { String queueOnMessage = original.getAnnotationString(Message.HDR_ORIGINAL_QUEUE); if (queueOnMessage != null) { setAnnotation(Message.HDR_ORIGINAL_QUEUE, queueOnMessage); } else if (originalQueue != null) { setAnnotation(Message.HDR_ORIGINAL_QUEUE, originalQueue); } Object originalID = original.getAnnotation(Message.HDR_ORIG_MESSAGE_ID); if (originalID != null) { setAnnotation(Message.HDR_ORIGINAL_ADDRESS, original.getAnnotationString(Message.HDR_ORIGINAL_ADDRESS)); setAnnotation(Message.HDR_ORIG_MESSAGE_ID, originalID); } else { setAnnotation(Message.HDR_ORIGINAL_ADDRESS, original.getAddress()); setAnnotation(Message.HDR_ORIG_MESSAGE_ID, original.getMessageID()); } // reset expiry setExpiration(0); }
default void referenceOriginalMessage(final Message original, String originalQueue) { String queueOnMessage = original.getAnnotationString(Message.HDR_ORIGINAL_QUEUE); if (queueOnMessage != null) { setAnnotation(Message.HDR_ORIGINAL_QUEUE, queueOnMessage); } else if (originalQueue != null) { setAnnotation(Message.HDR_ORIGINAL_QUEUE, originalQueue); } Object originalID = original.getAnnotation(Message.HDR_ORIG_MESSAGE_ID); if (originalID != null) { setAnnotation(Message.HDR_ORIGINAL_ADDRESS, original.getAnnotationString(Message.HDR_ORIGINAL_ADDRESS)); setAnnotation(Message.HDR_ORIG_MESSAGE_ID, originalID); } else { setAnnotation(Message.HDR_ORIGINAL_ADDRESS, original.getAddress()); setAnnotation(Message.HDR_ORIG_MESSAGE_ID, original.getMessageID()); } // reset expiry setExpiration(0); }
default void referenceOriginalMessage(final Message original, String originalQueue) { String queueOnMessage = original.getAnnotationString(Message.HDR_ORIGINAL_QUEUE); if (queueOnMessage != null) { setAnnotation(Message.HDR_ORIGINAL_QUEUE, queueOnMessage); } else if (originalQueue != null) { setAnnotation(Message.HDR_ORIGINAL_QUEUE, originalQueue); } Object originalID = original.getAnnotation(Message.HDR_ORIG_MESSAGE_ID); if (originalID != null) { setAnnotation(Message.HDR_ORIGINAL_ADDRESS, original.getAnnotationString(Message.HDR_ORIGINAL_ADDRESS)); setAnnotation(Message.HDR_ORIG_MESSAGE_ID, originalID); } else { setAnnotation(Message.HDR_ORIGINAL_ADDRESS, original.getAddress()); setAnnotation(Message.HDR_ORIG_MESSAGE_ID, original.getMessageID()); } // reset expiry setExpiration(0); }
return msg.getEncodeSize(); } else if (FilterConstants.ACTIVEMQ_ADDRESS.equals(fieldName)) { return msg.getAddress(); } else if (FilterConstants.ACTIVEMQ_GROUP_ID.equals(fieldName)) { return msg.getGroupID();
command.addHeader(Stomp.Headers.Message.MESSAGE_ID, String.valueOf(message.getMessageID())); SimpleString prefix = message.getSimpleStringProperty(Message.HDR_PREFIX); command.addHeader(Stomp.Headers.Message.DESTINATION, (prefix == null ? "" : prefix) + message.getAddress());