7 Replies Latest reply on Apr 28, 2014 8:54 AM by Andy Taylor

    Client Session concurrent usage in 2.4.1.Final

    Yair Ogen Expert

      I have a use-case where I am using the ClientSession instance concurrently (e.g. sending in parallel using the same producer).


      I thought that's the way to go as indicated in "8.1.8. ClientProducer" section in the manual:

      Please note that ClientSession, ClientProducer and ClientConsumer instances are designed to be re-used


      However, I keep seeing these warnings:


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

      [Exception: java.lang.Exception: trace


      So - what's the best practice here? I thought consumers and producers are designed as thread-safe objects - hence I should be able to reuse them. Am I supposed to create a producer/consumer per thread?