Tomáš Lazar
Tomáš Lazar

Reputation: 1

How to subscribe to queue in ActiveMQ Artemis using MQTT?

I'm having a problem with ActiveMQ Artemis subscribing to queue using MQTT. When I subscribe to a specific address the broker creates a new temporary queue named deviceID.address despite having queue to join. For example, I have a queue test with address test, and when I send a subscription with topic test the broker creates a new non-durable queue with a name DeviceID.test, and I don't know what the proper syntax is to subscribe to the right queue.

I tried all the combinations for exampled only address or adress/queue, and I can't find the proper syntax to subscribing.

Upvotes: 0

Views: 193

Answers (1)

Justin Bertram
Justin Bertram

Reputation: 35028

The MQTT protocol supports subscribing to topics to achieve pub/sub semantics. If you read through the MQTT specification you'll find no mention of subscribing to a queue. The behavior you're seeing is expected.

That said, ActiveMQ Artemis supports the ability to specify the fully qualified queue name (i.e. FQQN) which I believe you can use from your MQTT subscriber. In your case, the FQQN would be test::test.

You might want to ensure your use of MQTT actually fits your overall use-case. You might should use a different protocol if you really need the point-to-point semantics of a queue.

Upvotes: 1

Related Questions