org.apache.activemq.artemis.api.core.Message.getAddress()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(12.5k)|赞(0)|评价(0)|浏览(323)

本文整理了Java中org.apache.activemq.artemis.api.core.Message.getAddress()方法的一些代码示例,展示了Message.getAddress()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Message.getAddress()方法的具体详情如下:
包路径:org.apache.activemq.artemis.api.core.Message
类名称:Message
方法名:getAddress

Message.getAddress介绍

暂无

代码示例

代码示例来源:origin: wildfly/wildfly

  1. /**
  2. * @return Returns the message in Map form, useful when encoding to JSON
  3. */
  4. default Map<String, Object> toMap() {
  5. Map map = toPropertyMap();
  6. map.put("messageID", getMessageID());
  7. Object userID = getUserID();
  8. if (getUserID() != null) {
  9. map.put("userID", "ID:" + userID.toString());
  10. }
  11. map.put("address", getAddress() == null ? "" : getAddress());
  12. map.put("durable", isDurable());
  13. map.put("expiration", getExpiration());
  14. map.put("timestamp", getTimestamp());
  15. map.put("priority", (int)getPriority());
  16. return map;
  17. }

代码示例来源:origin: apache/activemq-artemis

  1. targetBinding = remoteQueueBinding;
  2. if (logger.isDebugEnabled()) {
  3. logger.debug("Message now destined for " + remoteQueueBinding.getRoutingName() + " with ID: " + remoteQueueBinding.getRemoteQueueID() + " on address " + copyMessage.getAddress() + " on node " + targetNodeID);

代码示例来源:origin: wildfly/wildfly

  1. default void referenceOriginalMessage(final Message original, String originalQueue) {
  2. String queueOnMessage = original.getAnnotationString(Message.HDR_ORIGINAL_QUEUE);
  3. if (queueOnMessage != null) {
  4. setAnnotation(Message.HDR_ORIGINAL_QUEUE, queueOnMessage);
  5. } else if (originalQueue != null) {
  6. setAnnotation(Message.HDR_ORIGINAL_QUEUE, originalQueue);
  7. }
  8. Object originalID = original.getAnnotation(Message.HDR_ORIG_MESSAGE_ID);
  9. if (originalID != null) {
  10. setAnnotation(Message.HDR_ORIGINAL_ADDRESS, original.getAnnotationString(Message.HDR_ORIGINAL_ADDRESS));
  11. setAnnotation(Message.HDR_ORIG_MESSAGE_ID, originalID);
  12. } else {
  13. setAnnotation(Message.HDR_ORIGINAL_ADDRESS, original.getAddress());
  14. setAnnotation(Message.HDR_ORIG_MESSAGE_ID, original.getMessageID());
  15. }
  16. // reset expiry
  17. setExpiration(0);
  18. }

代码示例来源:origin: apache/activemq-artemis

  1. context.clear().setReusable(false);
  2. routeUsingStrictOrdering(message, context, groupingHandler, groupId, 0);
  3. } else if (CompositeAddress.isFullyQualified(message.getAddress())) {
  4. Binding theBinding = bindingsNameMap.get(CompositeAddress.extractQueueName(message.getAddressSimpleString()));
  5. if (theBinding != null) {

代码示例来源:origin: apache/activemq-artemis

  1. private void applyPrefixForLegacyConsumer(Message message) {
  2. /**
  3. * check to see if:
  4. * 1) This is a "core" connection
  5. * 2) The "core" connection belongs to a JMS client
  6. * 3) The JMS client is an "old" client which needs address prefixes
  7. *
  8. * If 1, 2, & 3 are true then apply the "old" prefix for queues and topics as appropriate.
  9. */
  10. if (requiresLegacyPrefix) {
  11. if (anycast) {
  12. if (!message.getAddress().startsWith(PacketImpl.OLD_QUEUE_PREFIX.toString())) {
  13. message.setAddress(PacketImpl.OLD_QUEUE_PREFIX + message.getAddress());
  14. }
  15. } else {
  16. if (!message.getAddress().startsWith(PacketImpl.OLD_TOPIC_PREFIX.toString())) {
  17. message.setAddress(PacketImpl.OLD_TOPIC_PREFIX + message.getAddress());
  18. }
  19. }
  20. }
  21. }

代码示例来源:origin: apache/activemq-artemis

  1. /**
  2. * @return Returns the message in Map form, useful when encoding to JSON
  3. */
  4. default Map<String, Object> toMap() {
  5. Map map = toPropertyMap();
  6. map.put("messageID", getMessageID());
  7. Object userID = getUserID();
  8. if (getUserID() != null) {
  9. map.put("userID", "ID:" + userID.toString());
  10. }
  11. map.put("address", getAddress() == null ? "" : getAddress());
  12. map.put("durable", isDurable());
  13. map.put("expiration", getExpiration());
  14. map.put("timestamp", getTimestamp());
  15. map.put("priority", (int)getPriority());
  16. return map;
  17. }

代码示例来源:origin: org.apache.activemq/artemis-core-client

  1. /**
  2. * @return Returns the message in Map form, useful when encoding to JSON
  3. */
  4. default Map<String, Object> toMap() {
  5. Map map = toPropertyMap();
  6. map.put("messageID", getMessageID());
  7. Object userID = getUserID();
  8. if (getUserID() != null) {
  9. map.put("userID", "ID:" + userID.toString());
  10. }
  11. map.put("address", getAddress() == null ? "" : getAddress());
  12. map.put("durable", isDurable());
  13. map.put("expiration", getExpiration());
  14. map.put("timestamp", getTimestamp());
  15. map.put("priority", (int)getPriority());
  16. return map;
  17. }

代码示例来源:origin: apache/activemq-artemis

  1. /**
  2. * @return Returns the message in Map form, useful when encoding to JSON
  3. */
  4. default Map<String, Object> toMap() {
  5. Map map = toPropertyMap();
  6. map.put("messageID", getMessageID());
  7. Object userID = getUserID();
  8. if (getUserID() != null) {
  9. map.put("userID", "ID:" + userID.toString());
  10. }
  11. map.put("address", getAddress() == null ? "" : getAddress());
  12. map.put("durable", isDurable());
  13. map.put("expiration", getExpiration());
  14. map.put("timestamp", getTimestamp());
  15. map.put("priority", (int)getPriority());
  16. return map;
  17. }

代码示例来源:origin: org.apache.activemq/artemis-jms-client-all

  1. /**
  2. * @return Returns the message in Map form, useful when encoding to JSON
  3. */
  4. default Map<String, Object> toMap() {
  5. Map map = toPropertyMap();
  6. map.put("messageID", getMessageID());
  7. Object userID = getUserID();
  8. if (getUserID() != null) {
  9. map.put("userID", "ID:" + userID.toString());
  10. }
  11. map.put("address", getAddress() == null ? "" : getAddress());
  12. map.put("durable", isDurable());
  13. map.put("expiration", getExpiration());
  14. map.put("timestamp", getTimestamp());
  15. map.put("priority", (int)getPriority());
  16. return map;
  17. }

代码示例来源:origin: org.jboss.eap/wildfly-client-all

  1. /**
  2. * @return Returns the message in Map form, useful when encoding to JSON
  3. */
  4. default Map<String, Object> toMap() {
  5. Map map = toPropertyMap();
  6. map.put("messageID", getMessageID());
  7. Object userID = getUserID();
  8. if (getUserID() != null) {
  9. map.put("userID", "ID:" + userID.toString());
  10. }
  11. map.put("address", getAddress() == null ? "" : getAddress());
  12. map.put("durable", isDurable());
  13. map.put("expiration", getExpiration());
  14. map.put("timestamp", getTimestamp());
  15. map.put("priority", (int)getPriority());
  16. return map;
  17. }

代码示例来源:origin: apache/activemq-artemis

  1. /**
  2. * @return Returns the message in Map form, useful when encoding to JSON
  3. */
  4. default Map<String, Object> toMap() {
  5. Map map = toPropertyMap();
  6. map.put("messageID", getMessageID());
  7. Object userID = getUserID();
  8. if (getUserID() != null) {
  9. map.put("userID", "ID:" + userID.toString());
  10. }
  11. map.put("address", getAddress() == null ? "" : getAddress());
  12. map.put("durable", isDurable());
  13. map.put("expiration", getExpiration());
  14. map.put("timestamp", getTimestamp());
  15. map.put("priority", (int)getPriority());
  16. return map;
  17. }

代码示例来源:origin: apache/activemq-artemis

  1. /**
  2. * We convert the core address to an ActiveMQ Destination. We use the actual address on the message rather than the
  3. * destination set on the consumer because it maybe different and the JMS spec says that it should be what ever was
  4. * set on publish/send so a divert or wildcard may mean thats its different to the destination subscribed to by the
  5. * consumer
  6. */
  7. public static ActiveMQDestination toAMQAddress(Message message, ActiveMQDestination actualDestination) {
  8. String address = message.getAddress();
  9. if (address == null || address.equals(actualDestination.getPhysicalName())) {
  10. return actualDestination;
  11. }
  12. if (actualDestination.isQueue()) {
  13. return new ActiveMQQueue(address);
  14. } else {
  15. return new ActiveMQTopic(address);
  16. }
  17. }

代码示例来源:origin: apache/activemq-artemis

  1. default void referenceOriginalMessage(final Message original, String originalQueue) {
  2. String queueOnMessage = original.getAnnotationString(Message.HDR_ORIGINAL_QUEUE);
  3. if (queueOnMessage != null) {
  4. setAnnotation(Message.HDR_ORIGINAL_QUEUE, queueOnMessage);
  5. } else if (originalQueue != null) {
  6. setAnnotation(Message.HDR_ORIGINAL_QUEUE, originalQueue);
  7. }
  8. Object originalID = original.getAnnotation(Message.HDR_ORIG_MESSAGE_ID);
  9. if (originalID != null) {
  10. setAnnotation(Message.HDR_ORIGINAL_ADDRESS, original.getAnnotationString(Message.HDR_ORIGINAL_ADDRESS));
  11. setAnnotation(Message.HDR_ORIG_MESSAGE_ID, originalID);
  12. } else {
  13. setAnnotation(Message.HDR_ORIGINAL_ADDRESS, original.getAddress());
  14. setAnnotation(Message.HDR_ORIG_MESSAGE_ID, original.getMessageID());
  15. }
  16. // reset expiry
  17. setExpiration(0);
  18. }

代码示例来源:origin: org.apache.activemq/artemis-core-client

  1. default void referenceOriginalMessage(final Message original, String originalQueue) {
  2. String queueOnMessage = original.getAnnotationString(Message.HDR_ORIGINAL_QUEUE);
  3. if (queueOnMessage != null) {
  4. setAnnotation(Message.HDR_ORIGINAL_QUEUE, queueOnMessage);
  5. } else if (originalQueue != null) {
  6. setAnnotation(Message.HDR_ORIGINAL_QUEUE, originalQueue);
  7. }
  8. Object originalID = original.getAnnotation(Message.HDR_ORIG_MESSAGE_ID);
  9. if (originalID != null) {
  10. setAnnotation(Message.HDR_ORIGINAL_ADDRESS, original.getAnnotationString(Message.HDR_ORIGINAL_ADDRESS));
  11. setAnnotation(Message.HDR_ORIG_MESSAGE_ID, originalID);
  12. } else {
  13. setAnnotation(Message.HDR_ORIGINAL_ADDRESS, original.getAddress());
  14. setAnnotation(Message.HDR_ORIG_MESSAGE_ID, original.getMessageID());
  15. }
  16. // reset expiry
  17. setExpiration(0);
  18. }

代码示例来源:origin: apache/activemq-artemis

  1. default void referenceOriginalMessage(final Message original, String originalQueue) {
  2. String queueOnMessage = original.getAnnotationString(Message.HDR_ORIGINAL_QUEUE);
  3. if (queueOnMessage != null) {
  4. setAnnotation(Message.HDR_ORIGINAL_QUEUE, queueOnMessage);
  5. } else if (originalQueue != null) {
  6. setAnnotation(Message.HDR_ORIGINAL_QUEUE, originalQueue);
  7. }
  8. Object originalID = original.getAnnotation(Message.HDR_ORIG_MESSAGE_ID);
  9. if (originalID != null) {
  10. setAnnotation(Message.HDR_ORIGINAL_ADDRESS, original.getAnnotationString(Message.HDR_ORIGINAL_ADDRESS));
  11. setAnnotation(Message.HDR_ORIG_MESSAGE_ID, originalID);
  12. } else {
  13. setAnnotation(Message.HDR_ORIGINAL_ADDRESS, original.getAddress());
  14. setAnnotation(Message.HDR_ORIG_MESSAGE_ID, original.getMessageID());
  15. }
  16. // reset expiry
  17. setExpiration(0);
  18. }

代码示例来源:origin: apache/activemq-artemis

  1. default void referenceOriginalMessage(final Message original, String originalQueue) {
  2. String queueOnMessage = original.getAnnotationString(Message.HDR_ORIGINAL_QUEUE);
  3. if (queueOnMessage != null) {
  4. setAnnotation(Message.HDR_ORIGINAL_QUEUE, queueOnMessage);
  5. } else if (originalQueue != null) {
  6. setAnnotation(Message.HDR_ORIGINAL_QUEUE, originalQueue);
  7. }
  8. Object originalID = original.getAnnotation(Message.HDR_ORIG_MESSAGE_ID);
  9. if (originalID != null) {
  10. setAnnotation(Message.HDR_ORIGINAL_ADDRESS, original.getAnnotationString(Message.HDR_ORIGINAL_ADDRESS));
  11. setAnnotation(Message.HDR_ORIG_MESSAGE_ID, originalID);
  12. } else {
  13. setAnnotation(Message.HDR_ORIGINAL_ADDRESS, original.getAddress());
  14. setAnnotation(Message.HDR_ORIG_MESSAGE_ID, original.getMessageID());
  15. }
  16. // reset expiry
  17. setExpiration(0);
  18. }

代码示例来源:origin: org.apache.activemq/artemis-jms-client-all

  1. default void referenceOriginalMessage(final Message original, String originalQueue) {
  2. String queueOnMessage = original.getAnnotationString(Message.HDR_ORIGINAL_QUEUE);
  3. if (queueOnMessage != null) {
  4. setAnnotation(Message.HDR_ORIGINAL_QUEUE, queueOnMessage);
  5. } else if (originalQueue != null) {
  6. setAnnotation(Message.HDR_ORIGINAL_QUEUE, originalQueue);
  7. }
  8. Object originalID = original.getAnnotation(Message.HDR_ORIG_MESSAGE_ID);
  9. if (originalID != null) {
  10. setAnnotation(Message.HDR_ORIGINAL_ADDRESS, original.getAnnotationString(Message.HDR_ORIGINAL_ADDRESS));
  11. setAnnotation(Message.HDR_ORIG_MESSAGE_ID, originalID);
  12. } else {
  13. setAnnotation(Message.HDR_ORIGINAL_ADDRESS, original.getAddress());
  14. setAnnotation(Message.HDR_ORIG_MESSAGE_ID, original.getMessageID());
  15. }
  16. // reset expiry
  17. setExpiration(0);
  18. }

代码示例来源:origin: org.jboss.eap/wildfly-client-all

  1. default void referenceOriginalMessage(final Message original, String originalQueue) {
  2. String queueOnMessage = original.getAnnotationString(Message.HDR_ORIGINAL_QUEUE);
  3. if (queueOnMessage != null) {
  4. setAnnotation(Message.HDR_ORIGINAL_QUEUE, queueOnMessage);
  5. } else if (originalQueue != null) {
  6. setAnnotation(Message.HDR_ORIGINAL_QUEUE, originalQueue);
  7. }
  8. Object originalID = original.getAnnotation(Message.HDR_ORIG_MESSAGE_ID);
  9. if (originalID != null) {
  10. setAnnotation(Message.HDR_ORIGINAL_ADDRESS, original.getAnnotationString(Message.HDR_ORIGINAL_ADDRESS));
  11. setAnnotation(Message.HDR_ORIG_MESSAGE_ID, originalID);
  12. } else {
  13. setAnnotation(Message.HDR_ORIGINAL_ADDRESS, original.getAddress());
  14. setAnnotation(Message.HDR_ORIG_MESSAGE_ID, original.getMessageID());
  15. }
  16. // reset expiry
  17. setExpiration(0);
  18. }

代码示例来源:origin: apache/activemq-artemis

  1. return msg.getEncodeSize();
  2. } else if (FilterConstants.ACTIVEMQ_ADDRESS.equals(fieldName)) {
  3. return msg.getAddress();
  4. } else if (FilterConstants.ACTIVEMQ_GROUP_ID.equals(fieldName)) {
  5. return msg.getGroupID();

代码示例来源:origin: apache/activemq-artemis

  1. command.addHeader(Stomp.Headers.Message.MESSAGE_ID, String.valueOf(message.getMessageID()));
  2. SimpleString prefix = message.getSimpleStringProperty(Message.HDR_PREFIX);
  3. command.addHeader(Stomp.Headers.Message.DESTINATION, (prefix == null ? "" : prefix) + message.getAddress());

相关文章