RabbitMq Queue Durability and Persistent MessageDelivery | SpringBoot

https://grokonez.com/spring-framework/spring-amqp/rabbitmq-queue-durability-persistent-messagedelivery-springboot

RabbitMq Queue Durability and Persistent MessageDelivery | SpringBoot

In the tutorial, JavaSampleApproach will show you how to work with RabbitMq Queue Durability and Persistent MessageDelivery.

Related posts:

I. Technologies

– Java 8
– Maven 3.6.1
– Spring Tool Suite – Version 3.8.1.RELEASE
– Spring Boot: 1.5.7.RELEASE
– RabbitMq

II. RabbitMq Queue Durability and Persistent MessageDelivery

RabbitMq Queue has 2 kind of durability: {Durable, Transient}.

  • Durable queue is a solution for re-declared persistent messages during broker restarts if broker is taken down.

springboot rabbitmq durable queue - architecture

Scenarios with above design:

  • When sending 2 messages {a persistent message, a trasient message} to exchange X, all messages will be delivered to 2 queues {Q1, Q2}.
  • Stop RabbitMq service, then re-start it -> just a persistent message will be re-declared in durable queue Q1.

With Spring framework, default message is PERSISTENT mode:


package org.springframework.amqp.core;
...

public class MessageProperties implements Serializable {
    ...
    
    public static final MessageDeliveryMode DEFAULT_DELIVERY_MODE = MessageDeliveryMode.PERSISTENT;
    ...
    
}

We can change the delivery mode as below:

More at:

https://grokonez.com/spring-framework/spring-amqp/rabbitmq-queue-durability-persistent-messagedelivery-springboot

RabbitMq Queue Durability and Persistent MessageDelivery | SpringBoot

Bình luận


White
{{ comment.user.name }}
Bỏ hay Hay
{{comment.like_count}}
Male avatar
{{ comment_error }}
Hủy
   

Hiển thị thử

Chỉnh sửa

Male avatar

loveprogramming

545 bài viết.
97 người follow
Kipalog
{{userFollowed ? 'Following' : 'Follow'}}
Cùng một tác giả
Male avatar
1 0
Tutorial Link: (Link) (Ảnh) Django is a Pythonbased free and opensource web framework that follows the modeltemplateview architectural pattern. A...
loveprogramming viết 12 tháng trước
1 0
Male avatar
1 0
https://loizenai.com/angular11nodejspostgresqlcrudexample/ Angular 11 Node.js PostgreSQL Crud Example (Ảnh) Tutorial: “Angular 11 Node.js Postg...
loveprogramming viết 10 tháng trước
1 0
Male avatar
1 0
Angular Spring Boot jwt Authentication Example Github https://loizenai.com/angularspringbootjwt/ (Ảnh) Tutorial: ” Angular Spring Boot jwt Authe...
loveprogramming viết 10 tháng trước
1 0
{{like_count}}

kipalog

{{ comment_count }}

bình luận

{{liked ? "Đã kipalog" : "Kipalog"}}


Male avatar
{{userFollowed ? 'Following' : 'Follow'}}
545 bài viết.
97 người follow

 Đầu mục bài viết

Vẫn còn nữa! x

Kipalog vẫn còn rất nhiều bài viết hay và chủ đề thú vị chờ bạn khám phá!