diff --git a/build.gradle.kts b/build.gradle.kts index 14f6a780..03ee4c0c 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,7 +1,6 @@ import com.jashmore.gradle.JacocoCoverallsPlugin import com.jashmore.gradle.ReleasePlugin import com.jashmore.gradle.release -import io.gitlab.arturbosch.detekt.detekt plugins { java @@ -12,7 +11,6 @@ plugins { id("com.github.spotbugs") id("com.jashmore.gradle.github.release") id("org.jlleitschuh.gradle.ktlint") apply false - id("io.gitlab.arturbosch.detekt") apply false id("org.unbroken-dome.test-sets") version "4.0.0" } @@ -46,7 +44,6 @@ subprojects { } } else { apply(plugin = "org.jlleitschuh.gradle.ktlint") - apply(plugin = "io.gitlab.arturbosch.detekt") } dependencies { @@ -86,12 +83,6 @@ subprojects { excludeFilter.set(file("${project.rootDir}/configuration/spotbugs/bugsExcludeFilter.xml")) } } - } else { - detekt { - failFast = true - buildUponDefaultConfig = true - config = files("${project.rootDir}/configuration/detekt/detekt-configuration.yml") - } } tasks.withType { diff --git a/configuration/detekt/detekt-configuration.yml b/configuration/detekt/detekt-configuration.yml deleted file mode 100644 index 8e65ed20..00000000 --- a/configuration/detekt/detekt-configuration.yml +++ /dev/null @@ -1,7 +0,0 @@ -formatting: - MaximumLineLength: - maxLineLength: 160 - -style: - MaxLineLength: - maxLineLength: 160 diff --git a/configuration/spotbugs/bugsExcludeFilter.xml b/configuration/spotbugs/bugsExcludeFilter.xml index 47c4055f..d6b586ae 100644 --- a/configuration/spotbugs/bugsExcludeFilter.xml +++ b/configuration/spotbugs/bugsExcludeFilter.xml @@ -10,5 +10,6 @@ + diff --git a/core/src/main/java/com/jashmore/sqs/retriever/batching/BatchingMessageRetriever.java b/core/src/main/java/com/jashmore/sqs/retriever/batching/BatchingMessageRetriever.java index 2f5c018a..ae189aa8 100644 --- a/core/src/main/java/com/jashmore/sqs/retriever/batching/BatchingMessageRetriever.java +++ b/core/src/main/java/com/jashmore/sqs/retriever/batching/BatchingMessageRetriever.java @@ -23,6 +23,7 @@ import software.amazon.awssdk.core.exception.SdkInterruptedException; import software.amazon.awssdk.services.sqs.SqsAsyncClient; import software.amazon.awssdk.services.sqs.model.Message; +import software.amazon.awssdk.services.sqs.model.MessageSystemAttributeName; import software.amazon.awssdk.services.sqs.model.QueueAttributeName; import software.amazon.awssdk.services.sqs.model.ReceiveMessageRequest; import software.amazon.awssdk.services.sqs.model.ReceiveMessageResponse; @@ -187,7 +188,7 @@ private ReceiveMessageRequest buildReceiveMessageRequest(final int numberOfMessa final ReceiveMessageRequest.Builder requestBuilder = ReceiveMessageRequest .builder() .queueUrl(queueProperties.getQueueUrl()) - .attributeNames(QueueAttributeName.ALL) + .messageSystemAttributeNames(MessageSystemAttributeName.ALL) .messageAttributeNames(QueueAttributeName.ALL.toString()) .maxNumberOfMessages(numberOfMessagesToObtain) .waitTimeSeconds(MAX_SQS_RECEIVE_WAIT_TIME_IN_SECONDS); diff --git a/core/src/main/java/com/jashmore/sqs/retriever/prefetch/PrefetchingMessageRetriever.java b/core/src/main/java/com/jashmore/sqs/retriever/prefetch/PrefetchingMessageRetriever.java index 9bfe8170..6bfd67b6 100644 --- a/core/src/main/java/com/jashmore/sqs/retriever/prefetch/PrefetchingMessageRetriever.java +++ b/core/src/main/java/com/jashmore/sqs/retriever/prefetch/PrefetchingMessageRetriever.java @@ -20,6 +20,7 @@ import software.amazon.awssdk.core.exception.SdkInterruptedException; import software.amazon.awssdk.services.sqs.SqsAsyncClient; import software.amazon.awssdk.services.sqs.model.Message; +import software.amazon.awssdk.services.sqs.model.MessageSystemAttributeName; import software.amazon.awssdk.services.sqs.model.QueueAttributeName; import software.amazon.awssdk.services.sqs.model.ReceiveMessageRequest; import software.amazon.awssdk.services.sqs.model.ReceiveMessageResponse; @@ -166,7 +167,7 @@ private ReceiveMessageRequest buildReceiveMessageRequest() { final ReceiveMessageRequest.Builder requestBuilder = ReceiveMessageRequest .builder() .queueUrl(queueProperties.getQueueUrl()) - .attributeNames(QueueAttributeName.ALL) + .messageSystemAttributeNames(MessageSystemAttributeName.ALL) .messageAttributeNames(QueueAttributeName.ALL.toString()) .waitTimeSeconds(MAX_SQS_RECEIVE_WAIT_TIME_IN_SECONDS) .maxNumberOfMessages(numberOfMessagesToObtain); diff --git a/core/src/test/java/com/jashmore/sqs/retriever/batching/BatchingMessageRetrieverTest.java b/core/src/test/java/com/jashmore/sqs/retriever/batching/BatchingMessageRetrieverTest.java index b0ad43db..1042eef4 100644 --- a/core/src/test/java/com/jashmore/sqs/retriever/batching/BatchingMessageRetrieverTest.java +++ b/core/src/test/java/com/jashmore/sqs/retriever/batching/BatchingMessageRetrieverTest.java @@ -27,7 +27,7 @@ import org.mockito.junit.jupiter.MockitoExtension; import software.amazon.awssdk.services.sqs.SqsAsyncClient; import software.amazon.awssdk.services.sqs.model.Message; -import software.amazon.awssdk.services.sqs.model.QueueAttributeName; +import software.amazon.awssdk.services.sqs.model.MessageSystemAttributeName; import software.amazon.awssdk.services.sqs.model.ReceiveMessageRequest; import software.amazon.awssdk.services.sqs.model.ReceiveMessageResponse; @@ -453,8 +453,8 @@ void allMessageAttributesShouldBeDownloadedWhenRequestingMessages() { ReceiveMessageRequest.class ); verify(sqsAsyncClient).receiveMessage(receiveMessageRequestArgumentCaptor.capture()); - assertThat(receiveMessageRequestArgumentCaptor.getValue().messageAttributeNames()) - .containsExactly(QueueAttributeName.ALL.toString()); + assertThat(receiveMessageRequestArgumentCaptor.getValue().messageSystemAttributeNames()) + .containsExactly(MessageSystemAttributeName.ALL); } @Test @@ -483,7 +483,8 @@ void allMessageSystemAttributesShouldBeDownloadedWhenRequestingMessages() { ReceiveMessageRequest.class ); verify(sqsAsyncClient).receiveMessage(receiveMessageRequestArgumentCaptor.capture()); - assertThat(receiveMessageRequestArgumentCaptor.getValue().attributeNames()).containsExactly(QueueAttributeName.ALL); + assertThat(receiveMessageRequestArgumentCaptor.getValue().messageSystemAttributeNames()) + .containsExactly(MessageSystemAttributeName.ALL); } @Test diff --git a/core/src/test/java/com/jashmore/sqs/retriever/prefetch/PrefetchingMessageRetrieverTest.java b/core/src/test/java/com/jashmore/sqs/retriever/prefetch/PrefetchingMessageRetrieverTest.java index bfd835ee..593ef89f 100644 --- a/core/src/test/java/com/jashmore/sqs/retriever/prefetch/PrefetchingMessageRetrieverTest.java +++ b/core/src/test/java/com/jashmore/sqs/retriever/prefetch/PrefetchingMessageRetrieverTest.java @@ -37,6 +37,7 @@ import software.amazon.awssdk.core.exception.SdkInterruptedException; import software.amazon.awssdk.services.sqs.SqsAsyncClient; import software.amazon.awssdk.services.sqs.model.Message; +import software.amazon.awssdk.services.sqs.model.MessageSystemAttributeName; import software.amazon.awssdk.services.sqs.model.QueueAttributeName; import software.amazon.awssdk.services.sqs.model.ReceiveMessageRequest; import software.amazon.awssdk.services.sqs.model.ReceiveMessageResponse; @@ -406,8 +407,7 @@ void allMessageAttributesAreIncludedInMessagesWhenRetrieved() { ReceiveMessageRequest.class ); verify(sqsAsyncClient).receiveMessage(receiveMessageRequestArgumentCaptor.capture()); - assertThat(receiveMessageRequestArgumentCaptor.getValue().messageAttributeNames()) - .containsExactly(QueueAttributeName.ALL.toString()); + assertThat(receiveMessageRequestArgumentCaptor.getValue().messageAttributeNames()).contains(QueueAttributeName.ALL.toString()); } @Test @@ -428,7 +428,7 @@ void allMessageSystemAttributesAreIncludedInMessagesWhenRetrieved() { ReceiveMessageRequest.class ); verify(sqsAsyncClient).receiveMessage(receiveMessageRequestArgumentCaptor.capture()); - assertThat(receiveMessageRequestArgumentCaptor.getValue().attributeNames()).contains(QueueAttributeName.ALL); + assertThat(receiveMessageRequestArgumentCaptor.getValue().messageSystemAttributeNames()).contains(MessageSystemAttributeName.ALL); } @Test diff --git a/doc/how-to-guides/spring/spring-how-to-version-payload-schemas-using-spring-cloud-schema-registry.md b/doc/how-to-guides/spring/spring-how-to-version-payload-schemas-using-spring-cloud-schema-registry.md index 8f3a8b72..fe64ff78 100644 --- a/doc/how-to-guides/spring/spring-how-to-version-payload-schemas-using-spring-cloud-schema-registry.md +++ b/doc/how-to-guides/spring/spring-how-to-version-payload-schemas-using-spring-cloud-schema-registry.md @@ -1,7 +1,7 @@ # Spring - How to version message payload Schemas using Spring Cloud Schema Registry As your application grows over time the format of the data that needs to be sent in the SQS messages may change as well. To allow for -these changes, the [Spring Cloud Schema Registry](https://cloud.spring.io/spring-cloud-static/spring-cloud-schema-registry/1.0.0.RC1/reference/html/spring-cloud-schema-registry.html) +these changes, the [Spring Cloud Schema Registry](https://docs.spring.io/spring-cloud-schema-registry/docs/current/reference/html/spring-cloud-schema-registry.html) can be used to track the version of your schemas, allowing the SQS consumer to be able to interpret multiple versions of your payload. ## Full reference diff --git a/examples/core-kotlin-example/src/main/kotlin/com/jashmore/sqs/examples/KotlinConcurrentBrokerExample.kt b/examples/core-kotlin-example/src/main/kotlin/com/jashmore/sqs/examples/KotlinConcurrentBrokerExample.kt index e1fa2869..13bbe0db 100644 --- a/examples/core-kotlin-example/src/main/kotlin/com/jashmore/sqs/examples/KotlinConcurrentBrokerExample.kt +++ b/examples/core-kotlin-example/src/main/kotlin/com/jashmore/sqs/examples/KotlinConcurrentBrokerExample.kt @@ -29,7 +29,7 @@ private val log: Logger = LoggerFactory.getLogger("example") private val CONCURRENCY_LEVEL_PERIOD = Duration.ofSeconds(5) private const val CONCURRENCY_LIMIT = 10 -private val objectMapper = ObjectMapper().registerModule(KotlinModule()) +private val objectMapper = ObjectMapper().registerModule(KotlinModule.Builder().build()) /** * This example shows the core framework being used to processing messages place onto the queue with a dynamic level of concurrency via the diff --git a/examples/spring-cloud-schema-registry-example/README.md b/examples/spring-cloud-schema-registry-example/README.md index 8f874534..fa06f947 100644 --- a/examples/spring-cloud-schema-registry-example/README.md +++ b/examples/spring-cloud-schema-registry-example/README.md @@ -2,7 +2,7 @@ This example shows how you can consume messages which have been defined using an [Avro](https://avro.apache.org/docs/1.9.2/gettingstartedjava.html) Schema and -the [Spring Cloud Schema Registry](https://cloud.spring.io/spring-cloud-static/spring-cloud-schema-registry/1.0.0.RC1/reference/html/spring-cloud-schema-registry.html). +the [Spring Cloud Schema Registry](https://docs.spring.io/spring-cloud-schema-registry/docs/current/reference/html/spring-cloud-schema-registry.html). To find the corresponding code look in the [Spring Cloud Schema Registry Extension](../../extensions/spring-cloud-schema-registry-extension) module. diff --git a/examples/spring-starter-example/src/main/java/com/jashmore/sqs/examples/Application.java b/examples/spring-starter-example/src/main/java/com/jashmore/sqs/examples/Application.java index 18ec2601..3f34116a 100644 --- a/examples/spring-starter-example/src/main/java/com/jashmore/sqs/examples/Application.java +++ b/examples/spring-starter-example/src/main/java/com/jashmore/sqs/examples/Application.java @@ -1,12 +1,12 @@ package com.jashmore.sqs.examples; -import akka.http.scaladsl.Http; import com.jashmore.sqs.spring.config.QueueListenerConfiguration; import com.jashmore.sqs.spring.container.basic.QueueListener; import com.jashmore.sqs.spring.container.prefetch.PrefetchingQueueListener; import com.jashmore.sqs.util.LocalSqsAsyncClientImpl; import com.jashmore.sqs.util.SqsQueuesConfig; import lombok.extern.slf4j.Slf4j; +import org.apache.pekko.http.scaladsl.Http; import org.elasticmq.rest.sqs.SQSRestServer; import org.elasticmq.rest.sqs.SQSRestServerBuilder; import org.springframework.boot.SpringApplication; diff --git a/extensions/aws-xray-extension/core/build.gradle.kts b/extensions/aws-xray-extension/core/build.gradle.kts index b292804f..595141fa 100644 --- a/extensions/aws-xray-extension/core/build.gradle.kts +++ b/extensions/aws-xray-extension/core/build.gradle.kts @@ -13,3 +13,12 @@ dependencies { testImplementation(project(":java-dynamic-sqs-listener-core")) testImplementation(project(":expected-test-exception")) } + +configurations.all { + resolutionStrategy.eachDependency { + // xray requires an older version of jackson + if (requested.group.startsWith("com.fasterxml.jackson")) { + useVersion("2.15.2") + } + } +} diff --git a/extensions/aws-xray-extension/spring-boot/build.gradle.kts b/extensions/aws-xray-extension/spring-boot/build.gradle.kts index 05cc9261..b0a99930 100644 --- a/extensions/aws-xray-extension/spring-boot/build.gradle.kts +++ b/extensions/aws-xray-extension/spring-boot/build.gradle.kts @@ -16,3 +16,12 @@ dependencies { testImplementation("org.springframework.boot:spring-boot-test") testImplementation(project(":elasticmq-sqs-client")) } + +configurations.all { + resolutionStrategy.eachDependency { + // xray requires an older version of jackson + if (requested.group.startsWith("com.fasterxml.jackson")) { + useVersion("2.15.2") + } + } +} diff --git a/extensions/aws-xray-extension/spring-boot/src/integrationTest/java/com/jashmore/sqs/extensions/xray/XrayExtensionIntegrationTest.java b/extensions/aws-xray-extension/spring-boot/src/integrationTest/java/com/jashmore/sqs/extensions/xray/XrayExtensionIntegrationTest.java index 22df2ff2..91bec712 100644 --- a/extensions/aws-xray-extension/spring-boot/src/integrationTest/java/com/jashmore/sqs/extensions/xray/XrayExtensionIntegrationTest.java +++ b/extensions/aws-xray-extension/spring-boot/src/integrationTest/java/com/jashmore/sqs/extensions/xray/XrayExtensionIntegrationTest.java @@ -51,7 +51,7 @@ public LocalSqsAsyncClient localSqsAsyncClient() { @Bean @Qualifier("sqsXrayRecorder") - public AWSXRayRecorder recorder() throws IOException { + public AWSXRayRecorder sqsXrayRecorder() throws IOException { final DaemonConfiguration daemonConfiguration = new DaemonConfiguration(); daemonConfiguration.setDaemonAddress("localhost:" + XRAY_DAEMON_PORT); final AWSXRayRecorder recorder = AWSXRayRecorderBuilder.standard().withEmitter(Emitter.create(daemonConfiguration)).build(); diff --git a/extensions/core-kotlin-dsl/src/main/kotlin/com/jashmore/sqs/core/kotlin/dsl/argument/CoreArgumentResolverServiceDslBuilder.kt b/extensions/core-kotlin-dsl/src/main/kotlin/com/jashmore/sqs/core/kotlin/dsl/argument/CoreArgumentResolverServiceDslBuilder.kt index 18c62196..4fa33fa8 100644 --- a/extensions/core-kotlin-dsl/src/main/kotlin/com/jashmore/sqs/core/kotlin/dsl/argument/CoreArgumentResolverServiceDslBuilder.kt +++ b/extensions/core-kotlin-dsl/src/main/kotlin/com/jashmore/sqs/core/kotlin/dsl/argument/CoreArgumentResolverServiceDslBuilder.kt @@ -13,7 +13,9 @@ import com.jashmore.sqs.processor.MessageProcessor * [ArgumentResolverServiceDslBuilder] that constructs a [CoreArgumentResolverService] for the [MessageProcessor]. */ @MessageListenerComponentDslMarker -class CoreArgumentResolverServiceDslBuilder(private val objectMapper: ObjectMapper) : ArgumentResolverServiceDslBuilder { +class CoreArgumentResolverServiceDslBuilder( + private val objectMapper: ObjectMapper +) : ArgumentResolverServiceDslBuilder { override fun invoke(): ArgumentResolverService { return CoreArgumentResolverService( @@ -33,5 +35,8 @@ class CoreArgumentResolverServiceDslBuilder(private val objectMapper: ObjectMapp * * @param init the DSL function for configuring this processor */ -fun coreArgumentResolverService(objectMapper: ObjectMapper = ObjectMapper(), init: CoreArgumentResolverServiceDslBuilder.() -> Unit = { }) = +fun coreArgumentResolverService( + objectMapper: ObjectMapper = ObjectMapper(), + init: CoreArgumentResolverServiceDslBuilder.() -> Unit = { } +) = initComponent(CoreArgumentResolverServiceDslBuilder(objectMapper), init) diff --git a/extensions/core-kotlin-dsl/src/main/kotlin/com/jashmore/sqs/core/kotlin/dsl/broker/ConcurrentMessageBrokerDslBuilder.kt b/extensions/core-kotlin-dsl/src/main/kotlin/com/jashmore/sqs/core/kotlin/dsl/broker/ConcurrentMessageBrokerDslBuilder.kt index 46355b14..06817ea0 100644 --- a/extensions/core-kotlin-dsl/src/main/kotlin/com/jashmore/sqs/core/kotlin/dsl/broker/ConcurrentMessageBrokerDslBuilder.kt +++ b/extensions/core-kotlin-dsl/src/main/kotlin/com/jashmore/sqs/core/kotlin/dsl/broker/ConcurrentMessageBrokerDslBuilder.kt @@ -69,4 +69,6 @@ class ConcurrentMessageBrokerDslBuilder : MessageBrokerDslBuilder { * } * ``` */ -fun concurrentBroker(init: ConcurrentMessageBrokerDslBuilder.() -> Unit) = initComponent(ConcurrentMessageBrokerDslBuilder(), init) +fun concurrentBroker( + init: ConcurrentMessageBrokerDslBuilder.() -> Unit +) = initComponent(ConcurrentMessageBrokerDslBuilder(), init) diff --git a/extensions/core-kotlin-dsl/src/main/kotlin/com/jashmore/sqs/core/kotlin/dsl/broker/GroupingMessageBrokerDslBuilder.kt b/extensions/core-kotlin-dsl/src/main/kotlin/com/jashmore/sqs/core/kotlin/dsl/broker/GroupingMessageBrokerDslBuilder.kt index 5185a731..ef5afd88 100644 --- a/extensions/core-kotlin-dsl/src/main/kotlin/com/jashmore/sqs/core/kotlin/dsl/broker/GroupingMessageBrokerDslBuilder.kt +++ b/extensions/core-kotlin-dsl/src/main/kotlin/com/jashmore/sqs/core/kotlin/dsl/broker/GroupingMessageBrokerDslBuilder.kt @@ -78,7 +78,11 @@ class GroupingMessageBrokerDslBuilder : MessageBrokerDslBuilder { override fun getMaximumNumberOfCachedMessageGroups(): Int = maximumNumberOfCachedMessageGroups() - override fun messageGroupingFunction(): Function = Function { t -> actualMessageGroupingFunction(t) } + override fun messageGroupingFunction(): Function = Function { t -> + actualMessageGroupingFunction( + t + ) + } } ) } @@ -94,4 +98,6 @@ class GroupingMessageBrokerDslBuilder : MessageBrokerDslBuilder { * } * ``` */ -fun groupingBroker(init: GroupingMessageBrokerDslBuilder.() -> Unit) = initComponent(GroupingMessageBrokerDslBuilder(), init) +fun groupingBroker( + init: GroupingMessageBrokerDslBuilder.() -> Unit +) = initComponent(GroupingMessageBrokerDslBuilder(), init) diff --git a/extensions/core-kotlin-dsl/src/main/kotlin/com/jashmore/sqs/core/kotlin/dsl/container/AbstractMessageListenerContainerDslBuilder.kt b/extensions/core-kotlin-dsl/src/main/kotlin/com/jashmore/sqs/core/kotlin/dsl/container/AbstractMessageListenerContainerDslBuilder.kt index 7a7395c4..dc6f3c95 100644 --- a/extensions/core-kotlin-dsl/src/main/kotlin/com/jashmore/sqs/core/kotlin/dsl/container/AbstractMessageListenerContainerDslBuilder.kt +++ b/extensions/core-kotlin-dsl/src/main/kotlin/com/jashmore/sqs/core/kotlin/dsl/container/AbstractMessageListenerContainerDslBuilder.kt @@ -18,7 +18,11 @@ import software.amazon.awssdk.services.sqs.SqsAsyncClient * *

