4 Replies Latest reply on Nov 29, 2005 2:09 PM by Adrian Brock

    Producers/Consumers and managed jms connections

    Tim Fox Master

      If obtaining jms connections via the jms jca adapter, the session maps 1-1 to the managed connection and are pooled.

      The consumers and producers of the session don't seem to be cached though.

      So every time I call createConsumer(), createProducer() on a org.jboss.resource.adapter.jms.Session object it it seems to be going to the JMS provider to create the consumer/producer.

      E.g. if I wanted to send a message to another destination every time an MDB onMessage method is executed, I would actually get a new producer created for every message send.

      Although producer/consumer creation is lightweight compared to connection creation it still requires a jms server hit in jboss-messaging (I'm not sure whether it's handled locally in JBossMQ)

      So I'm thinking this could cause a performance problem.

      Is there any reason why the org.jboss.resource.adapter.jms.Session can't return Consumer/Producer objects from it's cache when a create consumer/producer is requested? These could be keyed on the creation parameters?