From the course: Learning RabbitMQ: Efficient Message Queuing
Unlock this course with a free trial
Join today to access over 24,900 courses taught by industry experts.
Validate user IDs - RabbitMQ Tutorial
From the course: Learning RabbitMQ: Efficient Message Queuing
Validate user IDs
- [Instructor] When we receive a message from RabbitMQ, we don't know by default which user or application published this message. This is where validated user IDs come into play. When publishing a message to RabbitMQ, you can add a user ID. This is the username your application used to connect with RabbitMQ. If the user ID doesn't match the username used to connect to RabbitMQ, the message will be refused. This means that RabbitMQ validates the user ID in the message. That way, a consumer can be sure that the message originated from a specific user. Adding a user ID to your message is easy. Just set the UserId property of the BasicProperties object. In this case, I'll set it to WebApp, which is the user ID we used to connect. Now, in the Backoffice, I'll display this user ID on the console. So, var userId = eventArgs.BasicProperties.UserId And then here, I'll just output it to the console. Okay, let's run our…
Contents
-
-
-
-
-
(Locked)
Set up and use authentication3m 38s
-
(Locked)
Authorize or block application actions3m 54s
-
(Locked)
Validate user IDs2m 44s
-
(Locked)
Working with dead letter exchanges7m 17s
-
(Locked)
Tracing message contents for troubleshooting2m 27s
-
(Locked)
Challenge: Show chat users34s
-
(Locked)
Solution: Show chat users3m 9s
-
(Locked)
-