In the documentation I see the following sentence:
A Session object can be used on only a single thread at any one time. (Source)
Does this mean that if my application is multi-threaded, and if my ISession
objects are accessible for multiple threads, that I have to lock ISession
objects whenever I use them so these objects are accessed synchronously?
I use ISession
objects when Sending messages (here I'm in a multi-threaded context, so should I lock ISession objects here?)
Example code:
var textMessage = _session.CreateTextMessage(message);
producer.Send(textMessage);