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

  • Using JmsMessageDrivenSourceAdapter

    I have been trying to use the JmsMessageDrivenSourceAdapter. By my understanding of the documentation, it should create a container listener over a queue and allow for multiple receivers to be passed the messages as they arrive. I have gotten this to work using Spring's standard SimpleMessageListenerContainer and MessageListenerAdapter and see the connection created to the queue manager. Although there are no critical errors when it is run, there are no connections to the queue manager. I have tried it with both WMQ Series and Active MQ with the same results. Here is the code.

    <message-bus dispatcher-pool-size="25" auto-create-channels="true" >
    <annotation-driven />
    <context:component-scan base-package="com.springinttest" />

    <channel id="inputChannel1" />

    <endpoint input-channel="inputChannel1" handler-ref="MyMdp"
    <concurrency core="5" max="25" />

    <beans:bean id="MySourceAdapter"
    class="org.springframework.integration.adapter.jms .JmsMessageDrivenSourceAdapter"
    lazy-init="false" init-method="initialize">
    <beansroperty name="connectionFactory"
    ref="connectionFactory" />
    <beansroperty name="destination" ref="destination" />
    <beansroperty name="channel" ref="inputChannel1" />

    <beans:bean id="connectionFactory"
    class="org.apache.activemq.ActiveMQConnectionFacto ry">
    <beansroperty name="brokerURL" value="tcp://localhost:61616" />

    <beans:bean id="destination"
    <beans:constructor-arg index="0" value="myQueue"/>

    <beans:bean id="MyMdp" class="com.springinttest.MyMdp" />



    package com.springinttest;

    import org.springframework.integration.annotation.Message Endpoint;
    import org.springframework.integration.annotation.Handler ;
    import org.apache.log4j.Logger;

    public class MyMdp {

    private static final Logger LOGGER = Logger.getLogger(MyMdp.class);

    public MyMdp() {
    LOGGER.warn("Constructor Set");
    public void processMessage(String message) {

    try {
    LOGGER.warn("Received message is: " + message.toString());
    } catch (Exception e) {
    System.out.println("Captain Chaos");
    // handle this-somehow

  • #2
    More information

    I found the issue, but this is still strange. I was building my project using Maven and deploying on Tomcat. The Maven Repositories that we use here,, for example only had the core jar file listed and only for m1. So I did not realize I was missing the adapters jar until yesterday. The funny thing is Spring loaded everything and did not complain that it could not find the JmsMessageDrivenSourceAdapter class. It just ran and issued no errors, which is what through me off. Does anyone know of a good Maven repository that has both jars for m2 that I should be using? Thanks


    • #3
      Thanks for pointing that out. I will look into the milestone repository and make sure that the M2 jars are available.

      Actually, the snapshot repository is up to date:

      The jars with a "ci" suffix are produced from our continuous integration build each night. For example, the "ci-57" jars correspond to nightly build 57:

      There you can even see what issues are included in each build, and links to Jira are provided as well.



      • #4
        The M2 jars are now available in the milestone repository as well: