Skip to content

Commit

Permalink
Merge pull request #447 from apache/master
Browse files Browse the repository at this point in the history
[pull] master from apache:master
  • Loading branch information
pull[bot] committed May 16, 2024
2 parents d73c9ef + e8aec7e commit b23ced4
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ public Builder deliveryLimit(long deliveryLimit) {
return this;
}

public Builder classicQueueVersion(int version) {
arguments.put("x-queue-version", version);
return this;
}

public Builder put(String key, Object value) {
arguments.put(key, value);
return this;
Expand Down
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 FALLBACK_CLASSIC_QUEUES_VERSION_1 = Boolean.parseBoolean(System.getProperty("fallback.classic.queues.v1", "false"));

public static RequireAmqpUri builder() {
return amqpUri -> managementUri -> managementCredentials -> new Builder(amqpUri, managementUri, managementCredentials);
Expand Down Expand Up @@ -817,10 +818,18 @@ public QueueArguments.Builder workQueueArgumentsBuilder() {
if (useQuorumQueues) {
builder.quorumQueue().replicationFactor(quorumQueueReplicationFactor);
quorumQueueDeliveryLimit.ifPresent(builder::deliveryLimit);
} else {
applyClassicQueueArguments(builder);
}
return builder;
}

private void applyClassicQueueArguments(QueueArguments.Builder builder) {
if (!FALLBACK_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 `fallback.classic.queues.v1` to `true` (defaults to `false`).

### Change cluster.enabled in redis.properties to redis.topology

Expand Down

0 comments on commit b23ced4

Please sign in to comment.