Announcement Announcement Module
Collapse
No announcement yet.
how to add a prefetch limit to a JMS listener container? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • how to add a prefetch limit to a JMS listener container?

    Hi,

    I have a working bean configuration as given below. I changed the bean definition according to the http://www.springframework.org/schem...ng-jms-2.5.xsd so that I can add a prefetch limit to my listenerContainer. See the converted bean definition. There are no errors when the server startup but the effect I am getting is as the bean is not defined. Am I missing something here?

    Thanks in advance for any help that you can provide.

    Amila.

    <!-- WORKING CODE SAMPLE -->
    <bean id="stockListener" class="org.springframework.jms.listener.adapter.Me ssageListenerAdapter">
    <property name="delegate" ref="stockService"/>
    <property name="defaultListenerMethod" value="getQuote"/>
    <property name="defaultResponseDestination" ref="stockResponseQueue"/>
    </bean>

    <bean id="listenerContainer" class="org.springframework.jms.listener.DefaultMes sageListenerContainer">
    <property name="concurrentConsumers" value="5"/>
    <property name="connectionFactory" ref="jmsFactory" />
    <property name="destination" ref="stockQueue" />
    <property name="messageListener" ref="stockListener" />
    </bean>
    <!--WORKING CODE SAMPLE END -->

    <!--CONVERTED TO 2.5 SO THAT A prefetchSize CAN BE ADDED -->

    <bean id="stockListener" class="org.springframework.jms.listener.adapter.Me ssageListenerAdapter">
    <property name="delegate" ref="stockService"/>
    <property name="defaultListenerMethod" value="getQuote"/>
    <property name="defaultResponseDestination" ref="stockResponseQueue"/>
    </bean>
    <jms:listener-container connection-factory="jmsFactory"
    concurrency="5" prefetch="2">
    <jms:listener destination="stockQueue" ref="stockListener"/>
    </jms:listener-container>
    <!-- CONVERTED END -->
Working...
X