-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Description
Dirk opened SPR-14233 and commented
We are having the following configuration:
- 2 JMSListener
- XA Transactions with Atomikos or Bitronix
- Spring Boot 1.3.3
The application runs fine but after shutdown, the DefaultLifecycleProcessor is waiting 30 seconds and then prints:
43621 [Thread-7] WARN org.springframework.context.support.DefaultLifecycleProcessor - Failed to shut down 1 bean with phase value 2147483647 within timeout of 30000: [org.springframework.jms.config.internalJmsListenerEndpointRegistry]
This happens only, if one of the JMSListener gets stopped before by doing:
JmsListenerEndpointRegistry registry = context.getBean(JmsListenerEndpointRegistry.class);
registry.getListenerContainer("MyListener1").stop();
If I comment one listener out, or keep both JMSListener running - the timeout does not happen and the application shuts down immediately.
The app hangs even if no work has been processed. I reduced the JMSListener
to contain no own business logic at all:
public class MyListener {
// Die ID wird benoetigt, damit der Listener programmatisch gestoppt werden kann
protected static final String ID = "MyListener1";
@JmsListener(id = ID, destination="MYQUEUE")
public void receiveMessage(Message msg) {
System.out.println("Hello!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
}
}
The problem arises both with Atomikos and Bitronix.
So to me, it looks like you need to have 2 JMSListeners and need to stop one of them to reproduce this problem.
Any help would be appreciated.
Affects: 4.2.5
Referenced from: commits 85675fb, 85faeef, 09b45d2, e45d33f, f83cbff