1 Reply Latest reply on May 20, 2011 5:24 PM by Clebert Suconic

    hornetq client thread pool

    george pitich Newbie

      hi all,

       

      just started investigating hornetq and managed to have a simple client talk to standalone hq server using core api. i wanted to learn how client can use a thread pool so it scales better. came across "41.2. Client-Side Thread Management" in the user manual:

       

      ServerLocator locator = HornetQClient.createServerLocatorWithoutHA(...)
      ClientSessionFactory myFactory = locator.createClientSessionFactory();
      myFactory.setUseGlobalPools(false);
      myFactory.setScheduledThreadPoolMaxSize(10);
      myFactory.setThreadPoolMaxSize(-1);

       

      but found out in javadocs (2.2 version) that createClientSessionFactory has been replaced with createSessionFactory and thread management functions are not exposed. "ClientSession is a single-thread object required for producing and consuming messages" so i assume i would need to manage thread pool in my code and there wouldn't be a library support for that purpose? could someone please confirm this?

       

      are ClientSession, ClientProducer and ClientConsumer thread safe or some kind of synchronisation is needed? is there any multithreaded example in the set of examples that ship with HQ?

       

      many thanks,

      g.