Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENHANCEMENT] Apply RabbitMQ classic queue version 2 #2243

Merged
merged 3 commits into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,7 @@ private int resolvePort() {

private static final String URI_PROPERTY_NAME = "uri";
private static final String MANAGEMENT_URI_PROPERTY_NAME = "management.uri";
private static final boolean STICK_TO_CLASSIC_QUEUES_VERSION_1 = Boolean.parseBoolean(System.getProperty("james.rabbitmq.stick.to.classic.queues.version.1", "false"));
quantranhong1999 marked this conversation as resolved.
Show resolved Hide resolved

public static RequireAmqpUri builder() {
return amqpUri -> managementUri -> managementCredentials -> new Builder(amqpUri, managementUri, managementCredentials);
Expand Down Expand Up @@ -818,11 +819,17 @@ public QueueArguments.Builder workQueueArgumentsBuilder() {
builder.quorumQueue().replicationFactor(quorumQueueReplicationFactor);
quorumQueueDeliveryLimit.ifPresent(builder::deliveryLimit);
} else {
builder.classicQueueVersion(2);
applyClassicQueueArguments(builder);
}
return builder;
}

private void applyClassicQueueArguments(QueueArguments.Builder builder) {
if (!STICK_TO_CLASSIC_QUEUES_VERSION_1) {
builder.classicQueueVersion(2);
}
}

public boolean isQuorumQueuesUsed() {
return useQuorumQueues;
}
Expand Down
12 changes: 12 additions & 0 deletions upgrade-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,18 @@ Change list:
- [Java 21](#java-21)
- [javax -> jakarta](#javax---jakarta)
- [Make all queues on RabbitMQ quorum queue when `quorum.queues.enable=true`](#make-all-queues-on-rabbitmq-quorum-queue-when-quorumqueuesenabletrue)
- [Migrate RabbitMQ classic queues to version 2](#migrate-rabbitmq-classic-queues-to-version-2)

### Migrate RabbitMQ classic queues to version 2

Date: 14/05/2024

It is recommended by RabbitMQ to upgrade the classic queues to version 2 for better performance: https://www.rabbitmq.com/blog/2023/05/17/rabbitmq-3.12-performance-improvements#classic-queues-massively-improved-classic-queues-v2-cqv2.

Existing version 1 classic queues would need to be deleted and let James re-create them as version 2.

Notice that to use classic queues version 2, you need at least RabbitMQ 3.10.0. If you want to stick with the older RabbitMQ
versions and avoid this breaking change, you could set the JVM property `james.rabbitmq.stick.to.classic.queues.version.1` to `true` (defaults to `false`).

### Make all queues on RabbitMQ quorum queue when `quorum.queues.enable=true`

Expand Down