Repository: qpid-jms Updated Branches: refs/heads/master 0c8f52ab7 -> 10af4ad80
QPIDJMS-170 Simplify the message routing and jump right to the parent session. Project: http://git-wip-us.apache.org/repos/asf/qpid-jms/repo Commit: http://git-wip-us.apache.org/repos/asf/qpid-jms/commit/10af4ad8 Tree: http://git-wip-us.apache.org/repos/asf/qpid-jms/tree/10af4ad8 Diff: http://git-wip-us.apache.org/repos/asf/qpid-jms/diff/10af4ad8 Branch: refs/heads/master Commit: 10af4ad8035186ec2083231f162298e3947562e0 Parents: 0c8f52a Author: Timothy Bish <[email protected]> Authored: Wed Apr 6 11:14:14 2016 -0400 Committer: Timothy Bish <[email protected]> Committed: Wed Apr 6 11:14:14 2016 -0400 ---------------------------------------------------------------------- .../main/java/org/apache/qpid/jms/JmsConnection.java | 12 +----------- .../src/main/java/org/apache/qpid/jms/JmsSession.java | 2 -- 2 files changed, 1 insertion(+), 13 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/10af4ad8/qpid-jms-client/src/main/java/org/apache/qpid/jms/JmsConnection.java ---------------------------------------------------------------------- diff --git a/qpid-jms-client/src/main/java/org/apache/qpid/jms/JmsConnection.java b/qpid-jms-client/src/main/java/org/apache/qpid/jms/JmsConnection.java index 2ead1bf..fd2d5be 100644 --- a/qpid-jms-client/src/main/java/org/apache/qpid/jms/JmsConnection.java +++ b/qpid-jms-client/src/main/java/org/apache/qpid/jms/JmsConnection.java @@ -88,8 +88,6 @@ public class JmsConnection implements AutoCloseable, Connection, TopicConnection private final IdGenerator clientIdGenerator; private final Map<JmsSessionId, JmsSession> sessions = new ConcurrentHashMap<JmsSessionId, JmsSession>(); - private final Map<JmsConsumerId, JmsMessageDispatcher> dispatchers = - new ConcurrentHashMap<JmsConsumerId, JmsMessageDispatcher>(); private final AtomicBoolean connected = new AtomicBoolean(); private final AtomicBoolean closed = new AtomicBoolean(); private final AtomicBoolean closing = new AtomicBoolean(); @@ -432,14 +430,6 @@ public class JmsConnection implements AutoCloseable, Connection, TopicConnection sessions.put(sessionInfo.getId(), session); } - protected void addDispatcher(JmsConsumerId consumerId, JmsMessageDispatcher dispatcher) { - dispatchers.put(consumerId, dispatcher); - } - - protected void removeDispatcher(JmsConsumerId consumerId) { - dispatchers.remove(consumerId); - } - private void connect() throws JMSException { if (isConnected() || closed.get()) { return; @@ -1042,7 +1032,7 @@ public class JmsConnection implements AutoCloseable, Connection, TopicConnection incoming.setValidatePropertyNames(isValidatePropertyNames()); } - JmsMessageDispatcher dispatcher = dispatchers.get(envelope.getConsumerId()); + JmsMessageDispatcher dispatcher = sessions.get(envelope.getConsumerId().getParentId()); if (dispatcher != null) { dispatcher.onInboundMessage(envelope); } http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/10af4ad8/qpid-jms-client/src/main/java/org/apache/qpid/jms/JmsSession.java ---------------------------------------------------------------------- diff --git a/qpid-jms-client/src/main/java/org/apache/qpid/jms/JmsSession.java b/qpid-jms-client/src/main/java/org/apache/qpid/jms/JmsSession.java index 8e5088e..c00cdbd 100644 --- a/qpid-jms-client/src/main/java/org/apache/qpid/jms/JmsSession.java +++ b/qpid-jms-client/src/main/java/org/apache/qpid/jms/JmsSession.java @@ -584,7 +584,6 @@ public class JmsSession implements AutoCloseable, Session, QueueSession, TopicSe protected void add(JmsMessageConsumer consumer) throws JMSException { consumers.put(consumer.getConsumerId(), consumer); - connection.addDispatcher(consumer.getConsumerId(), this); if (started.get()) { consumer.start(); @@ -592,7 +591,6 @@ public class JmsSession implements AutoCloseable, Session, QueueSession, TopicSe } protected void remove(JmsMessageConsumer consumer) throws JMSException { - connection.removeDispatcher(consumer.getConsumerId()); consumers.remove(consumer.getConsumerId()); } --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
