RabbitMQ 4.x. Part one.
RabbitMQ 4 was released in September 2024. The most important features are:
This post series will analyse this release's news and explain why you should update your old RabbitMQ.
Let's start with AMQP 1.0
You can find the AMQP 1.0 details in RabbitMQ here.
Practically speaking, here are two points that, as a developer, I found interesting:
The publish function returns the Outcome.State for each single message:
PublishResult pr = await publisher.PublishAsync(new AmqpMessage("Subscribe to this newsletter");
The Outcome State can be:
The feedback is immediate for each publish, giving you more control over what happens. 😱
When you consume a message, the clients will provide you with four ways to deal with it
connection.ConsumerBuilder().Queue(queueName).MessageHandler((context, message) =>{
Ok, here are the interesting parts:
4. Discard(Dictionary<string, object> annotations): The message cannot be processed. You can discard it by adding annotations. In case of dead-letter the message will contain the annotation. I would only use AMQP 1.0 for this. 💥
5. Requeue(Dictionary<string, object> annotations): Requeue with annotations. The broker will deliver the message to the next consumer with annotations.🎶
Can you imagine the control you can have when something goes wrong? 🤯
(The example is in CSharp, but it is the same with other languages.)
AMQP 1.0 Clients
Oh yes, how can you start without clients?
The RabbitMQ team is writing a new set of AMQP 1.0 clients.
The clients are wrappers around existing and stable AMQP 1.0 clients ( like QPID, AzureAMQP, etc). They are designed to easily use all the features, be resilient with auto-reconnection, and support OAuth JWT authentication and token renewal.
Here you can find the client's documentation
Conclusions
You may start using AMQP 1.0 on some part of your current environment. The team did a great job making all the protocols compatible. Thus, you can use AMQP 0.9.1, AMQP 1.0, the Stream protocol, etc., in the same environment.
AMQP 1.0 is much more than this. In this post, I invite you to explore and try the protocol. You may use it instead of AMQP 0.9.1.
Here you can find more documentation about AMQP 1.0:
Need help? Check https://www.rabbitmq.com/contact#consulting for community and commercial support.
Happy RabbitMQ messaging! 🎉
Rust/C++
4moRabbitMQ is not an actual rabbit i heard
🎥 Sensei & Co-Host @ DevDojo IT 🎤 Speaker ♿️ Accessibility WCAG Expert ✨ Turning Designs into interactive things 🦸♂️ Your friendly neighborhood Design Engineer
4moGabriele Santomaggio ad ogni episodio mi viene sempre più voglia di entrare nella tana del GiallConiglio <3