Move JMS health auto-configuration into spring-boot-jms
This commit is contained in:
committed by
Phillip Webb
parent
47831a41ed
commit
df7afc5aac
@@ -59,12 +59,6 @@
|
||||
"description": "Whether to enable InfluxDB health check.",
|
||||
"defaultValue": true
|
||||
},
|
||||
{
|
||||
"name": "management.health.jms.enabled",
|
||||
"type": "java.lang.Boolean",
|
||||
"description": "Whether to enable JMS health check.",
|
||||
"defaultValue": true
|
||||
},
|
||||
{
|
||||
"name": "management.health.ldap.enabled",
|
||||
"type": "java.lang.Boolean",
|
||||
|
||||
@@ -16,7 +16,6 @@ org.springframework.boot.actuate.autoconfigure.endpoint.jackson.JacksonEndpointA
|
||||
org.springframework.boot.actuate.autoconfigure.endpoint.jmx.JmxEndpointAutoConfiguration
|
||||
org.springframework.boot.actuate.autoconfigure.env.EnvironmentEndpointAutoConfiguration
|
||||
org.springframework.boot.actuate.autoconfigure.integration.IntegrationGraphEndpointAutoConfiguration
|
||||
org.springframework.boot.actuate.autoconfigure.jms.JmsHealthContributorAutoConfiguration
|
||||
org.springframework.boot.actuate.autoconfigure.ldap.LdapHealthContributorAutoConfiguration
|
||||
org.springframework.boot.actuate.autoconfigure.liquibase.LiquibaseEndpointAutoConfiguration
|
||||
org.springframework.boot.actuate.autoconfigure.logging.LogFileWebEndpointAutoConfiguration
|
||||
|
||||
@@ -16,7 +16,7 @@ dependencies {
|
||||
|
||||
compileOnly("com.fasterxml.jackson.core:jackson-annotations")
|
||||
|
||||
optional(project(":spring-boot-project:spring-boot-actuator"))
|
||||
optional(project(":spring-boot-project:spring-boot-actuator-autoconfigure"))
|
||||
optional(project(":spring-boot-project:spring-boot-autoconfigure"))
|
||||
optional("jakarta.transaction:jakarta.transaction-api")
|
||||
optional("org.messaginghub:pooled-jms") {
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.actuate.autoconfigure.jms;
|
||||
package org.springframework.boot.jms.actuate.health.autoconfigure;
|
||||
|
||||
import jakarta.jms.ConnectionFactory;
|
||||
|
||||
@@ -28,6 +28,7 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.boot.jms.actuate.health.JmsHealthIndicator;
|
||||
import org.springframework.boot.jms.autoconfigure.JmsAutoConfiguration;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
|
||||
/**
|
||||
@@ -36,8 +37,7 @@ import org.springframework.context.annotation.Bean;
|
||||
* @author Stephane Nicoll
|
||||
* @since 2.0.0
|
||||
*/
|
||||
@AutoConfiguration(afterName = { "org.springframework.boot.activemq.autoconfigure.ActiveMQAutoConfiguration",
|
||||
"org.springframework.boot.artemis.autoconfigure.ArtemisAutoConfiguration" })
|
||||
@AutoConfiguration(after = JmsAutoConfiguration.class)
|
||||
@ConditionalOnClass({ ConnectionFactory.class, JmsHealthIndicator.class })
|
||||
@ConditionalOnBean(ConnectionFactory.class)
|
||||
@ConditionalOnEnabledHealthIndicator("jms")
|
||||
@@ -15,6 +15,6 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* Auto-configuration for actuator JMS concerns.
|
||||
* Auto-configuration for JMS health integration.
|
||||
*/
|
||||
package org.springframework.boot.actuate.autoconfigure.jms;
|
||||
package org.springframework.boot.jms.actuate.health.autoconfigure;
|
||||
@@ -1,6 +1,13 @@
|
||||
{
|
||||
"groups": [],
|
||||
"properties": [],
|
||||
"properties": [
|
||||
{
|
||||
"name": "management.health.jms.enabled",
|
||||
"type": "java.lang.Boolean",
|
||||
"description": "Whether to enable JMS health check.",
|
||||
"defaultValue": true
|
||||
}
|
||||
],
|
||||
"hints": [
|
||||
{
|
||||
"name": "spring.jms.listener.session.acknowledge-mode",
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
org.springframework.boot.jms.actuate.health.autoconfigure.JmsHealthContributorAutoConfiguration
|
||||
org.springframework.boot.jms.autoconfigure.JmsAutoConfiguration
|
||||
org.springframework.boot.jms.autoconfigure.JndiConnectionFactoryAutoConfiguration
|
||||
|
||||
@@ -14,17 +14,18 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.actuate.autoconfigure.jms;
|
||||
package org.springframework.boot.jms.actuate.health.autoconfigure;
|
||||
|
||||
import jakarta.jms.ConnectionFactory;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration;
|
||||
import org.springframework.boot.artemis.autoconfigure.ArtemisAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigurations;
|
||||
import org.springframework.boot.jms.actuate.health.JmsHealthIndicator;
|
||||
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.mockito.Mockito.mock;
|
||||
|
||||
/**
|
||||
* Tests for {@link JmsHealthContributorAutoConfiguration}.
|
||||
@@ -34,8 +35,9 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
class JmsHealthContributorAutoConfigurationTests {
|
||||
|
||||
private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
|
||||
.withConfiguration(AutoConfigurations.of(ArtemisAutoConfiguration.class,
|
||||
JmsHealthContributorAutoConfiguration.class, HealthContributorAutoConfiguration.class));
|
||||
.withConfiguration(AutoConfigurations.of(JmsHealthContributorAutoConfiguration.class,
|
||||
HealthContributorAutoConfiguration.class))
|
||||
.withBean(ConnectionFactory.class, () -> mock(ConnectionFactory.class));
|
||||
|
||||
@Test
|
||||
void runShouldCreateIndicator() {
|
||||
Reference in New Issue
Block a user