thanks for the response. But, I did it exactly like this,
except that I use Spring 3 and annotation config. The problem
is not the receiving but the acknowledgement. If I use a transaction
or not, it seems the message is acknowledged automatically while
receiving.
I tried it extending MessageListener directly and folowing way ..
noting works.
public class JMSListener implements SessionAwareMessageListener<TextMessage> {
...
@Override
public void onMessage(TextMessage message, Session session) {
...
}
}
This way I'm able to see the session settings. E.g. session.getAcknowledgeMode()
delivers client acknowledge and session.getTransacted() delivers true
or false depending on what I set. But it seems there is no effect.
The message seems to be acknowledged anyway.
There is also a difference in java doc for CLIENT_ACKNOWLEDGE of spring
and jee. For spring there is written:
"CLIENT_ACKNOWLEDGE": Automatic message acknowledgment after successful listener execution; no redelivery in case of exception thrown.
For jee there is written:
CLIENT_ACKNOWLEDGE With this acknowledgment mode, the client acknowledges a consumed message by calling the message's acknowledge method.
For me this could be the reason? But if this is really the case (and I
could'nt believe it) it would make spring unusable handling messages?