Which correct protocol should I choose?

Options
zgl
zgl Member Posts: 5
edited August 2023 in PubSub+ Event Broker #1
Hi!
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!
Tagged:

Best Answer

  • uherbst
    uherbst Member, Employee Posts: 121 Solace Employee
    #2 Answer ✓
    Options

    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:

    1. Typical workflow: Publish to a topic, consume from a queue
    2. 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)

Answers

  • uherbst
    uherbst Member, Employee Posts: 121 Solace Employee
    Options

    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

  • zgl
    zgl Member Posts: 5
    Options
    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,
    Guilherme
  • uherbst
    uherbst Member, Employee Posts: 121 Solace Employee
    #5 Answer ✓
    Options

    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:

    1. Typical workflow: Publish to a topic, consume from a queue
    2. 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)

  • zgl
    zgl Member Posts: 5
    Options

    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.