This only provides access to the processor object */ -abstract class AbstractMessageListenerContainerDslBuilder(val identifier: String, val sqsAsyncClient: SqsAsyncClient, val queueProperties: QueueProperties) : +abstract class AbstractMessageListenerContainerDslBuilder( + val identifier: String, + val sqsAsyncClient: SqsAsyncClient, + val queueProperties: QueueProperties +) : MessageListenerComponentDslBuilder { var processor: MessageProcessorDslBuilder? = null @@ -72,5 +76,10 @@ abstract class AbstractMessageListenerContainerDslBuilder(val identifier: String * ``` */ fun asyncLambdaProcessor(init: AsyncLambdaMessageProcessorDslBuilder.() -> Unit) = - com.jashmore.sqs.core.kotlin.dsl.processor.asyncLambdaProcessor(identifier, sqsAsyncClient, queueProperties, init) + com.jashmore.sqs.core.kotlin.dsl.processor.asyncLambdaProcessor( + identifier, + sqsAsyncClient, + queueProperties, + init + ) } diff --git a/extensions/core-kotlin-dsl/src/main/kotlin/com/jashmore/sqs/core/kotlin/dsl/container/BatchingMessageListenerContainerDslBuilder.kt b/extensions/core-kotlin-dsl/src/main/kotlin/com/jashmore/sqs/core/kotlin/dsl/container/BatchingMessageListenerContainerDslBuilder.kt index 0e4331b5..0a81463a 100644 --- a/extensions/core-kotlin-dsl/src/main/kotlin/com/jashmore/sqs/core/kotlin/dsl/container/BatchingMessageListenerContainerDslBuilder.kt +++ b/extensions/core-kotlin-dsl/src/main/kotlin/com/jashmore/sqs/core/kotlin/dsl/container/BatchingMessageListenerContainerDslBuilder.kt @@ -139,7 +139,12 @@ fun batchingMessageListener( queueUrl: String, init: BatchingMessageListenerContainerDslBuilder.() -> Unit ): MessageListenerContainer { - return batchingMessageListener(identifier, sqsAsyncClient, QueueProperties.builder().queueUrl(queueUrl).build(), init) + return batchingMessageListener( + identifier, + sqsAsyncClient, + QueueProperties.builder().queueUrl(queueUrl).build(), + init + ) } /** diff --git a/extensions/core-kotlin-dsl/src/main/kotlin/com/jashmore/sqs/core/kotlin/dsl/container/CoreMessageListenerContainerDslBuilder.kt b/extensions/core-kotlin-dsl/src/main/kotlin/com/jashmore/sqs/core/kotlin/dsl/container/CoreMessageListenerContainerDslBuilder.kt index 6d19c0d0..12ea72a6 100644 --- a/extensions/core-kotlin-dsl/src/main/kotlin/com/jashmore/sqs/core/kotlin/dsl/container/CoreMessageListenerContainerDslBuilder.kt +++ b/extensions/core-kotlin-dsl/src/main/kotlin/com/jashmore/sqs/core/kotlin/dsl/container/CoreMessageListenerContainerDslBuilder.kt @@ -32,7 +32,11 @@ import java.util.function.Supplier * [AbstractMessageListenerContainerDslBuilder] that will construct a [MessageListenerContainer] for usage in this container. */ @MessageListenerComponentDslMarker -class CoreMessageListenerContainerDslBuilder(identifier: String, sqsAsyncClient: SqsAsyncClient, queueProperties: QueueProperties) : +class CoreMessageListenerContainerDslBuilder( + identifier: String, + sqsAsyncClient: SqsAsyncClient, + queueProperties: QueueProperties +) : AbstractMessageListenerContainerDslBuilder(identifier, sqsAsyncClient, queueProperties) { var broker: MessageBrokerDslBuilder? = null var resolver: MessageResolverDslBuilder? = null @@ -52,7 +56,9 @@ class CoreMessageListenerContainerDslBuilder(identifier: String, sqsAsyncClient: * } * ``` */ - fun concurrentBroker(init: ConcurrentMessageBrokerDslBuilder.() -> Unit) = com.jashmore.sqs.core.kotlin.dsl.broker.concurrentBroker(init) + fun concurrentBroker( + init: ConcurrentMessageBrokerDslBuilder.() -> Unit + ) = com.jashmore.sqs.core.kotlin.dsl.broker.concurrentBroker(init) /** * Use the [GroupingMessageBroker] as the [MessageBroker] in this container. @@ -67,7 +73,9 @@ class CoreMessageListenerContainerDslBuilder(identifier: String, sqsAsyncClient: * } * ``` */ - fun groupingBroker(init: GroupingMessageBrokerDslBuilder.() -> Unit) = com.jashmore.sqs.core.kotlin.dsl.broker.groupingBroker(init) + fun groupingBroker( + init: GroupingMessageBrokerDslBuilder.() -> Unit + ) = com.jashmore.sqs.core.kotlin.dsl.broker.groupingBroker(init) /** * Use the [BatchingMessageRetriever] as the [MessageRetriever] for this container. diff --git a/extensions/core-kotlin-dsl/src/main/kotlin/com/jashmore/sqs/core/kotlin/dsl/container/PrefetchingMessageListenerContainerDslBuilder.kt b/extensions/core-kotlin-dsl/src/main/kotlin/com/jashmore/sqs/core/kotlin/dsl/container/PrefetchingMessageListenerContainerDslBuilder.kt index 67861df9..3115e51a 100644 --- a/extensions/core-kotlin-dsl/src/main/kotlin/com/jashmore/sqs/core/kotlin/dsl/container/PrefetchingMessageListenerContainerDslBuilder.kt +++ b/extensions/core-kotlin-dsl/src/main/kotlin/com/jashmore/sqs/core/kotlin/dsl/container/PrefetchingMessageListenerContainerDslBuilder.kt @@ -138,7 +138,12 @@ fun prefetchingMessageListener( queueUrl: String, init: PrefetchingMessageListenerContainerDslBuilder.() -> Unit ): MessageListenerContainer { - return prefetchingMessageListener(identifier, sqsAsyncClient, QueueProperties.builder().queueUrl(queueUrl).build(), init) + return prefetchingMessageListener( + identifier, + sqsAsyncClient, + QueueProperties.builder().queueUrl(queueUrl).build(), + init + ) } /** diff --git a/extensions/core-kotlin-dsl/src/main/kotlin/com/jashmore/sqs/core/kotlin/dsl/processor/AsyncLambdaMessageProcessorDslBuilder.kt b/extensions/core-kotlin-dsl/src/main/kotlin/com/jashmore/sqs/core/kotlin/dsl/processor/AsyncLambdaMessageProcessorDslBuilder.kt index 95340ad5..3bb4acf5 100644 --- a/extensions/core-kotlin-dsl/src/main/kotlin/com/jashmore/sqs/core/kotlin/dsl/processor/AsyncLambdaMessageProcessorDslBuilder.kt +++ b/extensions/core-kotlin-dsl/src/main/kotlin/com/jashmore/sqs/core/kotlin/dsl/processor/AsyncLambdaMessageProcessorDslBuilder.kt @@ -23,7 +23,12 @@ class AsyncLambdaMessageProcessorDslBuilder( var decorators = mutableListOf() - private var processorBuilder: () -> MessageProcessor = { throw RequiredFieldException("method", "LambdaMessageProcessor") } + private var processorBuilder: () -> MessageProcessor = { + throw RequiredFieldException( + "method", + "LambdaMessageProcessor" + ) + } fun method(func: (message: Message) -> CompletableFuture<*>) { processorBuilder = { diff --git a/extensions/core-kotlin-dsl/src/main/kotlin/com/jashmore/sqs/core/kotlin/dsl/processor/CoreMessageProcessorDslBuilder.kt b/extensions/core-kotlin-dsl/src/main/kotlin/com/jashmore/sqs/core/kotlin/dsl/processor/CoreMessageProcessorDslBuilder.kt index ebed9403..47ccf4d7 100644 --- a/extensions/core-kotlin-dsl/src/main/kotlin/com/jashmore/sqs/core/kotlin/dsl/processor/CoreMessageProcessorDslBuilder.kt +++ b/extensions/core-kotlin-dsl/src/main/kotlin/com/jashmore/sqs/core/kotlin/dsl/processor/CoreMessageProcessorDslBuilder.kt @@ -30,7 +30,9 @@ class CoreMessageProcessorDslBuilder( * * If this is not supplied, a default [CoreArgumentResolverService] will be used which configures the core argument resolvers. */ - var argumentResolverService: ArgumentResolverServiceDslBuilder = CoreArgumentResolverServiceDslBuilder(ObjectMapper()) + var argumentResolverService: ArgumentResolverServiceDslBuilder = CoreArgumentResolverServiceDslBuilder( + ObjectMapper() + ) /** * The object instance that will execute the message listener method. diff --git a/extensions/core-kotlin-dsl/src/main/kotlin/com/jashmore/sqs/core/kotlin/dsl/processor/LambdaMessageProcessorDslBuilder.kt b/extensions/core-kotlin-dsl/src/main/kotlin/com/jashmore/sqs/core/kotlin/dsl/processor/LambdaMessageProcessorDslBuilder.kt index 0edc7b58..773f7b0e 100644 --- a/extensions/core-kotlin-dsl/src/main/kotlin/com/jashmore/sqs/core/kotlin/dsl/processor/LambdaMessageProcessorDslBuilder.kt +++ b/extensions/core-kotlin-dsl/src/main/kotlin/com/jashmore/sqs/core/kotlin/dsl/processor/LambdaMessageProcessorDslBuilder.kt @@ -25,7 +25,12 @@ class LambdaMessageProcessorDslBuilder( */ var decorators = listOf() - private var processorBuilder: () -> MessageProcessor = { throw RequiredFieldException("method", "LambdaMessageProcessor") } + private var processorBuilder: () -> MessageProcessor = { + throw RequiredFieldException( + "method", + "LambdaMessageProcessor" + ) + } /** * Set the lambda as a method that just consumes the [Message]. diff --git a/extensions/core-kotlin-dsl/src/main/kotlin/com/jashmore/sqs/core/kotlin/dsl/resolver/BatchingMessageResolverDslBuilder.kt b/extensions/core-kotlin-dsl/src/main/kotlin/com/jashmore/sqs/core/kotlin/dsl/resolver/BatchingMessageResolverDslBuilder.kt index 948db343..6906bef2 100644 --- a/extensions/core-kotlin-dsl/src/main/kotlin/com/jashmore/sqs/core/kotlin/dsl/resolver/BatchingMessageResolverDslBuilder.kt +++ b/extensions/core-kotlin-dsl/src/main/kotlin/com/jashmore/sqs/core/kotlin/dsl/resolver/BatchingMessageResolverDslBuilder.kt @@ -15,7 +15,10 @@ import java.time.Duration * [MessageResolverDslBuilder] that will construct a [BatchingMessageResolver] for usage in this container. */ @MessageListenerComponentDslMarker -class BatchingMessageResolverDslBuilder(private val sqsAsyncClient: SqsAsyncClient, private val queueProperties: QueueProperties) : MessageResolverDslBuilder { +class BatchingMessageResolverDslBuilder( + private val sqsAsyncClient: SqsAsyncClient, + private val queueProperties: QueueProperties +) : MessageResolverDslBuilder { /** * Supplier for getting the buffer size for resolving the messages. * diff --git a/extensions/core-kotlin-dsl/src/main/kotlin/com/jashmore/sqs/core/kotlin/dsl/utils/RequiredFieldException.kt b/extensions/core-kotlin-dsl/src/main/kotlin/com/jashmore/sqs/core/kotlin/dsl/utils/RequiredFieldException.kt index 58b9b6c8..ae688dfd 100644 --- a/extensions/core-kotlin-dsl/src/main/kotlin/com/jashmore/sqs/core/kotlin/dsl/utils/RequiredFieldException.kt +++ b/extensions/core-kotlin-dsl/src/main/kotlin/com/jashmore/sqs/core/kotlin/dsl/utils/RequiredFieldException.kt @@ -5,4 +5,7 @@ package com.jashmore.sqs.core.kotlin.dsl.utils * * This is required as the compile time checks for required fields in Kotlin DSL isn't quite there yet. */ -class RequiredFieldException(fieldName: String, componentName: String) : RuntimeException("$fieldName is required for $componentName") +class RequiredFieldException( + fieldName: String, + componentName: String +) : RuntimeException("$fieldName is required for $componentName") diff --git a/extensions/core-kotlin-dsl/src/test/kotlin/com/jashmore/sqs/core/kotlin/dsl/argument/DelegatingArgumentResolverServiceDslBuilderTest.kt b/extensions/core-kotlin-dsl/src/test/kotlin/com/jashmore/sqs/core/kotlin/dsl/argument/DelegatingArgumentResolverServiceDslBuilderTest.kt index 03e535ed..baa95d36 100644 --- a/extensions/core-kotlin-dsl/src/test/kotlin/com/jashmore/sqs/core/kotlin/dsl/argument/DelegatingArgumentResolverServiceDslBuilderTest.kt +++ b/extensions/core-kotlin-dsl/src/test/kotlin/com/jashmore/sqs/core/kotlin/dsl/argument/DelegatingArgumentResolverServiceDslBuilderTest.kt @@ -47,7 +47,9 @@ class DelegatingArgumentResolverServiceDslBuilderTest { val argumentResolverService = argumentResolverServiceDslBuilder() // assert - assertThat(argumentResolverService.getArgumentResolver(MethodParameterRecord(method, parameterIndex = 1))).isSameAs(messageIdArgumentResolver) + assertThat( + argumentResolverService.getArgumentResolver(MethodParameterRecord(method, parameterIndex = 1)) + ).isSameAs(messageIdArgumentResolver) } @Test diff --git a/extensions/core-kotlin-dsl/src/test/kotlin/com/jashmore/sqs/core/kotlin/dsl/container/FifoMessageListenerContainerDslBuilderTest.kt b/extensions/core-kotlin-dsl/src/test/kotlin/com/jashmore/sqs/core/kotlin/dsl/container/FifoMessageListenerContainerDslBuilderTest.kt index 317fa9fa..15509b04 100644 --- a/extensions/core-kotlin-dsl/src/test/kotlin/com/jashmore/sqs/core/kotlin/dsl/container/FifoMessageListenerContainerDslBuilderTest.kt +++ b/extensions/core-kotlin-dsl/src/test/kotlin/com/jashmore/sqs/core/kotlin/dsl/container/FifoMessageListenerContainerDslBuilderTest.kt @@ -41,7 +41,11 @@ class FifoMessageListenerContainerDslBuilderTest { } } container.start() - sqsAsyncClient.sendMessage { it.queueUrl(queueUrl).messageGroupId("groupId").messageBody("body").messageDeduplicationId("id") } + sqsAsyncClient.sendMessage { + it.queueUrl( + queueUrl + ).messageGroupId("groupId").messageBody("body").messageDeduplicationId("id") + } // assert assertThat(countDownLatch.await(5, TimeUnit.SECONDS)).isTrue() } @@ -97,7 +101,11 @@ class FifoMessageListenerContainerDslBuilderTest { // assert assertThat(processedMessages).containsOnlyKeys((0 until numberOfMessageGroups).map { "$it" }) assertThat(processedMessages) - .allSatisfy { _, messagesNumbers -> assertThat(messagesNumbers).containsExactlyElementsOf((0 until numberOfMessages).map { "$it" }) } + .allSatisfy { _, messagesNumbers -> + assertThat( + messagesNumbers + ).containsExactlyElementsOf((0 until numberOfMessages).map { "$it" }) + } } private fun sendMessages( @@ -129,7 +137,11 @@ class FifoMessageListenerContainerDslBuilderTest { private fun createFifoQueueWithDlq(sqsAsyncClient: ElasticMqSqsAsyncClient): QueueProperties { val deadLetterQueueResponse = sqsAsyncClient.createRandomFifoQueue().get() val attributes = sqsAsyncClient - .getQueueAttributes { builder: GetQueueAttributesRequest.Builder -> builder.queueUrl(deadLetterQueueResponse.queueUrl()).attributeNames(QueueAttributeName.QUEUE_ARN) } + .getQueueAttributes { builder: GetQueueAttributesRequest.Builder -> + builder.queueUrl( + deadLetterQueueResponse.queueUrl() + ).attributeNames(QueueAttributeName.QUEUE_ARN) + } .get() val queueUrl = sqsAsyncClient .createRandomFifoQueue { builder -> diff --git a/extensions/core-kotlin-dsl/src/test/kotlin/com/jashmore/sqs/core/kotlin/dsl/processor/CoreMessageProcessorDslBuilderTest.kt b/extensions/core-kotlin-dsl/src/test/kotlin/com/jashmore/sqs/core/kotlin/dsl/processor/CoreMessageProcessorDslBuilderTest.kt index 07c52b54..094a1e6a 100644 --- a/extensions/core-kotlin-dsl/src/test/kotlin/com/jashmore/sqs/core/kotlin/dsl/processor/CoreMessageProcessorDslBuilderTest.kt +++ b/extensions/core-kotlin-dsl/src/test/kotlin/com/jashmore/sqs/core/kotlin/dsl/processor/CoreMessageProcessorDslBuilderTest.kt @@ -74,7 +74,9 @@ class CoreMessageProcessorDslBuilderTest { method = CoreMessageProcessorDslBuilderTest::class.java.getMethod("myMethod", String::class.java) }() - coreProcessor.processMessage(Message.builder().body("test").build()) { CompletableFuture.completedFuture(null) }.get(5, TimeUnit.SECONDS) + coreProcessor.processMessage(Message.builder().body("test").build()) { + CompletableFuture.completedFuture(null) + }.get(5, TimeUnit.SECONDS) // assert assertThat(payloadReference.get()).isEqualTo("test") @@ -101,7 +103,9 @@ class CoreMessageProcessorDslBuilderTest { method = CoreMessageProcessorDslBuilderTest::class.java.getMethod("myMethod", String::class.java) }() - coreProcessor.processMessage(Message.builder().body("test").build()) { CompletableFuture.completedFuture(null) }.get(5, TimeUnit.SECONDS) + coreProcessor.processMessage(Message.builder().body("test").build()) { + CompletableFuture.completedFuture(null) + }.get(5, TimeUnit.SECONDS) // assert assertThat(payloadReference.get()).isEqualTo("some value") diff --git a/extensions/core-kotlin-dsl/src/test/kotlin/com/jashmore/sqs/core/kotlin/dsl/resolver/BatchingMessageResolverDslBuilderTest.kt b/extensions/core-kotlin-dsl/src/test/kotlin/com/jashmore/sqs/core/kotlin/dsl/resolver/BatchingMessageResolverDslBuilderTest.kt index 7888b086..e9f2cf65 100644 --- a/extensions/core-kotlin-dsl/src/test/kotlin/com/jashmore/sqs/core/kotlin/dsl/resolver/BatchingMessageResolverDslBuilderTest.kt +++ b/extensions/core-kotlin-dsl/src/test/kotlin/com/jashmore/sqs/core/kotlin/dsl/resolver/BatchingMessageResolverDslBuilderTest.kt @@ -91,5 +91,7 @@ class BatchingMessageResolverDslBuilderTest { assertThat(endTime - startTime).isGreaterThanOrEqualTo(500) } - private fun runResolver(resolver: MessageResolver) = CompletableFuture.runAsync { resolver.run() }.get(5, TimeUnit.SECONDS) + private fun runResolver(resolver: MessageResolver) = CompletableFuture.runAsync { + resolver.run() + }.get(5, TimeUnit.SECONDS) } diff --git a/extensions/spring-cloud-schema-registry-extension/README.md b/extensions/spring-cloud-schema-registry-extension/README.md index b11d8afc..cf0ed411 100644 --- a/extensions/spring-cloud-schema-registry-extension/README.md +++ b/extensions/spring-cloud-schema-registry-extension/README.md @@ -2,7 +2,7 @@ This extension allows the SQS consumer to be able to parse messages that have been serialized using a schema like [Avro](https://avro.apache.org/docs/1.9.2/gettingstartedjava.html) and these definitions have been stored in the -[Spring Cloud Schema Registry](https://cloud.spring.io/spring-cloud-static/spring-cloud-schema-registry/1.0.0.RC1/reference/html/spring-cloud-schema-registry.html). +[Spring Cloud Schema Registry](https://docs.spring.io/spring-cloud-schema-registry/docs/current/reference/html/spring-cloud-schema-registry.html). ## Why would you want this diff --git a/extensions/spring-cloud-schema-registry-extension/avro-spring-cloud-schema-registry-extension/src/main/java/com/jashmore/sqs/extensions/registry/avro/AvroClasspathConsumerSchemaRetriever.java b/extensions/spring-cloud-schema-registry-extension/avro-spring-cloud-schema-registry-extension/src/main/java/com/jashmore/sqs/extensions/registry/avro/AvroClasspathConsumerSchemaRetriever.java index cf9fd98e..2411c3ff 100644 --- a/extensions/spring-cloud-schema-registry-extension/avro-spring-cloud-schema-registry-extension/src/main/java/com/jashmore/sqs/extensions/registry/avro/AvroClasspathConsumerSchemaRetriever.java +++ b/extensions/spring-cloud-schema-registry-extension/avro-spring-cloud-schema-registry-extension/src/main/java/com/jashmore/sqs/extensions/registry/avro/AvroClasspathConsumerSchemaRetriever.java @@ -11,14 +11,15 @@ import java.util.Optional; import java.util.function.Function; import java.util.stream.Stream; +import org.apache.avro.AvroTypeException; import org.apache.avro.Schema; import org.apache.avro.SchemaParseException; import org.springframework.core.io.Resource; /** - * Implementation that loads all of the schema definitions from resources in the classpath. + * Implementation that loads all the schema definitions from resources in the classpath. * - *

For example it will load all of the schemas in a folder like

resources/avro/{name}.avsc
. + *

For example it will load all the schemas in a folder like

resources/avro/{name}.avsc
. */ public class AvroClasspathConsumerSchemaRetriever implements ConsumerSchemaRetriever { @@ -35,7 +36,7 @@ public AvroClasspathConsumerSchemaRetriever(final List schemaImports, .map(resource -> { try { return parser.parse(resource.getInputStream()); - } catch (SchemaParseException | IOException exception) { + } catch (AvroTypeException | SchemaParseException | IOException exception) { throw new AvroSchemaProcessingException("Error processing schema definition: " + resource.getFilename(), exception); } }) diff --git a/gradle.properties b/gradle.properties index 455eaac4..41df5ec1 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,21 +1,21 @@ # Versions -assertJVersion=3.24.2 -avroVersion=1.10.2 -awsVersion=2.16.104 +assertJVersion=3.26.3 +avroVersion=1.12.0 +awsVersion=2.28.15 awsXrayVersion=2.7.1 -braveVersion=5.15.1 +braveVersion=6.0.3 cglibVersion=3.3.0 -elasticMqVersion=0.15.8 -immutablesVersion=2.9.3 -jacksonVersion=2.15.2 -junitJupiterVersion=5.10.0 -ktorVersion=2.3.2 -logbackVersion=1.4.8 -lombokVersion=1.18.28 -mockitoVersion=5.4.0 -mockitoKotlinVersion=5.0.0 -slf4jVersion=2.0.7 +elasticMqVersion=1.6.8 +immutablesVersion=2.10.1 +jacksonVersion=2.18.0 +junitJupiterVersion=5.11.1 +ktorVersion=2.3.12 +logbackVersion=1.5.8 +lombokVersion=1.18.34 +mockitoVersion=5.14.1 +mockitoKotlinVersion=5.4.0 +slf4jVersion=2.0.16 spotbugsVersion=4.2.3 -springBootVersion=3.1.2 +springBootVersion=3.3.4 springCloudVersion=2.2.8.RELEASE springCloudSchemaRegistryVersion=1.1.5 diff --git a/settings.gradle.kts b/settings.gradle.kts index 47480f4c..0415ef39 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -7,7 +7,6 @@ pluginManagement { id("com.github.davidmc24.gradle.plugin.avro") version "1.2.1" id("org.jlleitschuh.gradle.ktlint") version "11.5.0" id("com.github.spotbugs") version "4.5.1" - id("io.gitlab.arturbosch.detekt") version "1.14.2" id("com.jashmore.gradle.github.release") version "0.0.2" } repositories { diff --git a/spring/spring-core/src/integrationTest/java/com/jashmore/sqs/client/MultipleSqsAsyncClientIntegrationTest.java b/spring/spring-core/src/integrationTest/java/com/jashmore/sqs/client/MultipleSqsAsyncClientIntegrationTest.java index 2e1a0ff7..73a35d2d 100644 --- a/spring/spring-core/src/integrationTest/java/com/jashmore/sqs/client/MultipleSqsAsyncClientIntegrationTest.java +++ b/spring/spring-core/src/integrationTest/java/com/jashmore/sqs/client/MultipleSqsAsyncClientIntegrationTest.java @@ -15,6 +15,7 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -42,17 +43,22 @@ class MultipleSqsAsyncClientIntegrationTest { public static class TestConfig { @Bean + @Qualifier("firstClient") public LocalSqsAsyncClient firstClient() { return new ElasticMqSqsAsyncClient("firstClientQueueName"); } @Bean + @Qualifier("secondClient") public LocalSqsAsyncClient secondClient() { return new ElasticMqSqsAsyncClient("secondClientQueueName"); } @Bean - public SqsAsyncClientProvider sqsAsyncClientProvider(SqsAsyncClient firstClient, SqsAsyncClient secondClient) { + public SqsAsyncClientProvider sqsAsyncClientProvider( + @Qualifier("firstClient") SqsAsyncClient firstClient, + @Qualifier("secondClient") SqsAsyncClient secondClient + ) { final Map clients = new HashMap<>(); clients.put("firstClient", firstClient); clients.put("secondClient", secondClient); diff --git a/util/elasticmq-sqs-client/src/main/java/com/jashmore/sqs/elasticmq/ElasticMqSqsAsyncClient.java b/util/elasticmq-sqs-client/src/main/java/com/jashmore/sqs/elasticmq/ElasticMqSqsAsyncClient.java index 47aa9e11..a4ac01cb 100644 --- a/util/elasticmq-sqs-client/src/main/java/com/jashmore/sqs/elasticmq/ElasticMqSqsAsyncClient.java +++ b/util/elasticmq-sqs-client/src/main/java/com/jashmore/sqs/elasticmq/ElasticMqSqsAsyncClient.java @@ -1,6 +1,5 @@ package com.jashmore.sqs.elasticmq; -import akka.http.scaladsl.Http; import com.jashmore.sqs.util.LocalSqsAsyncClient; import com.jashmore.sqs.util.LocalSqsAsyncClientImpl; import com.jashmore.sqs.util.SqsQueuesConfig; @@ -9,6 +8,7 @@ import java.util.function.Consumer; import lombok.experimental.Delegate; import lombok.extern.slf4j.Slf4j; +import org.apache.pekko.http.scaladsl.Http; import org.elasticmq.rest.sqs.SQSRestServer; import org.elasticmq.rest.sqs.SQSRestServerBuilder; import software.amazon.awssdk.core.SdkClient; diff --git a/util/local-sqs-async-client/src/test/java/com/jashmore/sqs/util/LocalSqsAsyncClientImplTest.java b/util/local-sqs-async-client/src/test/java/com/jashmore/sqs/util/LocalSqsAsyncClientImplTest.java index 714dc9c4..fa08cb79 100644 --- a/util/local-sqs-async-client/src/test/java/com/jashmore/sqs/util/LocalSqsAsyncClientImplTest.java +++ b/util/local-sqs-async-client/src/test/java/com/jashmore/sqs/util/LocalSqsAsyncClientImplTest.java @@ -7,12 +7,12 @@ import static software.amazon.awssdk.services.sqs.model.QueueAttributeName.REDRIVE_POLICY; import static software.amazon.awssdk.services.sqs.model.QueueAttributeName.VISIBILITY_TIMEOUT; -import akka.http.scaladsl.Http; import java.net.URISyntaxException; import java.util.Collections; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; +import org.apache.pekko.http.scaladsl.Http; import org.elasticmq.rest.sqs.SQSRestServer; import org.elasticmq.rest.sqs.SQSRestServerBuilder; import org.junit.jupiter.api.AfterEach; @@ -151,7 +151,7 @@ void whenMaxReceiveCountUsedAndNoDeadLetterQueueNameIsIncludedTheDefaultNameIsus // assert final ListQueuesResponse listQueuesResponse = sqsAsyncClient.listQueues().get(); assertThat(listQueuesResponse.queueUrls()).hasSize(2); - assertThat(listQueuesResponse.queueUrls()).contains(queueServerUrl + "/queue/queueName-dlq"); + assertThat(listQueuesResponse.queueUrls()).anyMatch(url -> url.endsWith("/queueName-dlq")); } @Test