Dr oscar
Dr oscar

Reputation: 415

Cannot see message on rabbitmq using EventBus.RabbitMQ.Standard

I'm start to learn about microservices with rabbitmq on .net core. I tried to understand how implement a simple way for publish and subscribe events, and i found a nuget with a samples on: Github EventBus.RabbitMQ.Standard

I execute the Publisher example and consume URL for publish a simple event with this configuration:

"RabbitMq": {
"BrokerName": "test_broker",
"AutofacScopeName": "test_autofac",
"QueueName": "temp_queue",
"RetryCount": "5",
"VirtualHost": "/",
"Username": "guest",
"Password": "guest",
"Host": "localhost",
"DispatchConsumersAsync": true

}

Now works, create the queue and not generate a exception, but i cannot see a message on queue: enter image description here

enter image description here

Nowadays with my knowledge about rabbitmq i dont know if maybe is a error on my rabbit configuration or if is a error on the nuget library.

Any ideas about what may be happening?

Upvotes: 0

Views: 1214

Answers (3)

Dr oscar
Dr oscar

Reputation: 415

I found the error on my implementation. I dont put on my Startup class (in Configure method) of my subscriber:           

app.SubscribeToEvents();

Because that part not exists in the blog-github example documentation ;/ .

Upvotes: 0

Bercovici Adrian
Bercovici Adrian

Reputation: 9370

Have you tried looking at the tutorials on their website ? It explains pretty clearly how to both publish and subscribe to messages, how exchanges,queues and routing keys work etc...

Upvotes: 0

user10589455
user10589455

Reputation:

Basically you won't see messages in a queue if there is no consumer(s).

  1. Set up appsettings.json for a Publisher and a Subscriber
  2. Run the Publisher and the Subscriber
  3. Publish a message and see the message in the Subscriber
  4. Stop the Subscriber app
  5. Publish a new message and see the message in RabbitMQ Management

Upvotes: 1

Related Questions