Which correct protocol should I choose?
I'm new working on Solace PubSub and despite the fact I've been reading a lot, I didn't understand which is the correct protocol I should use.
For example, I have an application publishing more than 1k events per hour on dynamic topics. It can be company/salesorder/usa/123/234, company/salesorder/usa/453/1/45, company/salesorder/mexico/123/13, company/salesorder/brazil/1, and so on. Properties like /usa/123/234 can vary to different combinations.
I created some queues and subscribed topics to them, like company/salesorder/usa/>, and consumed queued messages.
I managed to publish guaranteed messages using SMF over Web Sockets and tried to do the same using AMQP and MQTT. What I didn't understand very well, to use AMQP and MQTT I must publish direct to a queue? When I try to publish to a topic using AMQP, Solace returns a message that the queue does not exist.
Can I publish to topics using AMQP, MQTT? If not, what scenario shall I use SMF, AMQP and MQTT?
Thanks and regards!
Best Answer
-
Hi Guilherme,
Correct, AMQP in Solace brokers supports only persistent messages (in Solace speak, they are often called "Guaranteed messages").
Dynamic topics using AMQP: Absolutely possible.
The typical flow is:
publisher (can be done any supported language / API) publishes to a dynamic topic, for example /order/<orderid>/<customerid.
In the broker, you can configure as many queues as you want with wildcard-subscriptions, for example:
Queue: all_orders. Subscription /order/>
Queue: all_orders_from_customer123. Subscription /order/*/customer123/
And then, you configure your consumer to bind to your queue, for example one consumer binds to "all_orders", one consumer binds to "all_orders_from_customer123".
Create queue / add subscription:
I want to repeat:
- Typical workflow: Publish to a topic, consume from a queue
- There is no need for publisher and consumer to use the same protocol or the same language. (you can publish from Java/SMF and consume with python/AMQP, if you want)
0
Answers
-
You forgot to mention HTTP Post for publishing :-)
In fact, you can choose whatever protocol you like for publishing and (with a few limitations) for subscribing.Most general protocol and fastest protocol is SMF - you can choose to use Java, python, GO (and more) as programming language.
In all that protocols you can publish to a topic - and you can consume from a queue (exception: MQTT: The MQTT protocol with QoS=1 is a bit picky about choosing a fixed queue for consuming).
If you have no obligations to use e.g. AMQP and you use a language, where SMF API is supported: Choose SMF.Thank you
Uli
0 -
Hi Uli.
Thanks for your reply.
Checking documentation below, as far I understood, AMQP solution processes only persistent messages (queue and durable topic endpoints). https://docs.solace.com/API/Component-Maps.htm#AMQP
Is it possible achieve my goal publishing to dynamic topics using AMQP? I don't want publish to durable topic endpoints, I want to publish to any topic and that broker routes it to the correct queue.
Thanks and regards,
Guilherme0 -
Hi Guilherme,
Correct, AMQP in Solace brokers supports only persistent messages (in Solace speak, they are often called "Guaranteed messages").
Dynamic topics using AMQP: Absolutely possible.
The typical flow is:
publisher (can be done any supported language / API) publishes to a dynamic topic, for example /order/<orderid>/<customerid.
In the broker, you can configure as many queues as you want with wildcard-subscriptions, for example:
Queue: all_orders. Subscription /order/>
Queue: all_orders_from_customer123. Subscription /order/*/customer123/
And then, you configure your consumer to bind to your queue, for example one consumer binds to "all_orders", one consumer binds to "all_orders_from_customer123".
Create queue / add subscription:
I want to repeat:
- Typical workflow: Publish to a topic, consume from a queue
- There is no need for publisher and consumer to use the same protocol or the same language. (you can publish from Java/SMF and consume with python/AMQP, if you want)
0 -
Thank you very much!
I managed to do it using SMF but with AMQP, when I publish to a topic returns a message from Solace that the "queue" does not exist, even though I'm not publishing to a queue and it's the same topic that I used to SMF.
I will check my app. Maybe there's something wrong there.
0 -
Hi, all, I need to reactivate this topic xD
I have an application that works on IBM MQ and consumes and sends all kind of messages to topics.I have used AMQPNetLite.dll to achieve this solution, I connect successfully as AMQP client to my Solace Server but when I try to publish any message, I have the same error, Queue does not exist.
Could anyone help?
Thanks :)0