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?