tomcat7 - Ensuring Spring Integration deployment's JMS listener threads are cleaned up on Tomcat undeploy -


I have a simple Spring Integration application messages off a Websphere MQ queue Tomcat (v7.0.x) is . When I un-deploy the war on the Tomcat server, the war deploys the United Nations, but the JMS listeners are running on the threadtalk server which will still use the message from the Websphere MQ queue. So I am convinced that I am not clearing the part of the application properly to the JM audience?

Here's the stack I'm using:

  Java 8 Tomcat 7.0 55 spring integration 4.0.4 Spring Integration Java Dsl 1.0.0.M3  < / pre> 

in terms of the configuration of Meri Sai application, I have a JmsConfig class:

  @Configuration @ComponentScan public square JmsConfig {@Autowired personal qualities jndiProperties; Private connectionfinary mqConnectionFactory () naming exceptions {reference throws CTX = new initial correction (jndiparties); {MQQueueConnectionFactory Connection Factory = (MQQueueConnectionFactory) try ctx.lookup ("jms / service / SERVICE_QCF"); Return Connection Factory; } Finally {ctx.close (); }} @ Bean throws Public Knekshnsficring caching Knnakshnfaktain () naming Apokshns {caching Knnekshn Factory Knekshnfrinl = new caching Knnakshnfaccrri (); ConnectionFactory.setTargetConnectionFactory (mqConnectionFactory ()); ConnectionFactory.setSessionCacheSize (10); Return Connection Factory; }}  

I have a unity config class:

  @Configuration @EnableIntegration public square IntegrationConfig {@Autowired private ConnectionFactory cachingConnectionFactory; @Bean public IntegrationFlow requestFlow () {return IntegrationFlows .from (Jms.inboundAdapter (cachingConnectionFactory) .destination ( "SERVICE_QUEUE_NAME"), C - & gt; {c.poller (Pollers.fixedRate (100));}) .channel ( "Request.service.ch") find ().; }}  

Web Initialiser config class:

  @Configuration implements public square WebInitialiser WebApplicationInitializer {public void onStartup (ServletContext ServletContext) throws ServletException {AnnotationConfigWebApplicationContext rootContext = New AnnotationConfigWebApplicationContext (); RootContext.register (ApplicationConfig.class, JmsConfig.class, IntegrationConfig. Class, DatabaseConfig.class); ServletContext.addListener (New ContextLoaderListener (rootContext)); }}  

During the deployment phase without the United Nations, I look in the following Kotlina logs that may or may not be related:

  SEVERE: Web applications [/ Service-A] has started a thread [Thread-7] but failed to stop it, it is likely that this will lead to a memory leak.  

There is something that I have not set up yet or configured or annotated in order to ensure that the JMS listener of the deployment was cleared by the JVM during the un-deployed phase of the thread war. Is it done?

Thanks in advance, Prime Minister.

To ensure that the JMS audience thread is deployed without application, with my target A CachingConnectionFactory bean is built, which is of MQConnectionFactory Then, spring flows into integration, I just pass in caching. Instead of the connectionfatteren bean to the JMS adapter, I updated the configuration to show it in this post. Cheers, PM


Comments