[activemq-user] 转发: about maxMessagesPerSessions parameter

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[activemq-user] 转发: about maxMessagesPerSessions parameter

Wu, Xiaofeng1 (GE Healthcare, consultant)
 

  _____  

发件人: Wu, Xiaofeng1 (GE Healthcare, consultant)
发送时间: 2005年11月17日 17:29
收件人: '[hidden email]'
主题: about maxMessagesPerSessions parameter


I have used ActiveMQ+Jencks+JmsTemplate to build a jms program. Next snippet is the config xml file.
But when I use the default maxMessagesPerSessions value.
It can only process a little message and hang. And it can work for a long time when I set it to 10000. What's the mean of maxMessagesPerSessions parameter.
  <!-- definition of JCA Connector -->
  <bean id="jencks" class="org.jencks.JCAContainer">
 
    <!-- lets use the default configuration of work manager and transaction manager-->
    <property name="bootstrapContext">
      <bean class="org.jencks.factory.BootstrapContextFactoryBean">
        <property name="threadPoolSize" value="200"/>
      </bean>
    </property>
 
    <!-- the JCA Resource Adapter -->
    <property name="resourceAdapter">
      <bean id="activeMQResourceAdapter" class="org.activemq.ra.ActiveMQResourceAdapter">
        <property name="serverUrl" value="tcp://localhost:61616"/>
      </bean>
    </property>
  </bean>
...
  <!-- Spring JMS Template -->
  <bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate">
    <property name="connectionFactory">
 
      <!-- use the same JMS Session to publish on -->
      <bean class="org.activemq.ra.jms.ConnectionProxyFactory"/>
    </property>
    <property name="explicitQosEnabled" value="true"/>
    <property name="timeToLive" value="10000"/>
  </bean>
...
  <bean id="getInfoStage" class="org.jencks.JCAConnector">
    <property name="jcaContainer" ref="jencks" />
    <property name="activationSpec">
      <bean class="org.activemq.ra.ActiveMQActivationSpec">
        <property name="destination" value="task.getInfo"/>
        <property name="destinationType" value="javax.jms.Queue"/>
  <property name="maxSessions" value="100"/>
  <property name="maxMessagesPerSessions" value="10000"/>
      </bean>
    </property>
    <property name="ref" value="getInfoTask" />
  </bean>

  <bean id="getInfoTask" class="..." singleton="true">
        <property name="temp" ref="jmsTemplate"
  </bean>

Reply | Threaded
Open this post in threaded view
|

Re: [activemq-user] 转发: about maxMessagesPerSessions parameter

jlim

Hi Xiaofeng1,

I believe the maxMessagePerSession paramamter sets  the prefetch size of the
consumer. It tells  how many messages a broker will send to the client
without receiving an ack before he stops dispatching messages to the client.
Hope this helps.

Regards,
Jonas

----- Original Message -----
From: "Wu, Xiaofeng1 (GE Healthcare, consultant)" <[hidden email]>
To: <[hidden email]>
Sent: Monday, November 21, 2005 10:14 AM
Subject: [activemq-user] ??: about maxMessagesPerSessions parameter




  _____

???: Wu, Xiaofeng1 (GE Healthcare, consultant)
????: 2005?11?17? 17:29
???: '[hidden email]'
??: about maxMessagesPerSessions parameter


I have used ActiveMQ+Jencks+JmsTemplate to build a jms program. Next snippet
is the config xml file.
But when I use the default maxMessagesPerSessions value.
It can only process a little message and hang. And it can work for a long
time when I set it to 10000. What's the mean of maxMessagesPerSessions
parameter.
  <!-- definition of JCA Connector -->
  <bean id="jencks" class="org.jencks.JCAContainer">

    <!-- lets use the default configuration of work manager and transaction
manager-->
    <property name="bootstrapContext">
      <bean class="org.jencks.factory.BootstrapContextFactoryBean">
        <property name="threadPoolSize" value="200"/>
      </bean>
    </property>

    <!-- the JCA Resource Adapter -->
    <property name="resourceAdapter">
      <bean id="activeMQResourceAdapter"
class="org.activemq.ra.ActiveMQResourceAdapter">
        <property name="serverUrl" value="tcp://localhost:61616"/>
      </bean>
    </property>
  </bean>
...
  <!-- Spring JMS Template -->
  <bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate">
    <property name="connectionFactory">

      <!-- use the same JMS Session to publish on -->
      <bean class="org.activemq.ra.jms.ConnectionProxyFactory"/>
    </property>
    <property name="explicitQosEnabled" value="true"/>
    <property name="timeToLive" value="10000"/>
  </bean>
...
  <bean id="getInfoStage" class="org.jencks.JCAConnector">
    <property name="jcaContainer" ref="jencks" />
    <property name="activationSpec">
      <bean class="org.activemq.ra.ActiveMQActivationSpec">
        <property name="destination" value="task.getInfo"/>
        <property name="destinationType" value="javax.jms.Queue"/>
  <property name="maxSessions" value="100"/>
  <property name="maxMessagesPerSessions" value="10000"/>
      </bean>
    </property>
    <property name="ref" value="getInfoTask" />
  </bean>

  <bean id="getInfoTask" class="..." singleton="true">
        <property name="temp" ref="jmsTemplate"
  </bean>