Announcement Announcement Module
Collapse
No announcement yet.
JMSChannel performance Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • JMSChannel performance

    Hi,
    We are having a PollableJMSChannel and a service activator for the same. The performance of the JMS channel seems to be quite slow. When we try to send a large number of messages to this channel the service activator seems to be receiving the messages very slowly. We are using activemq as our jms provider and spring CachingConnectionFactory in our configuration.
    Could you please tell us how to tune the configuration to improve the performance?

  • #2
    Any reason for using PollableJMSChannel? What is the polling frequency configured in your poller? Would be helpful if you post the configuration here.
    Also would be great if you tell all where exactly you think the performance is bad and what exactly are you expecting.

    Comment


    • #3
      well if you are using pollable channel have you configured poller for that channel or have you configured global level poller configuration...BELOW IS THE GLOBAL LEVEL POLLER CONFIGURATION IS..

      Code:
      <si:poller max-messages-per-poll="1" id="defaultPoller" default="true">
      		<si:interval-trigger interval=10 />
      	</si:poller>
      additionally you must also implement logging channel adapter and set it level to INFO to see what is happening in that pollable channel..!!

      Comment


      • #4
        this is the configuration that we use. the poller element is defined for the service activator with fixed rate as 50ms and timeout as 5000 ms.


        <jms:channel id="currentLocationJMSBufferDataChannel"
        acknowledge="transacted" message-driven="false"
        connection-factory="cachingConnectionFactory" message-converter="messageConverter"
        queue-name="dwara.processingunit.currentLocationQueue">
        </jms:channel>

        <si:service-activator id="currentLocationJMSServiceActivator"
        input-channel="currentLocationJMSBufferDataChannel" ref="currentLocationDataHandler"
        method="handleBufferedData">
        <sioller fixed-rate="50" receive-timeout="5000"
        task-executor="currentLocationJMSDataExecutor" />
        </si:service-activator>

        <task:executor id="currentLocationJMSDataExecutor"
        pool-size="5" queue-capacity="0" rejection-policy="DISCARD" />

        <bean id="currentLocationDataHandler"
        class="com.trimble.mrm.dwara.processingunit.intern al.handler.CurrentLocationDataHandler">
        <constructor-arg index="0" value="20" />
        </bean>

        Each jms message contains a data buffer and the service activator inserts the buffer data into DB. The jms queues would be getting messages at the rate of 50-150 messages per second.

        Comment


        • #5
          The rate at which messages are coming is high and your polling frequency is too low, you wont be receiving more than 20 messages per sec with this frequency.

          Are these messages coming from an external system? I would prefer using jms:message-driven-channel-adapter configured with a SimpleMessageListenerContainer. Tune the parameters of the container for some suitable value of max concurrent consumers.

          See if making these changes help you in seeing a better performance in receiving the messages.

          Comment


          • #6
            Originally posted by Amol Nayak View Post
            I would prefer using jms:message-driven-channel-adapter configured with a SimpleMessageListenerContainer. Tune the parameters of the container for some suitable value of max concurrent consumers.
            Hi Anmol ,

            Can you please explain a little SimpleMessageListenerContainer....with an example..??

            Comment


            • #7
              Please read the Spring and Spring Integration References.

              The JMS SI sample on github uses a message-driven-channel-adapter.

              Comment


              • #8
                Originally posted by Gary Russell View Post
                Please read the Spring and Spring Integration References.

                The JMS SI sample on github uses a message-driven-channel-adapter.
                Hi Gary ,

                Thanks, I am clear on message-driven-channel-adapter that picks up the messages from the message broker in case of spring Integration but please explain about SimpleMessageListenerContainer...is this is also a listener which picks up the messages from the message broker..??

                Comment


                • #9
                  The message-driven adapter delegates to a MessageListenerContainer (DefaultMessageListenerContainer by default). Certain attributes are exposed by the namespace (concurrent-consumers, for example), allowing you to configure the listener container that way.

                  You can also inject your own instance if you wish.

                  See the Spring Reference for information about listener containers.

                  Comment


                  • #10
                    Originally posted by Gary Russell View Post
                    The message-driven adapter delegates to a MessageListenerContainer (DefaultMessageListenerContainer by default). Certain attributes are exposed by the namespace (concurrent-consumers, for example), allowing you to configure the listener container that way.

                    You can also inject your own instance if you wish.

                    See the Spring Reference for information about listener containers.
                    Hi Gary ,

                    Thanks for the explanation , so the spring integration message-driven channel adapter can delegates to a MessageListenerContainer of spring jms..??

                    <bean id="messageListenerContainer"
                    class="org.springframework.amqp.rabbit.listener.Si mpleMessageListenerContainer">
                    <property name="connectionFactory" ref="connectionFactory" />
                    <property name="queueName" value="cbs.push.queue" />
                    <property name="concurrentConsumers" value="1" />
                    <property name="messageListener" ref="cbsListener" />
                    <property name="channelTransacted" value="true" />
                    <property name="autoStartup" value="false" />
                    </bean>

                    Comment


                    • #11
                      Yes, but most people use a DefaultMessageListenerContainer instead of a SimpleMessageListenerContainer (READ THE SPRING REFERENCE MANUAL TO UNDERSTAND THE DIFFERENCES).

                      The most common attributes for the DMLC are exposed on the message-driven-channel-adapter, so there usually is no need to specify the bean externally.

                      Comment

                      Working...
                      X