Announcement Announcement Module
Collapse
No announcement yet.
load balancing MDP's in weblogic cluster Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • load balancing MDP's in weblogic cluster

    This is the set up I have.

    I have a bunch of spring MDP's deployed in a 4-machine weblogic 10.3 cluster.

    I use jndi look-up via connection factory to TIBCO EMS(or JMS) where my queues reside.

    I used DefaultJmsListenerContainer to configure my MDP's.

    I have concurrentConsumers = "4".

    I see 4 listeners on the queue as soon as spring application is deployed.

    Shouldn't I be seeing 4 times 4 = 16 listeners on the queue 4 for each machine?

    Also all the traffic is being directed to one single machine in the cluster. Shouldn't consumer be going round-robin among the 4 machines in the cluster?

    Effectively how do I configure spring MDP's so that they are cluster aware and distribute automatically across the cluster?

  • #2
    Bumping. can some one please help me with this?

    Comment


    • #3
      Any Solution ?

      Hi

      Did you find a solution for this issue.
      I am also facing similar problem

      I have a distributed Queue

      The Message producer application running in a weblogic10.0 cluster(2 instance)
      It looks up code to send a message is
      Code:
       jndiContext = new InitialContext();
       queueConnectionFactory = (QueueConnectionFactory) jndiContext.lookup("jms/cf");
      queue = (Queue) jndiContext.lookup("jms/DMSQueue");

      All the messages are sent to Queue, Here also it is not evenly distributed.

      consumer application is a spring MDP (Not running in cluster)
      The configuration of JNDI is

      Code:
        <bean id="jndiTemplate" class="org.springframework.jndi.JndiTemplate">
      		<property name="environment">
       			<props>
         				<prop key="java.naming.factory.initial">weblogic.jndi.WLInitialContextFactory</prop>
         				<prop key="java.naming.provider.url">t3://10.54.194.35:26103,10.54.194.35:26105</prop>
       			</props>
      		</property>
      	</bean>
      If you see the provider url, I have given both the server ip and port,

      the consumer config is

      Code:
      <bean id="listenerContainer" class="org.springframework.jms.listener.DefaultMessageListenerContainer">
          	<property name="concurrentConsumers" value="4" />
          	<property name="connectionFactory" ref="queueConnectionFactory" />
          	<property name="destination" ref="queue" />
          	<property name="messageListener" ref="messageListener" />
        	</bean>
      I have configured for 4 concurrentConsumers
      But all the Consumers are associsted with the first server
      the next one does not have any consumer associated.

      Is this a weblogic or spring problem ?

      Comment


      • #4
        Originally posted by bpgandlu View Post
        Also all the traffic is being directed to one single machine in the cluster. Shouldn't consumer be going round-robin among the 4 machines in the cluster?
        I think that might be JMS client library dependent. With ActiveMQ, I have a network of brokers setup for a distributed queue; my client only connects to one of the brokers, and can consume messages from sent to either broker.

        I have a bunch of spring MDP's deployed in a 4-machine weblogic 10.3 cluster.
        When you say listener, is that showing up in some weblogic managment screen or in the spring logs from one of your cluster instances?
        If you stop one of the cluster instances, do you see 3 listeners?

        Comment


        • #5
          Thank you for the response.

          I think I have solved this problem.

          It was because of unique client id. As soon as I made sure that the clientId from each machine is different then the problem has disappeared.

          It is got something to do with durable subscriber or something like that.

          So if I have 4 concurrent consumers in my spring config and there are 4 machines in the cluster , I am seeing 4X4=16 listeners on the queue.

          Comment


          • #6
            Hi,
            can you please explain how you solved the problem.
            In my case the Message producer application is running in a cluster of 4 server Instances in 2 machines.

            The client is a Spring MDP running in another server(Not clustered).
            I have set 4 concurrent Consumers,(I thought that Weblogic will load balance the 4 consumer Instance across the cluster) but all the consumers are getting associated with one instance, It is not distributed across the cluster.


            Your help is appreciated

            Thanks

            Comment


            • #7
              I have not dealt with producers but in my case it was listeners.

              I don't know if the same logic applies to producers.

              but here is what I did

              <bean id="commonMessageListenerContainer" class="org.springframework.jms.listener.DefaultMes sageListenerContainer">
              <property name="connectionFactory" ref="authenticatingConnectionFactory"/>
              <property name="destination" ref="getAttributeQueue"/>
              <property name="messageListener" ref="commonQueueServiecAdapter"/>

              I commented this out first and tested if that increased the number of listeners
              After that I changed the code that dynamically set the clientid using timestamp so that it is unique every time. Technically you would not need client id unless you need fine grained trouble shooting on our JMS instance.

              <!-- <property name="clientId" value="PDX.Common.Requestor"/>-->
              <property name="autoStartup" value="true"/>
              <property name="concurrentConsumers" value="6"/>
              </bean>

              Comment


              • #8
                After that I changed the code that dynamically set the clientid using timestamp so that it is unique every time. Technically you would not need client id unless you need fine grained trouble shooting on our JMS instance.
                I'm sure you know this, but the client ID is usually needed by the JMS broker to provider reliable delivery over a topic. If you use a timestamp, it is possible that messages sent to a topic while your consumer was not running will not be received. The precise behavior is probably JMS implementation dependent, however, you usually use something unique to the client 'instance' (like the hostname : port of your app server).

                Comment


                • #9
                  Yep I agree!

                  Comment

                  Working...
                  X