From d96cc210ae476f57ce369d90d4a19161a1418f59 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Tue, 9 Jul 2024 13:04:33 +0100 Subject: [PATCH] Upgrade to Artemis 2.35.0 Closes gh-41400 --- .../jms/artemis/ArtemisEmbeddedConfigurationFactory.java | 9 ++++----- .../jms/artemis/ArtemisEmbeddedServerConfiguration.java | 5 +++-- .../jms/artemis/ArtemisAutoConfigurationTests.java | 2 +- .../ArtemisEmbeddedConfigurationFactoryTests.java | 6 ++---- .../spring-boot-dependencies/build.gradle | 2 +- 5 files changed, 11 insertions(+), 13 deletions(-) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/artemis/ArtemisEmbeddedConfigurationFactory.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/artemis/ArtemisEmbeddedConfigurationFactory.java index ee5aca3498..1c1e505f81 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/artemis/ArtemisEmbeddedConfigurationFactory.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/artemis/ArtemisEmbeddedConfigurationFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -69,16 +69,15 @@ class ArtemisEmbeddedConfigurationFactory { configuration.setClusterPassword(this.properties.getClusterPassword()); configuration.addAddressConfiguration(createAddressConfiguration("DLQ")); configuration.addAddressConfiguration(createAddressConfiguration("ExpiryQueue")); - configuration.addAddressSetting("#", - new AddressSettings().setDeadLetterAddress(SimpleString.toSimpleString("DLQ")) - .setExpiryAddress(SimpleString.toSimpleString("ExpiryQueue"))); + configuration.addAddressSetting("#", new AddressSettings().setDeadLetterAddress(SimpleString.of("DLQ")) + .setExpiryAddress(SimpleString.of("ExpiryQueue"))); return configuration; } private CoreAddressConfiguration createAddressConfiguration(String name) { return new CoreAddressConfiguration().setName(name) .addRoutingType(RoutingType.ANYCAST) - .addQueueConfiguration(new QueueConfiguration(name).setRoutingType(RoutingType.ANYCAST).setAddress(name)); + .addQueueConfiguration(QueueConfiguration.of(name).setRoutingType(RoutingType.ANYCAST).setAddress(name)); } private String getDataDir() { diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/artemis/ArtemisEmbeddedServerConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/artemis/ArtemisEmbeddedServerConfiguration.java index 6517739b6f..a3d2128ead 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/artemis/ArtemisEmbeddedServerConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/artemis/ArtemisEmbeddedServerConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -68,7 +68,8 @@ class ArtemisEmbeddedServerConfiguration { String queueName = queueConfiguration.getName(); configuration.addAddressConfiguration(new CoreAddressConfiguration().setName(queueName) .addRoutingType(RoutingType.ANYCAST) - .addQueueConfiguration(new QueueConfiguration(queueName).setAddress(queueName) + .addQueueConfiguration(QueueConfiguration.of(queueName) + .setAddress(queueName) .setFilterString(queueConfiguration.getSelector()) .setDurable(queueConfiguration.isDurable()) .setRoutingType(RoutingType.ANYCAST))); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/artemis/ArtemisAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/artemis/ArtemisAutoConfigurationTests.java index 0d1ed76b21..9f23146475 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/artemis/ArtemisAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/artemis/ArtemisAutoConfigurationTests.java @@ -449,7 +449,7 @@ class ArtemisAutoConfigurationTests { void checkDestination(String name, RoutingType routingType, boolean shouldExist) { try { - BindingQueryResult result = this.server.bindingQuery(new SimpleString(name)); + BindingQueryResult result = this.server.bindingQuery(SimpleString.of(name)); assertThat(result.isExists()).isEqualTo(shouldExist); if (shouldExist) { assertThat(result.getAddressInfo().getRoutingType()).isEqualTo(routingType); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/artemis/ArtemisEmbeddedConfigurationFactoryTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/artemis/ArtemisEmbeddedConfigurationFactoryTests.java index 06e2d552c3..6c24745530 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/artemis/ArtemisEmbeddedConfigurationFactoryTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/artemis/ArtemisEmbeddedConfigurationFactoryTests.java @@ -75,10 +75,8 @@ class ArtemisEmbeddedConfigurationFactoryTests { ArtemisProperties properties = new ArtemisProperties(); Configuration configuration = new ArtemisEmbeddedConfigurationFactory(properties).createConfiguration(); Map addressSettings = configuration.getAddressSettings(); - assertThat((Object) addressSettings.get("#").getDeadLetterAddress()) - .isEqualTo(SimpleString.toSimpleString("DLQ")); - assertThat((Object) addressSettings.get("#").getExpiryAddress()) - .isEqualTo(SimpleString.toSimpleString("ExpiryQueue")); + assertThat((Object) addressSettings.get("#").getDeadLetterAddress()).isEqualTo(SimpleString.of("DLQ")); + assertThat((Object) addressSettings.get("#").getExpiryAddress()).isEqualTo(SimpleString.of("ExpiryQueue")); } @Test diff --git a/spring-boot-project/spring-boot-dependencies/build.gradle b/spring-boot-project/spring-boot-dependencies/build.gradle index dcb5ee47a6..95c4ae7b01 100644 --- a/spring-boot-project/spring-boot-dependencies/build.gradle +++ b/spring-boot-project/spring-boot-dependencies/build.gradle @@ -73,7 +73,7 @@ bom { releaseNotes("https://github.com/eclipse-ee4j/angus-mail/releases/tag/{version}") } } - library("Artemis", "2.33.0") { + library("Artemis", "2.35.0") { group("org.apache.activemq") { imports = [ "artemis-bom"