Simple working usage examples for FastCSharp's RabbitPublisher and RabbitSubscriber
- Clone this repository
- Open the solution in Visual Studio Code
- Run a RabbitMQ server (e.g. using Docker) in the default port (5672).
- Run setup-amq.bat to create the required exchanges and queues. Or follow the instructions in this page.
- Run the publisher and subscriber projects in different consoles. Checkout more details in the RabbitPublisher and RabbitSubscriber pages.
- Use the Swagger UI to send messages to the publisher. Or use the browser with the url http://localhost:5106/SendDirectMessage?message=Hello (you can change the message parameter to whatever you want).
- Check the console of the subscriber to see the messages received.
- Check the console of the publisher to see the messages sent confirmation.
- Use teardown-amq.bat to remove the exchanges and queues. Or follow the instructions in this page.
You can stop the subscriber and check the RabbitMQ management page to see the messages in the queues. Starting the subscriber again will consume the messages in the queues.