I am trying to read a message from a JMS Queue (using ActiveMQ). Issue I am facing is, messages are being read from the queue, but not getting displayed in the "service-activator".

Any help is much appreciated.

My code is as below:

(1) Spring Configuration

```
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:int-jms="http://www.springframework.org/schema/integration/jms"
xmlns:jms="http://www.springframework.org/schema/jms"
xmlns:int="http://www.springframework.org/schema/integration"
xsi:schemaLocation="http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
    http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
    http://www.springframework.org/schema/jms http://www.springframework.org/schema/jms/spring-jms.xsd
    http://www.springframework.org/schema/integration/jms http://www.springframework.org/schema/integration/jms/spring-integration-jms.xsd
    http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
    http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">

<!-- Component scan to find all Spring components -->
<context:component-scan base-package="com.poc.springinteg._3" />

<!--  -->
<bean id="remoteJndiTemplate" class="org.springframework.jndi.JndiTemplate" lazy-init="false"> 
    <property name="environment"> 
        <props> 
            <prop key="java.naming.provider.url">tcp://localhost:61616</prop>
            <prop key="java.naming.factory.url.pkgs">org.apache.activemq.jndi</prop>
            <prop key="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialContextFactory</prop>
            <prop key="connectionFactoryNames">DefaultActiveMQConnectionFactory,QueueConnectionFactory</prop>
            <prop key="queue.SendReceiveQueue">org.apache.geronimo.configs/activemq-ra/JCAAdminObject/SendReceiveQueue</prop>
            <prop key="queue.SendQueue">org.apache.geronimo.configs/activemq-ra/JCAAdminObject/MDBTransferBeanOutQueue</prop> 
        </props> 
    </property> 
</bean> 

<bean id="remoteConnectionFactory" class="org.springframework.jndi.JndiObjectFactoryBean" lazy-init="false">
    <property name="jndiTemplate" ref="remoteJndiTemplate"/>
    <property name="jndiName" value="QueueConnectionFactory"/>
    <property name="lookupOnStartup" value="true" />
    <property name="proxyInterface" value="javax.jms.ConnectionFactory" />
</bean>

<!-- Reading Queue -->
<bean id="inputQueue" class="org.apache.activemq.command.ActiveMQQueue">
    <constructor-arg index="0">
        <value>InputQueue_3</value>
    </constructor-arg> 
</bean>

<bean id="messageListenerContainer" class="org.springframework.jms.listener.DefaultMessageListenerContainer">
    <property name="connectionFactory" ref="remoteConnectionFactory"/>
    <property name="destination" ref="inputQueue"/>
    <property name="sessionTransacted" value="true"/>
    <property name="maxConcurrentConsumers" value="1"/>
    <property name="concurrentConsumers" value="1"/>
    <property name="autoStartup" value="true"/>         
</bean>

<int:channel id="inbound"/>

<int-jms:message-driven-channel-adapter id="jmsIn" 
                                        channel="inbound"
                                        container="messageListenerContainer" />

<int:service-activator  input-channel="inbound"
                        ref="messageHandler"
                        method="onMessage"/>

<bean id="messageHandler" class="com.poc.springinteg._3.HelloServiceImpl"/>

</beans>

```

(2) Service Activator MDP:

```
package com.poc.springinteg._3;
import javax.jms.Message;
public class HelloServiceImpl
{

public String onMessage(Message name) {
    System.out.println( "getHelloMessage:, " + name );

    return  "getHelloMessage:, " + name ;
}
}

```

(3) Application start class:

```
import org.springframework.context.support.ClassPathXmlApplicationContext;
public class App {

 public static void main( String[] args )
    {
        ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext("classpath:3_applicationContext.xml" );

        applicationContext.registerShutdownHook();
    }
}

```

Thanks