0
votes

I am testing with pub/sub using Java and Qpid JMS 0.23.

I have created a topic in SB named "test.topic".

I can publish messages to the topic from test app but when trying to subscribe (dynamically creating subscription) it fails with exception:

javax.jms.InvalidDestinationException: The messaging entity 'mynamespace:topic:test.topic~15|DurableSubscriber2' could not be found. TrackingId:12ecc2a3-f8f3-42a3-8bd5-ad5d9823c367_B20, SystemTracker:mynamespace:topic:test.topic~15|DurableSubscriber2, Timestamp:8/8/2017 12:13:31 PM TrackingId:7e0d46404c8c45f39bffff2b77c7a140_G21, SystemTracker:gateway6, Timestamp:8/8/2017 12:13:31 PM [condition = amqp:not-found]

Some code:

env.put("topic.TOPIC", "test.topic");

Context context = new InitialContext(env);

ConnectionFactory connectionFactory = (ConnectionFactory) context.lookup("SBCF");
Topic topic = (Topic) context.lookup("TOPIC");

connection = connectionFactory.createConnection("user", "secret");

subscriberSession = connection.createSession(false, Session.CLIENT_ACKNOWLEDGE);

subscriber = subscriberSession.createDurableConsumer(topic, "DurableSubscriber2");
  • Is it possible to create subscriptions on topic in SB from application?

If I create a static subscription named "sub1" on the topic it receives published messages. When retrieving I need to have the topic defined as:

test.topic/Subscriptions/sub1

i.e.

<<topic-name>>/Subscriptions/<<subscription-name>>
  • Do I need to have some similar naming when dynamically subscribing?
1

1 Answers

0
votes

Please see the section Unsupported features and restrictions of the document How to use the Java Message Service (JMS) API with Service Bus and AMQP 1.0 and focus on the option Temporary destinations as below.

Temporary destinations, i.e., TemporaryQueue, TemporaryTopic are not currently supported, along with the QueueRequestor and TopicRequestor APIs that use them.

So I think dynamically create a subscription is not supported on Azure Service Bus.