Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: GatewayProxyFactoryBean default-reply-channel not resolved

  1. #1
    Join Date
    Mar 2006
    Posts
    119

    Default GatewayProxyFactoryBean default-reply-channel not resolved

    I am trying to wire up a gateway.

    I have the following working:

    Code:
     jmsGateway(org.springframework.integration.gateway.SimpleMessagingGateway) {
        requestChannel = ref("routerChannel")
        replyChannel = ref("ShippingCostChannel")
        replyTimeout = "10000" 
      }
    (NB: this is with Grails' "Spring Beans DSL")

    I am interacting with this in a Grails controller as follows:

    Code:
      def send = {
    		def msg = params.content
        jmsGateway.send(msg)
        println "Sending '$msg'"
        def got = jmsGateway.receive()
    		//def got = '???'
        println "RECEIVED: '$got'"
        flash.message = got
        }
    If I try to use a gateway using GatewayProxyFactoryBean, I get errors.


    Code:
        gateway(id: "lookupService",
                "service-interface": "au.com.transentia.si.LookupService",
                "default-request-channel": "routerChannel",
                "default-reply-channel": "ShippingCostChannel",
                "default-reply-timeout": "10000")
    In the new controller:

    Code:
    	def send = {
    	  def msg = params.content
    	  flash.message = lookupService.lookup(msg)
    	}
    LookupService is:

    Code:
    package au.com.transentia.si
    
    public interface LookupService {
      String lookup(String who)
    }
    Here is a debug trace for the relevant part of the execution:

    Code:
    2009-04-10 11:10:45,511 [task-scheduler-3] DEBUG channel.QueueChannel  - preSend
     on channel 'ShippingCostChannel', message: [Payload=<?xml version="1.0" encodin
    g="UTF-8"?><ns1:calculateShippingCostResponse xmlns:ns1="http://DefaultNamespace
    "><ns1:return>0.0</ns1:return></ns1:calculateShippingCostResponse>][Headers={spr
    ingintegration_jms_messageId=ID:TRIFFID-49578-1239324670371-0:0:2:1:2, springint
    egration_timestamp=1239325845406, springintegration_id=0d7c3d9a-a3a7-4516-9841-6
    951d3779bf5, springintegration_jms_redelivered=false}]
    2009-04-10 11:10:45,511 [task-scheduler-3] DEBUG channel.QueueChannel  - postSen
    d (sent=true) on channel 'ShippingCostChannel', message: [Payload=<?xml version=
    "1.0" encoding="UTF-8"?><ns1:calculateShippingCostResponse xmlns:ns1="http://Def
    aultNamespace"><ns1:return>0.0</ns1:return></ns1:calculateShippingCostResponse>]
    [Headers={springintegration_jms_messageId=ID:TRIFFID-49578-1239324670371-0:0:2:1
    :2, springintegration_timestamp=1239325845406, springintegration_id=0d7c3d9a-a3a
    7-4516-9841-6951d3779bf5, springintegration_jms_redelivered=false}]
    2009-04-10 11:10:45,511 [task-scheduler-4] DEBUG channel.QueueChannel  - postRec
    eive on channel 'ShippingCostChannel', message: [Payload=<?xml version="1.0" enc
    oding="UTF-8"?><ns1:calculateShippingCostResponse xmlns:ns1="http://DefaultNames
    pace"><ns1:return>0.0</ns1:return></ns1:calculateShippingCostResponse>][Headers=
    {springintegration_jms_messageId=ID:TRIFFID-49578-1239324670371-0:0:2:1:2, sprin
    gintegration_timestamp=1239325845406, springintegration_id=0d7c3d9a-a3a7-4516-98
    41-6951d3779bf5, springintegration_jms_redelivered=false}]
    2009-04-10 11:10:45,514 [task-scheduler-4] DEBUG gateway.AbstractMessagingGatewa
    y$1  - org.springframework.integration.gateway.AbstractMessagingGateway$1@cead6
    received message: [Payload=<?xml version="1.0" encoding="UTF-8"?><ns1:calculateS
    hippingCostResponse xmlns:ns1="http://DefaultNamespace"><ns1:return>0.0</ns1:ret
    urn></ns1:calculateShippingCostResponse>][Headers={springintegration_jms_message
    Id=ID:TRIFFID-49578-1239324670371-0:0:2:1:2, springintegration_timestamp=1239325
    845406, springintegration_id=0d7c3d9a-a3a7-4516-9841-6951d3779bf5, springintegra
    tion_jms_redelivered=false}]
    2009-04-10 11:10:45,515 [task-scheduler-4] DEBUG channel.PublishSubscribeChannel
      - preSend on channel 'errorChannel', message: [Payload=org.springframework.int
    egration.channel.ChannelResolutionException: unable to resolve reply channel for
     message: [Payload=<?xml version="1.0" encoding="UTF-8"?><ns1:calculateShippingC
    ostResponse xmlns:ns1="http://DefaultNamespace"><ns1:return>0.0</ns1:return></ns
    1:calculateShippingCostResponse>][Headers={springintegration_jms_messageId=ID:TR
    IFFID-49578-1239324670371-0:0:2:1:2, springintegration_timestamp=1239325845406,
    springintegration_id=0d7c3d9a-a3a7-4516-9841-6951d3779bf5, springintegration_jms
    _redelivered=false}]][Headers={springintegration_timestamp=1239325845515, spring
    integration_id=68f36a77-69cc-41fa-9bae-58c2e941ab1a}]
    org.springframework.integration.channel.ChannelResolutionException: unable to re
    solve reply channel for message: [Payload=<?xml version="1.0" encoding="UTF-8"?>
    <ns1:calculateShippingCostResponse xmlns:ns1="http://DefaultNamespace"><ns1:retu
    rn>0.0</ns1:return></ns1:calculateShippingCostResponse>][Headers={springintegrat
    ion_jms_messageId=ID:TRIFFID-49578-1239324670371-0:0:2:1:2, springintegration_ti
    mestamp=1239325845406, springintegration_id=0d7c3d9a-a3a7-4516-9841-6951d3779bf5
    , springintegration_jms_redelivered=false}]
            at org.springframework.integration.handler.AbstractReplyProducingMessage
    Handler.resolveReplyChannel(AbstractReplyProducingMessageHandler.java:142)
            at org.springframework.integration.handler.AbstractReplyProducingMessage
    Handler.handleMessageInternal(AbstractReplyProducingMessageHandler.java:102)
    ...
    It seems that postSend on the 'ShippingCostChannel' is not resolving correctly in this case...but it DOES if I use the SimpleMessagingGateway "by hand"...

    Any suggestions/thoughts?

    Cheers,

    Alph

  2. #2
    Join Date
    Mar 2006
    Posts
    119

    Default

    If I use SimpleMessagingGateway as follows:

    Code:
      def send = {
        def msg = params.content
        flash.message = jmsGateway.sendAndReceive(msg)
        }
    I also get an error:

    Code:
    2009-04-10 11:35:57,208 [task-scheduler-2] DEBUG channel.QueueChannel  - preSend on channel 'ShippingCostChannel', message: [Payload=<?xml version="1.0" encoding="UTF-8"?><ns1:calculateShippingCostRes
    ponse xmlns:ns1="http://DefaultNamespace"><ns1:return>0.0</ns1:return></ns1:calculateShippingCostResponse>][Headers={springintegration_jms_messageId=ID:TRIFFID-49578-1239324670371-0:0:2:1:3, springint
    egration_timestamp=1239327355861, springintegration_id=e5d6fa28-6c34-41d1-93a3-822417317af4, springintegration_jms_redelivered=false}]
    2009-04-10 11:35:57,229 [task-scheduler-2] DEBUG channel.QueueChannel  - postSend (sent=true) on channel 'ShippingCostChannel', message: [Payload=<?xml version="1.0" encoding="UTF-8"?><ns1:calculateSh
    ippingCostResponse xmlns:ns1="http://DefaultNamespace"><ns1:return>0.0</ns1:return></ns1:calculateShippingCostResponse>][Headers={springintegration_jms_messageId=ID:TRIFFID-49578-1239324670371-0:0:2:1
    :3, springintegration_timestamp=1239327355861, springintegration_id=e5d6fa28-6c34-41d1-93a3-822417317af4, springintegration_jms_redelivered=false}]
    2009-04-10 11:35:57,229 [task-scheduler-4] DEBUG channel.QueueChannel  - postReceive on channel 'ShippingCostChannel', message: [Payload=<?xml version="1.0" encoding="UTF-8"?><ns1:calculateShippingCos
    tResponse xmlns:ns1="http://DefaultNamespace"><ns1:return>0.0</ns1:return></ns1:calculateShippingCostResponse>][Headers={springintegration_jms_messageId=ID:TRIFFID-49578-1239324670371-0:0:2:1:3, sprin
    gintegration_timestamp=1239327355861, springintegration_id=e5d6fa28-6c34-41d1-93a3-822417317af4, springintegration_jms_redelivered=false}]
    2009-04-10 11:35:57,277 [task-scheduler-4] DEBUG gateway.AbstractMessagingGateway$1  - org.springframework.integration.gateway.AbstractMessagingGateway$1@c3e952 received message: [Payload=<?xml versio
    n="1.0" encoding="UTF-8"?><ns1:calculateShippingCostResponse xmlns:ns1="http://DefaultNamespace"><ns1:return>0.0</ns1:return></ns1:calculateShippingCostResponse>][Headers={springintegration_jms_messag
    eId=ID:TRIFFID-49578-1239324670371-0:0:2:1:3, springintegration_timestamp=1239327355861, springintegration_id=e5d6fa28-6c34-41d1-93a3-822417317af4, springintegration_jms_redelivered=false}]
    2009-04-10 11:35:57,304 [task-scheduler-4] DEBUG channel.PublishSubscribeChannel  - preSend on channel 'errorChannel', message: [Payload=org.springframework.integration.channel.ChannelResolutionExcept
    ion: unable to resolve reply channel for message: [Payload=<?xml version="1.0" encoding="UTF-8"?><ns1:calculateShippingCostResponse xmlns:ns1="http://DefaultNamespace"><ns1:return>0.0</ns1:return></ns
    1:calculateShippingCostResponse>][Headers={springintegration_jms_messageId=ID:TRIFFID-49578-1239324670371-0:0:2:1:3, springintegration_timestamp=1239327355861, springintegration_id=e5d6fa28-6c34-41d1-
    93a3-822417317af4, springintegration_jms_redelivered=false}]][Headers={springintegration_timestamp=1239327357304, springintegration_id=4005416b-765c-4adc-81c8-4e6dced3e9de}]
    org.springframework.integration.channel.ChannelResolutionException: unable to resolve reply channel for message: [Payload=<?xml version="1.0" encoding="UTF-8"?><ns1:calculateShippingCostResponse xmlns
    :ns1="http://DefaultNamespace"><ns1:return>0.0</ns1:return></ns1:calculateShippingCostResponse>][Headers={springintegration_jms_messageId=ID:TRIFFID-49578-1239324670371-0:0:2:1:3, springintegration_ti
    mestamp=1239327355861, springintegration_id=e5d6fa28-6c34-41d1-93a3-822417317af4, springintegration_jms_redelivered=false}]
            at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.resolveReplyChannel(AbstractReplyProducingMessageHandler.java:142)
            at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.handleMessageInternal(AbstractReplyProducingMessageHandler.java:102)
            at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:48)
            at org.springframework.integration.endpoint.PollingConsumer.doPoll(PollingConsumer.java:59)
            at org.springframework.integration.endpoint.AbstractPollingEndpoint$Poller.innerPoll(AbstractPollingEndpoint.java:232)
            at org.springframework.integration.endpoint.AbstractPollingEndpoint$Poller.poll(AbstractPollingEndpoint.java:216)
            at org.springframework.integration.endpoint.AbstractPollingEndpoint$Poller.run(AbstractPollingEndpoint.java:209)
            at org.springframework.integration.scheduling.SimpleTaskScheduler$ErrorHandlingRunnableWrapper.run(SimpleTaskScheduler.java:307)
            at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
            at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
            at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
            at org.springframework.integration.scheduling.SimpleTaskScheduler$TriggeredTask.run(SimpleTaskScheduler.java:256)
            at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
            at java.lang.Thread.run(Thread.java:619)
    
    2009-04-10 11:35:57,482 [task-scheduler-4] DEBUG handler.LoggingHandler  - org.springframework.integration.handler.LoggingHandler@ad3fd4 received message: [Payload=org.springframework.integration.chan
    nel.ChannelResolutionException: unable to resolve reply channel for message: [Payload=<?xml version="1.0" encoding="UTF-8"?><ns1:calculateShippingCostResponse xmlns:ns1="http://DefaultNamespace"><ns1:
    return>0.0</ns1:return></ns1:calculateShippingCostResponse>][Headers={springintegration_jms_messageId=ID:TRIFFID-49578-1239324670371-0:0:2:1:3, springintegration_timestamp=1239327355861, springintegra
    tion_id=e5d6fa28-6c34-41d1-93a3-822417317af4, springintegration_jms_redelivered=false}]][Headers={springintegration_timestamp=1239327357304, springintegration_id=4005416b-765c-4adc-81c8-4e6dced3e9de}]
    This rather implies that I have forgotten some configuration...

    Again, suggestions gratefuly received.

    Alph

  3. #3
    Join Date
    Mar 2006
    Posts
    119

    Default Forgot the details...

    This is with Spring Integration 1.0.2
    Grails 1.1/Groovy 1.6.1
    Active MQ 5.2
    Java 1.6.0_12
    Vista SP1

  4. #4
    Join Date
    Mar 2006
    Posts
    119

    Default

    Ping!

    Nobody seen this behaviour before? It is quite reproduceable...

    Alph

  5. #5
    Join Date
    May 2007
    Location
    Netherlands
    Posts
    614

    Default

    I haven't looked into this yet, but it's somewhere on my todo list. Don't hold your breath, but rest assured you are not being ignored.

  6. #6
    Join Date
    Mar 2006
    Posts
    119

    Default

    Thanks for taking the time to get back to me!

    I wasn't worried about being ignored...I realise (and appreciate) that you guys are out there working hard...

    I WAS worried about having done something stupid ;-)

    Cheers,

    Alph

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

    Default

    Does the interface that you are implementing via this gateway proxy have a 'replyChannel' attribute within a @Gateway annotation?

  8. #8
    Join Date
    Mar 2006
    Posts
    119

    Default

    No. The interface is purely configured via XML, as shown in my first post.

    My understanding is that @Gateway is optional(?)

    I'll try to add @Gateway and see if any change.

    Cheers,

    Alph

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

    Default

    Sorry. My reply was a bit brief. The @Gateway annotation is optional on the interface. I was just wondering if perhaps you had that - thereby triggering the channel resolution based on a replyChannel there that overrides the default.

    If you are using the defaultReplyChannel only and seeing that error, then I think it must be a bug.

  10. #10
    Join Date
    Mar 2006
    Posts
    119

    Default

    Ah.

    Any workaround come to mind (other than what I have done)?

    Is there anything that I could do to help you confirm what is going on?

    Cheers,

    Alph

Posting Permissions

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