Contrary to what I thought by reading the manual, sessions cannot be shared among threads. One easy fix is to make the ArtemisQConnector methods synchronized as well as the sendMessage method of ArtemisQProducer---look at the stack traces in the Spring log. A more sophisticated approach would be to wrap the Artemis session I/F, have a pool of sessions and make them thread-scoped. Not sure it's worth the trouble though.
We've had this warning logged by Artemis on one of our prod boxes:
See attached Spring log file.
Contrary to what I thought by reading the manual, sessions cannot be shared among threads. One easy fix is to make the
ArtemisQConnector
methodssynchronized
as well as thesendMessage
method ofArtemisQProducer
---look at the stack traces in the Spring log. A more sophisticated approach would be to wrap the Artemis session I/F, have a pool of sessions and make them thread-scoped. Not sure it's worth the trouble though.Either way, review and fix!