ome / omero-ms-queue

GNU General Public License v3.0
3 stars 5 forks source link

Artemis invalid concurrent session usage #15

Closed c0c0n3 closed 5 years ago

c0c0n3 commented 6 years ago

We've had this warning logged by Artemis on one of our prod boxes:

AMQ212051: Invalid concurrent session usage.
Sessions are not supposed to be used by more
than one thread concurrently.

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 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.

Either way, review and fix!