Uploaded image for project: 'JBoss A-MQ'
  1. JBoss A-MQ
  2. ENTMQ-2177

Provide a way to cache producers

    XMLWordPrintable

Details

    • Story
    • Resolution: Not a Bug
    • Major
    • None
    • JBoss A-MQ 6.3
    • broker
    • None

    Description

      Usage:

      PooledConnectionFactory with JMSTemplate and want to use it WITHOUT anonymous producers. There is a custom plugin that relies on the name of the destination to perform authorization checks and hence cannot use the anonymous producer feature.

      A new producer is created for every message as in the current implementation of PooledSession.java

      public MessageProducer getMessageProducer(Destination destination) throws 
      JMSException { 
              MessageProducer result = null; 
      
              if (useAnonymousProducers) { 
                  result = safeGetSessionHolder().getOrCreateProducer(); 
              } else { 
                  result = getInternalSession().createProducer(destination); 
              } 
      
              return result; 
          } 
      

      Is there a reason why producers aren't cached with PooledConnectionFactory (when not using anonymous producers similar to CachingConnectionFactory)? There are uses cases where you seem to think on high throughput application and they don't want to incur the overhead of creating producers for every message send.

      • anonymous producers: useAnonymousProducers = true (Default)
        Only 1 producer instance associated with a Session is created, that serves all requests.
      • non-anonymous produces: useAnonymousProducers = false
        There is a seperate producer instance created here which is what you are reporting.

      Creating a producer every time, involves a round-trip call to the broker and that can limit performance when it is done for every message.

      Attachments

        Activity

          People

            Unassigned Unassigned
            rhn-support-vgohel Viral Gohel
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: