dart_amqp icon indicating copy to clipboard operation
dart_amqp copied to clipboard

Can i listen a topic with this plugin?

Open barangungor opened this issue 2 years ago • 3 comments

I want listen a topic from my app. Can i do that?

barangungor avatar Apr 04 '22 07:04 barangungor

Take a look in the example folder. This example in particular demonstrates how to listen to a particular topic in a pubsub scenario.

achilleasa avatar Apr 04 '22 11:04 achilleasa

I saw that, but it look like listen a queue. Should i use Exchange if i want listen a topic?

barangungor avatar Apr 04 '22 12:04 barangungor

In the linked example, the exchange will fan out a copy of each message to each subscribed (private) queue. The main idea here is that each consumer defines a private queue to ensure that they get a copy for every message published to the exchange as you would expect in a pubsub scenario.

See the "fanout exchange routing" section in the rabbit docs for more details on how this works.

achilleasa avatar Apr 04 '22 16:04 achilleasa