Announcement Announcement Module
Collapse
No announcement yet.
Timeout exception with JMS outbound-gateway Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Timeout exception with JMS outbound-gateway

    I am getting a time out error when I try the jms sample config files for outbound-gateway. The channel adapters work fine.

    Here is my config:
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
    	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    	xmlns:si="http://www.springframework.org/schema/integration"
        xmlns:stream="http://www.springframework.org/schema/integration/stream"
        xmlns:jms="http://www.springframework.org/schema/integration/jms"
        xmlns:amq="http://activemq.apache.org/schema/core"
        xmlns:context="http://www.springframework.org/schema/context"
    	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
    	    http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration-1.0.xsd
            http://www.springframework.org/schema/integration/stream http://www.springframework.org/schema/integration/stream/spring-integration-stream-1.0.xsd
    		http://www.springframework.org/schema/integration/jms http://www.springframework.org/schema/integration/jms/spring-integration-jms-1.0.xsd
    		http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd
    		http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd">        
            
     	<bean id="connectionFactory" class="org.springframework.jms.connection.CachingConnectionFactory">
     		<property name="targetConnectionFactory">
     			<bean class="org.apache.activemq.ActiveMQConnectionFactory">
      				<property name="brokerURL" value="vm://localhost" /> 
      			</bean>
      		</property>
      		<property name="sessionCacheSize" value="10" /> 
      		<property name="cacheProducers" value="false" /> 
      	</bean>
      	
     	<bean id="requestQueue" class="org.apache.activemq.command.ActiveMQQueue">
      		<constructor-arg value="queue.demo" /> 
      	</bean>
     	<bean id="replyQueue" class="org.apache.activemq.command.ActiveMQQueue">
      		<constructor-arg value="queue.reply" /> 
      	</bean>
      	
      	<si:poller id="poller" default="true">
      		<si:interval-trigger interval="1000" /> 
      	</si:poller>
      	
    	<si:publish-subscribe-channel id="dataInputChannel"/>        
     	<si:gateway service-interface="com.lmco.jmsexample.Gateway" id="theGateway" default-request-channel="dataInputChannel"/>
        <bean class="com.lmco.jmsexample.Dispatcher">
            <property name="gateway" ref="theGateway"/>
        </bean>
            
    
    	<jms:outbound-gateway request-channel="dataInputChannel"
    						  request-destination="requestQueue"
    						  reply-channel="jmsReplyToStdoutChannel"/>
    						  
    	<si:channel id="jmsReplyToStdoutChannel"/>
    							  
    	<stream:stdout-channel-adapter channel="jmsReplyToStdoutChannel" append-newline="true"/>
    </beans>
    Here is the exception I am getting:
    org.springframework.beans.MethodInvocationExceptio n: Property 'gateway' threw exception; nested exception is org.springframework.integration.message.MessageTim eoutException: failed to receive JMS response within timeout of: 5000ms

    Any ideas on what is wrong with the config?

    Thanks much.

  • #2
    Based on the error message, it looks like you're not getting a response back. What do you have on the receiving end? Can you confirm that it's sending a reply to the proper JMS destination?

    Comment


    • #3
      I using the inbound-gateway example config:
      Code:
      	<context:component-scan base-package="org.springframework.integration.samples.jms"/>						  
      
      	<jms:inbound-gateway id="jmsin"
      	                     request-destination="requestQueue"
      	                     request-channel="demoChannel"/>
      
      	<si:channel id="demoChannel"/>
      
      	<si:service-activator input-channel="demoChannel" ref="demoBean"/>
      	
      	<stream:stdout-channel-adapter channel="demoChannel" append-newline="true"/>
      I have one config file that has the contents of common.xml, outbound-gateway.xml and inbound-gateway.xml.

      Thank you.

      Comment


      • #4
        Maybe you could replace the 'demoBean' with your own and add some logging there?

        Comment


        • #5
          Mark,

          Thanks much for your quick replies. I created a ReplyBean as follows adding an init method to ensure that the bean was being created. While the print statement in the init method prints, the statements from the upperCase method don't. I put a break point on the first line in the upperCase method and the debugger doesn't break there - so it is not getting to this method.

          Code:
          @MessageEndpoint
          public class ReplyBean {
          	
          	   public void init() {
          		   System.out.println("Initialize ReplyBean");
          	   }
          
          		@ServiceActivator
          		public String upperCase(String input) {
          			String replyString;
          			System.out.println("ReplyBean: Received input "+input);
          			replyString=input.toUpperCase();
          			System.out.println("Returning with "+replyString);
          			return replyString;
          		}
          
          }
          I am using spring Integration 1.0.1.

          Comment

          Working...
          X