Reputation: 232
I have the following configuration :
<jms:listener-container container-type="default" connection-factory="cachedConnectionFactory" acknowledge="auto">
<jms:listener id="myListenerContainerId" destination="myDestination" ref="myListener" method="onMessage" />
</jms:listener-container>
<bean id="myListenerId" class="X.Y.Z.myListener">
// Some attributes
</bean>
And the following listener :
public class myListener implements MessageListener {
@Override
public void onMessage(Message message) {
// Some work
}
}
Is there a way to get the DefaultMessageListenerContainer myListenerContainerId
from within my listener ?
To clarify my needs, the listener onMessage
is getting triggered whether myListenerId
is running or not, active or not. I need to check if it's triggered only from myListenerContainerId
.
Upvotes: 1
Views: 567
Reputation: 174544
No; but if you add new RuntimeException().printStackTrace()
you can see where it is called from.
Or you could examine the thread name (which has DefaultMessageListenerContainer
in it, by default).
Upvotes: 2