You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by jbertram <gi...@git.apache.org> on 2018/12/13 19:14:17 UTC
[GitHub] activemq-artemis pull request #2464: ARTEMIS-1859 Incorrect routing with AMQ...
GitHub user jbertram opened a pull request:
https://github.com/apache/activemq-artemis/pull/2464
ARTEMIS-1859 Incorrect routing with AMQP anonymous producer & auto-created queue
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/jbertram/activemq-artemis ARTEMIS-1859
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/activemq-artemis/pull/2464.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #2464
----
commit 6a8a26dbcff9a386755150282eb7ea3cd91665ff
Author: Jiri Danek <jd...@...>
Date: 2018-05-11T09:20:35Z
ARTEMIS-1859 Adding testAnonymousProducerWithQueueAutoCreation
commit 3920a4655a7dec91d71fc23e584d8dc168148059
Author: Justin Bertram <jb...@...>
Date: 2018-12-13T19:11:24Z
ARTEMIS-1859 incorrect routing with AMQP anonymous producer & auto-created queue
----
---
[GitHub] activemq-artemis pull request #2464: ARTEMIS-1859 Incorrect routing with AMQ...
Posted by jbertram <gi...@git.apache.org>.
Github user jbertram commented on a diff in the pull request:
https://github.com/apache/activemq-artemis/pull/2464#discussion_r243026861
--- Diff: artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/ProtonServerReceiverContext.java ---
@@ -216,9 +219,23 @@ public RemotingConnection getRemotingConnection() {
flow();
}
- public RoutingType getRoutingType(Receiver receiver, SimpleString address) {
+ public RoutingType getRoutingType(Receiver receiver, SimpleString address, AMQPMessage message) {
org.apache.qpid.proton.amqp.messaging.Target target = (org.apache.qpid.proton.amqp.messaging.Target) receiver.getRemoteTarget();
- return target != null ? getRoutingType(target.getCapabilities(), address) : getRoutingType((Symbol[]) null, address);
+ // the target may be null or have no capabilities in the case of an anonymous producer
+ if (target != null && target.getCapabilities() != null) {
--- End diff --
I'll rework this. Thanks for the feedback, @gemmellr.
---
[GitHub] activemq-artemis pull request #2464: ARTEMIS-1859 Incorrect routing with AMQ...
Posted by jbertram <gi...@git.apache.org>.
Github user jbertram closed the pull request at:
https://github.com/apache/activemq-artemis/pull/2464
---
[GitHub] activemq-artemis pull request #2464: ARTEMIS-1859 Incorrect routing with AMQ...
Posted by gemmellr <gi...@git.apache.org>.
Github user gemmellr commented on a diff in the pull request:
https://github.com/apache/activemq-artemis/pull/2464#discussion_r242205353
--- Diff: artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/ProtonServerReceiverContext.java ---
@@ -216,9 +219,23 @@ public RemotingConnection getRemotingConnection() {
flow();
}
- public RoutingType getRoutingType(Receiver receiver, SimpleString address) {
+ public RoutingType getRoutingType(Receiver receiver, SimpleString address, AMQPMessage message) {
org.apache.qpid.proton.amqp.messaging.Target target = (org.apache.qpid.proton.amqp.messaging.Target) receiver.getRemoteTarget();
- return target != null ? getRoutingType(target.getCapabilities(), address) : getRoutingType((Symbol[]) null, address);
+ // the target may be null or have no capabilities in the case of an anonymous producer
+ if (target != null && target.getCapabilities() != null) {
--- End diff --
Doing this for each message seems a[n existing?] waste. Also, the comment and check aren't really achieving what seems to be desired, which is to know if its not an anonymous producer.
This part of the process could be done once when the link first attaches, with the routing type value deduced and used here later rather than repeating the process over and over. The initial attachment is also a better point in time to establish whether it is an anonymous producer or not. The Anonymous Relay is represented by the target with null address, but nothing prevents there being capabilities associated with it, so this check could erroneously catch an anonymous producer link. It should inspect the link target address to make the distinction.
---