java - Spring DefaultMessageListenerContainer, ActiveMQ and message redelivery -
If I use to get JMS messages, I do not get JMMS message again, even if I < Code> Accept for session <2> to <.
In the case of the Runtime Exposure
within onMessage ()
of my JavaBan, the message is not accepted. JM Provider (), this queue Remains in the form of pending but it is never again, which I feel that does not call spring anytime to session.recover ()
, according to which it is necessary to redistribute It is necessary to be.
Any button can give me an indication how I can configure DefaultMessageListenerContainer
to call session.recover ()
in the case of runtime exceptions Am I
Best regards,
You indicate that Accept the session you are using 2 which is the session. CLIENT_ACKNOWLEDGE The following statement is taken directly from:
- "CLIENT_ACKNOWLEDGE": Automatic message acceptance after successful listeners execution;
Therefore the problem is not with Spring DML and it is a sessions session throwing exception. There is the ability to call the recorder. Is it possible to use attempts / hold to handle runtime exceptions by calling session / appointment () in your listener's on-message () method?
Update:
You make a good issue about boilerplate code. It is sprinkled in many places and is being repeated again. Is not this code possible for you? It is a common solution to create an abstract basic class with any method that involves effort / gait with appropriate processing, that should be done. Then just expand the original class to apply several custom processors as needed, however you can wire the processor together properly using your spring app reference.
I have never had any problem in adding Spring-specific code to an application because it runs anywhere, it was important to me when I started using Spring. This is not specific to a single app server or servlet container, so it is not that I'm coding myself in a corner with spring, the way I am doing if I'm com.ibm or com.oracle to my Importing into source code In fact, I have used the Spring JMS API with an MOM and have switched to another MOM without changing anything other than the JMS connection factory definition.
Comments
Post a Comment