Repository: qpid-jms Updated Branches: refs/heads/master 0d7e2539a -> cc9f8dfea
Create the message level Destination and ReplyTo objects lazily since we may never need them if the client doesn't call getJMSDestination or getJMSReplyTo, pushes off the work to the client threads. Project: http://git-wip-us.apache.org/repos/asf/qpid-jms/repo Commit: http://git-wip-us.apache.org/repos/asf/qpid-jms/commit/cc9f8dfe Tree: http://git-wip-us.apache.org/repos/asf/qpid-jms/tree/cc9f8dfe Diff: http://git-wip-us.apache.org/repos/asf/qpid-jms/diff/cc9f8dfe Branch: refs/heads/master Commit: cc9f8dfea8e91aabf5b50a9edfc120f90ba0841a Parents: 0d7e253 Author: Timothy Bish <tabish...@gmail.com> Authored: Mon Sep 29 09:42:22 2014 -0400 Committer: Timothy Bish <tabish...@gmail.com> Committed: Mon Sep 29 09:42:22 2014 -0400 ---------------------------------------------------------------------- .../provider/amqp/message/AmqpJmsMessageFacade.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/cc9f8dfe/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsMessageFacade.java ---------------------------------------------------------------------- diff --git a/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsMessageFacade.java b/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsMessageFacade.java index 02f3d7e..8d1b774 100644 --- a/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsMessageFacade.java +++ b/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/message/AmqpJmsMessageFacade.java @@ -67,6 +67,7 @@ public class AmqpJmsMessageFacade implements JmsMessageFacade { private JmsDestination replyTo; private JmsDestination destination; + private JmsDestination consumerDestination; private Long syntheticTTL; @@ -103,6 +104,7 @@ public class AmqpJmsMessageFacade implements JmsMessageFacade { public AmqpJmsMessageFacade(AmqpConsumer consumer, Message message) { this.message = message; this.connection = consumer.getConnection(); + this.consumerDestination = consumer.getDestination(); annotations = message.getMessageAnnotations(); if (annotations != null) { @@ -118,9 +120,6 @@ public class AmqpJmsMessageFacade implements JmsMessageFacade { if (absoluteExpiryTime == null && ttl != null) { syntheticTTL = System.currentTimeMillis() + ttl; } - - this.destination = AmqpDestinationHelper.INSTANCE.getJmsDestination(this, consumer.getDestination()); - this.replyTo = AmqpDestinationHelper.INSTANCE.getJmsReplyTo(this, consumer.getDestination()); } /** @@ -580,6 +579,10 @@ public class AmqpJmsMessageFacade implements JmsMessageFacade { @Override public JmsDestination getDestination() { + if (destination == null) { + this.destination = AmqpDestinationHelper.INSTANCE.getJmsDestination(this, consumerDestination); + } + return destination; } @@ -592,6 +595,10 @@ public class AmqpJmsMessageFacade implements JmsMessageFacade { @Override public JmsDestination getReplyTo() { + if (replyTo == null) { + replyTo = AmqpDestinationHelper.INSTANCE.getJmsReplyTo(this, consumerDestination); + } + return replyTo; } --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org For additional commands, e-mail: commits-h...@qpid.apache.org