Results 1 to 8 of 8

Thread: Issue with JMS Inbound Gateway, Recieving response only first time-not for second

  1. #1
    Join Date
    Nov 2008
    Posts
    20

    Default Issue with JMS Inbound Gateway, Recieving response only first time-not for second

    Hi,

    I am using JMS Inbound gateways todo synchronous way of communication.
    I am using TIBCO.
    Issue is "I am getting response for first request but not for second request to the same code.".

    Here is my configuration.

    HTML Code:
      <bean id="senderQueue" class="com.tibco.tibjms.TibjmsQueue">
            <constructor-arg value="jms/tibcoCorporateQueue"/>
        </bean>
    
        <bean id="recieverQueue" class="com.tibco.tibjms.TibjmsQueue">
            <constructor-arg value="jms/tibcoCorporateResponseQueue"/>
        </bean>
    
     <integration:gateway id="dynamicQueryMessageGateway"
                             default-request-channel="senderChannel"
                             service-interface="com.IDynamicQueryMessageGateway"/>
    
         <integration:gateway id="dynamicQueryReplyGateway"
                             default-reply-channel="marshaledRecieverChannel"
                             service-interface="com.IDynamicQueryReplyGateway"/>
    
     <channel id="senderChannel"/>
        <channel id="recieverChannel"/>
        <channel id="marshaledRecieverChannel">
            <queue capacity="10"/>
        </channel>
    
        <jms:outbound-channel-adapter id="jmsMessageOut"
                                      channel="senderChannel"
                                      jms-template="jmsOutboundTemplate"
                />
    
        <jms:inbound-gateway request-channel="recieverChannel" request-destination="recieverQueue"/>
    
        <si-xml:unmarshalling-transformer id="defaultUnmarshaller"
                                          input-channel="recieverChannel"
                                          output-channel="marshaledRecieverChannel"
                                          unmarshaller="jaxbMarshaller"/>
    Here is my Java code

    HTML Code:
    @Service("dynamicQueryMessageGatewayService")
    public interface IDynamicQueryMessageGateway {
    
        @Gateway(requestChannel = "senderChannel")
        public void sendMessage(String query);
    }
    
    @Service("dynamicQueryMessageReturnGatewayService")
    public interface IDynamicQueryReplyGateway {
    
        @Gateway(replyChannel = "marshaledRecieverChannel", replyTimeout = 5000)
        public DynamicQueryResults recieveMessage();
    
    }
    
    public DynamicQueryResults invokeDynamicQueryMessaging(String query) {
    
            try {
                dynamicQueryMessageGateway.sendMessage(query);
                return dynamicQueryReplyGateway.recieveMessage();
    
            } catch(Exception e) {
                e.printStackTrace();
            }
            return null;
        }
    
    public static void main(String[] args) {
    
            try {
                dynQueryLogger.info("Starting Dynamic Query Messaging process...");
                ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
                
                DynamicQueryMessagingComponent messagingComponent =
                        (DynamicQueryMessagingComponent) context.getBean("dynamicQueryMessagingComponent");
    [B]
                DynamicQueryResults results = messagingComponent.invokeDynamicQueryMessaging("select * from parameter");[/B]           
    
    dynQueryLogger.info("Results " + results.toString());
               [B] results = messagingComponent.invokeDynamicQueryMessaging("select * from topping");[/B]            
    
    dynQueryLogger.info("Results " + results.toString());
    
                System.exit(1);
    
            } catch (Exception ex) {
                dynQueryLogger.error(ex.toString(), ex.fillInStackTrace());
                ex.printStackTrace();
                System.exit(0);
            }
    
        }
    If I just have one call to invokeDynamicQueryMessaging() then it works fine, and getting reply, if I have 2 requsts one after other, the second request never gets response back, after configuring timeout of 5s on gateway, its waiting for 5 secs and coming back the with no response.

    I have seen the same kind of post here but looks like it is not solved.

    Any help would be appreceiated.
    Last edited by arcsri; Nov 18th, 2010 at 03:50 PM.

  2. #2
    Join Date
    Jan 2008
    Location
    Mohnton, PA USA (that's near Philadelphia)
    Posts
    2,148

    Default

    what version of SI r u using?

  3. #3
    Join Date
    Nov 2008
    Posts
    20

    Default SI Version

    I am using Spring Integration - 1.0.3

  4. #4
    Join Date
    Jan 2008
    Location
    Mohnton, PA USA (that's near Philadelphia)
    Posts
    2,148

    Default

    Can you switch to 2.0.0.RC1? The GA is only 1.5 weeks away.
    There were issue with preserving reply-channel header when communicating remotely (e.g., JMS, WS etc.) can't remember what it was but I know it was fixed for 2.0 longtime ago.
    Let me know

  5. #5
    Join Date
    Oct 2005
    Location
    Boston, MA
    Posts
    2,840

    Default

    Actually, I believe it was this issue:
    https://jira.springsource.org/browse/INT-906

    In that case, it would be nice to know that your problem is resolved if you upgrade to 1.0.4.RELEASE. That is the latest stable version, and even if you stay on 1.0.x for now, I would highly recommend upgrading.

  6. #6
    Join Date
    Nov 2008
    Posts
    20

    Default Worked with Spring Version changed

    I changed 1.0.3 to 2.0RC1, I am got the below exceptions:

    java.lang.NoClassDefFoundError: org/springframework/expression/BeanResolver

    then I upgraded the Spring version to 3.0.3 , then I got the below exception.

    java.lang.NoClassDefFoundError: org/springframework/context/expression/BeanFactoryResolver

    then I upgraded to the 3.0.4.RELEASE, then it worked.

    Included Jars from Spring - Integration 2.0RC1 are -

    spring-integration-core-2.0.0.RC1.jar
    spring-integration-event-2.0.0.RC1.jar
    spring-integration-jms-2.0.0.RC1.jar
    spring-integration-stream-2.0.0.RC1.jar
    spring-integration-xml-2.0.0.RC1.jar

    Thanks much for your help.
    sri

  7. #7
    Join Date
    Oct 2005
    Location
    Boston, MA
    Posts
    2,840

    Default

    Spring Integration 2.0 RC1 requires Spring 3.0.5.

  8. #8
    Join Date
    Nov 2008
    Posts
    20

    Default Thanks much.

    Thank You so much for quick replies.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •