title: Why is my Spring Boot app with SQS Not Showing a JMSHealthIndicator?
body: <p>I'm working on a Spring Boot application that takes messages from SQS as described on this post <a href="https://aws.amazon.com/blogs/developer/using-amazon-sqs-with-spring-boot-and-spring-jms/" rel="nofollow noreferrer">https://aws.amazon.com/blogs/developer/using-amazon-sqs-with-spring-boot-and-spring-jms/</a></p>
  
  <p>When I access the built in Spring Boot health endpoint at <code>localhost:8081/health</code> I expect to see some information about the JMS broker as the <a href="https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#production-ready-health" rel="nofollow noreferrer">Spring Boot docs</a> say there are auto configured health indicators that are configured "when appropriate" one of which is the <code>JmsHealthIndicator</code>. Instead I just see the status and diskspace <code>{"status":"UP","diskSpace":{"status":"UP","total":31572619264,"free":24611381248,"threshold":10485760}}</code></p>
  
  <p>Does anyone know why we don't see anything about JMS on the health endpoint? The application works fine reading from SQS but since it's hosted in Kubernetes I want to add a readiness/liveness probe and to include JMS in the check.</p>
  
  <p>For information our JMS config with <code>@EnableJms</code> is as follows </p>
  
  <pre><code>import javax.jms.Session;
  
  import com.amazon.sqs.javamessaging.SQSConnectionFactory;
  import com.amazonaws.auth.AWSCredentialsProvider;
  import org.slf4j.Logger;
  import org.slf4j.LoggerFactory;
  import org.springframework.cloud.aws.core.region.RegionProvider;
  import org.springframework.context.annotation.Bean;
  import org.springframework.context.annotation.Configuration;
  import org.springframework.jms.annotation.EnableJms;
  import org.springframework.jms.config.DefaultJmsListenerContainerFactory;
  import org.springframework.jms.core.JmsTemplate;
  import org.springframework.jms.support.destination.DynamicDestinationResolver;
  
  @Configuration
  @EnableJms
  public class JmsConfig {
  
  private static final Logger LOGGER = LoggerFactory.getLogger(JmsConfig.class);
  private static final String LOWER_UPPER_CONCURRENCY = "3-10";
  
  private final SQSConnectionFactory connectionFactory;
  
  public JmsConfig(RegionProvider regionProvider, AWSCredentialsProvider awsCredentialsProvider) {
      this.connectionFactory = SQSConnectionFactory.builder()
              .withRegion(regionProvider.getRegion())
              .withAWSCredentialsProvider(awsCredentialsProvider)
              .build();
      LOGGER.info("Loading JmsConfig");
  }
  
  @Bean
  public DefaultJmsListenerContainerFactory jmsListenerContainerFactory() {
      DefaultJmsListenerContainerFactory factory =
              new DefaultJmsListenerContainerFactory();
      factory.setConnectionFactory(this.connectionFactory);
      factory.setDestinationResolver(new DynamicDestinationResolver());
      factory.setConcurrency(LOWER_UPPER_CONCURRENCY);
      factory.setSessionAcknowledgeMode(Session.CLIENT_ACKNOWLEDGE);
      return factory;
  }
  
  @Bean
  public JmsTemplate defaultJmsTemplate() {
      return new JmsTemplate(this.connectionFactory);
  }
  
  }
  </code></pre>
  
  <p>Then we also have a method annotated with <code>@JmsListener(destination = "${sqs.input.queue}")</code></p>
  
  <p>Edit: Note that I have already tried adding the following to the application.properties</p>
  
  <pre><code>management.health.defaults.enabled=true
  management.health.jms.enabled=true
  endpoints.health.sensitive=false
  </code></pre>
  
  <p>Thanks, 
  Leanne.</p>