GH-85: Add SqsMDChannelAdapter.getQueue()
Fixes spring-projects/spring-integration-aws#85 * For better component management add `SqsMessageDrivenChannelAdapter.getQueue()` to return what queues this channel adapter is subscribed * Upgrade to Gradle 4.6 and Checkstyle 8.8
This commit is contained in:
@@ -91,7 +91,7 @@ jacoco {
|
||||
|
||||
checkstyle {
|
||||
configFile = file("${rootDir}/src/checkstyle/checkstyle.xml")
|
||||
toolVersion = "8.5"
|
||||
toolVersion = "8.8"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,5 +1,5 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4.1-bin.zip
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2017 the original author or authors.
|
||||
* Copyright 2016-2018 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.
|
||||
@@ -33,6 +33,7 @@ import org.springframework.core.task.AsyncTaskExecutor;
|
||||
import org.springframework.integration.aws.support.AwsHeaders;
|
||||
import org.springframework.integration.endpoint.MessageProducerSupport;
|
||||
import org.springframework.integration.support.management.IntegrationManagedResource;
|
||||
import org.springframework.jmx.export.annotation.ManagedAttribute;
|
||||
import org.springframework.jmx.export.annotation.ManagedOperation;
|
||||
import org.springframework.jmx.export.annotation.ManagedResource;
|
||||
import org.springframework.messaging.Message;
|
||||
@@ -160,6 +161,11 @@ public class SqsMessageDrivenChannelAdapter extends MessageProducerSupport imple
|
||||
return this.listenerContainer.isRunning(logicalQueueName);
|
||||
}
|
||||
|
||||
@ManagedAttribute
|
||||
public String[] getQueues() {
|
||||
return Arrays.copyOf(this.queues, this.queues.length);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
this.listenerContainer.destroy();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2015-2017 the original author or authors.
|
||||
* Copyright 2015-2018 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.
|
||||
@@ -108,6 +108,8 @@ public class SqsMessageDrivenChannelAdapterTests {
|
||||
this.controlBusInput.send(new GenericMessage<>("@sqsMessageDrivenChannelAdapter.start('foo')")))
|
||||
.hasCauseExactlyInstanceOf(IllegalArgumentException.class)
|
||||
.hasMessageContaining("Queue with name 'foo' does not exist");
|
||||
|
||||
assertThat(this.sqsMessageDrivenChannelAdapter.getQueues()).isEqualTo(new String[] { "testQueue" });
|
||||
}
|
||||
|
||||
@Configuration
|
||||
|
||||
Reference in New Issue
Block a user