8 Replies Latest reply on Aug 3, 2016 8:43 AM by Miroslav Novak

    MDB consumers in Wildfly 8.2.1

    vijayavs Newbie

      Hi,

       

      I'm currently using Wildfly 8.2.1 to deploy an MDB which will connect to a remote Queue (JBoss A_MQ) via resource adapter.

       

      I've setup all configurations correctly and it works. But I cannot update the JMS consumers from the current number of 1. I wish to have it as 10.

       

      I added the following property

      @ActivationConfigProperty(propertyName = "maxSessions", propertyValue = "10")

       

      along with the following configuration:


      <mdb>

      <resource-adapter-ref resource-adapter-name="activemq-ra.rar"/>

      <bean-instance-pool-ref pool-name="mdb-strict-max-pool"/>

      </mdb>

      <pools>

      <bean-instance-pools>

      <strict-max-pool name="slsb-strict-max-pool" max-pool-size="20" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>

      <strict-max-pool name="mdb-strict-max-pool" max-pool-size="10" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>

      </bean-instance-pools>

      </pools>

       

      It did not work. Please help!!!

       

      Thanks

      Vijay

        • 1. Re: MDB consumers in Wildfly 8.2.1
          Miroslav Novak Master

          Activation config property maxSessions is implementation specific and is for HornetQ resource adapter. This is the reason why it does not work.

           

          Could you check how many sessions of MDB is in the pool by:

          [standalone@localhost:9990 /] ls /deployment=mdb-1.0-SNAPSHOT.jar/subsystem=ejb3/message-driven-bean=mdb         

          ...

          change mdb name and check attribute - pool-current-size and pool-max-size.

           

          I think that you can see only one consumer because this one consumer feeds all MDB sessions. But this needs to be validated.

          • 2. Re: MDB consumers in Wildfly 8.2.1
            Justin Bertram Master

            The "maxSessions" activation configuration property is supported on the ActiveMQ Artemis JCA RA.

            • 3. Re: MDB consumers in Wildfly 8.2.1
              Justin Bertram Master

              Sorry, the property is named "maxSession" (no 's' on the end).

              • 4. Re: MDB consumers in Wildfly 8.2.1
                vijayavs Newbie

                Below is the information you had requested:

                 

                [standalone@localhost:9990 /] ls /deployment=somosejbpocEAR.ear/subdeployment=somosejbpoc.jar/subsystem=ejb3/message-driven-bean=JMSMessageListenerSmallQueue

                service                                            methods={}                                         pool-name=mdb-strict-max-pool

                component-class-name=JMSMessageListenerSmallQueue  peak-concurrent-invocations=0                      pool-remove-count=0

                declared-roles=[]                                  pool-available-count=10                            run-as-role=undefined

                delivery-active=true                               pool-create-count=0                                security-domain=other

                execution-time=0                                   pool-current-size=0                                timers=[]

                invocations=0                                      pool-max-size=10                                   wait-time=0

                • 5. Re: MDB consumers in Wildfly 8.2.1
                  vijayavs Newbie

                  I ran a test with 10 threads sending messages to the queue. Below is the output which I observed :

                   

                  [standalone@localhost:9990 /] ls /deployment=somosejbpocEAR.ear/subdeployment=somosejbpoc.jar/subsystem=ejb3/message-driven-bean=JMSMessageListenerSmallQueue

                  service                                            methods={}                                         pool-name=mdb-strict-max-pool

                  component-class-name=JMSMessageListenerSmallQueue  peak-concurrent-invocations=0                      pool-remove-count=0

                  declared-roles=[]                                  pool-available-count=7                             run-as-role=undefined

                  delivery-active=true                               pool-create-count=10                               security-domain=other

                  execution-time=0                                   pool-current-size=10                               timers=[]

                  invocations=0                                      pool-max-size=10                                   wait-time=0

                   

                  [standalone@localhost:9990 /] ls /deployment=somosejbpocEAR.ear/subdeployment=somosejbpoc.jar/subsystem=ejb3/message-driven-bean=JMSMessageListenerSmallQueue

                  service                                            methods={}                                         pool-name=mdb-strict-max-pool

                  component-class-name=JMSMessageListenerSmallQueue  peak-concurrent-invocations=0                      pool-remove-count=0

                  declared-roles=[]                                  pool-available-count=9                             run-as-role=undefined

                  delivery-active=true                               pool-create-count=10                               security-domain=other

                  execution-time=0                                   pool-current-size=10                               timers=[]

                  invocations=0                                      pool-max-size=10                                   wait-time=0

                  • 6. Re: MDB consumers in Wildfly 8.2.1
                    Miroslav Novak Master

                    Thanks for update!

                     

                    As there is pool-current-size=10 and pool-max-size=10 during load, there are really 10 MDB sessions. You're seeing one consumer on the queue because those 10 MDB sessions are fed by just 1 consumer. It looks like that this is A-MQ 6/ActiveMQ 5.x resource adapter implementation way, how it consumes messages from for MDB. I understand that one consumer might be a bottleneck. I know that HornetQ/Artemis resource adapter has 1 consumer per MDB session so it's implemented differently.

                     

                    Looking at activation config properties for ActiveMQ resource adapter - Apache ActiveMQ ™ -- Activation Spec Properties - there are some tips to maximise the throughput. It depends what you need. I guess it can be tuned to minimize latency as well.

                    • 7. Re: MDB consumers in Wildfly 8.2.1
                      vijayavs Newbie

                      Thank you for the response!

                       

                      i Wish to have 1 consumer per MDB to increase throughput. I'll try using maxSessionsPerMessages=10 and test to let you know the results.

                       

                      appreciate your help!

                      • 8. Re: MDB consumers in Wildfly 8.2.1
                        Miroslav Novak Master

                        You're welcome. I hope you manage to tune it well :-)