On 07/06/17 23:51, ncampbe wrote:
Hi all,

I am using JMS 11.1 (can't install java 8) and trying to subscribe to a
specific subject under 'amq.topic' (broker is a QPID 0.36 C++ broker)

This works (except I get all messages sent to amq.topic):
TopicSubscriber sub =
session.createSubscriber(session.createTopic("amq.topic"));

I have tried:
TopicSubscriber sub =
session.createSubscriber(session.createTopic("amq.topic/someKey");
TopicSubscriber sub =
session.createSubscriber(session.createTopic("topic://amq.topic?routingKey=someKey");
TopicSubscriber sub =
session.createSubscriber(session.createTopic("amq.topic?routingKey=someKey");
(and numerous various on this same theme) that I have found online.

Various older docs make it look like this SHOULD work (it does on C++ side
for qpid::messaging::Address).

Everything I have tried causes an "amq:not-found" error on the broker.  The
broker appears to be using the entire topic (i.e. "amq.topic/someKey") as
the exchange, instead of exchange 'amq.topic' with subject/routingKey of
'someKey'.  Broker prints out "Error on attach: Node not found:
amq.topic/someKey" (where Node matches topic I created).

I realize that I can use message selectors when I create the subscriber to
filter the messages however that isn't an ideal solution for me for several
reasons.

Any suggestions on how I can get subject/routingKey filtering via JMS?

At present, the c++ broker only supports specifying the 'routing key' (i.e. the pattern to match against the subject) via the 'legacy' filters we defined:


https://github.com/apache/qpid/blob/trunk/qpid/specs/apache-filters.xml#L54

The qpid::messaging API will create an appropriate filter based on node/subject (you can avoid that if needed by quoting), however other clients/APIs will not.




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@qpid.apache.org
For additional commands, e-mail: users-h...@qpid.apache.org

Reply via email to