JMS Listener not consuming messages from the JMS Queue.
Consuming messages stopped working all of sudden, consumer count came to zero not increasing even though messages are being added to the queues.
Our Code Snippet:
```
**Config Class**
@Configuration
@ComponentScan
@EnableSwagger2
@EnableJms
@EnableAutoConfiguration
@EnableCaching
@PropertySource("classpath:application-resources.properties")
@JBossLog
public class MyApp extends SpringBootServletInitializer {
private static Class<MyApp> applicationClass = MyApp.class;
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(applicationClass);
}
@Bean
public DefaultJmsListenerContainerFactory jmsListenerContainerFactory(
ConnectionFactory connectionFactory, MyAppJmsErrorHandler errorHandler) {
DefaultJmsListenerContainerFactory factory = new DefaultJmsListenerContainerFactory();
factory.setConnectionFactory(connectionFactory);
factory.setErrorHandler(errorHandler);
return factory;
}
@Service
public class MyAppJmsErrorHandler implements ErrorHandler {
@Override
public void handleError(Throwable t) {
log.error(t.getStackTrace());
}
}
}
**Listener Class:**
@Component
public class MyListener {
@Autowired
TestService serviceInstance;
/**
* @param request
*/
@JmsListener(destination = TEST_QUEUE, concurrency = "100")
public void onMessage(IncomingRequest request) {
serviceInstance.callDB();
}
}