Announcement Announcement Module
Collapse
No announcement yet.
Reply Channel Cannot be Resolved Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Reply Channel Cannot be Resolved

    I haven't seen this specifically brought up, so here goes:

    I'm using a custom splitter to create 9 copies of a message (modified), then I'm trying to specify the reply channel in code. But I'm getting an error:

    Code:
    Mar 21 14:34:20 [task-scheduler-4] ERROR LoggingHandler handleMessageInternal     org.springframework.integration.support.channel.ChannelResolutionException: no output-channel or replyChannel header available
    What's strange is the handler reports this:

    Code:
    Mar 21 14:34:20 [task-scheduler-4] DEBUG AbstractReplyProducingMessageHandler sendReplyMessage          handler 'ShipperOutbound858Handler' sending reply Message: [Payload=/spotbid/kibo_dev/app/gfmEdi/work/out858r/usb/bu/T2004UDF.T*N_TECOOP-858][Headers={timestamp=1363890860685, id=acca3b78-35a2-4e71-8fba-180f7d206d69, history=pull.gfmhost.out858r.shipper.udf,out858rUdfShipperIn,out858rUdfShipperInBackup,UsbOutbound858HandlerSA, correlationId=f1323492-6ad6-4f18-8338-051522af4635, replyChannel=out858rUdfOutTECOOP, sequenceSize=9, file_originalFile=/spotbid/kibo_dev/app/gfmEdi/work/out858r/shipper/udf/T2004UDF.T*N, sequenceNumber=1}]
    As you can see, the header is there (replyChannel=out858rUdfOutTECOOP). Here is my Java that builds the message and adds it to a list (they are all similar). The copyAndAddElement0005 simply returns a modified copy of the original file:
    Code:
    messages.add(MessageBuilder.withPayload(
    	Outbound858Util.copyAndAddElement0005_06(
    		EdiConstants.OUT_858_0005_06_SHIPPER[0], originalFile)).setHeaderIfAbsent(
    			MessageHeaders.REPLY_CHANNEL, "out858rUdfOutTECOOP").build());
    Here is the relevant XML:
    Code:
    	<sprint:channel id="out858rUdfOutP3I">
    		<sprint:interceptors><sprint:wire-tap channel="outLogger"/></sprint:interceptors>
    	</sprint:channel>
    
    	<bean id="ShipperOutbound858Handler" class="gfm.edi.outbound858.ShipperOutbound858Handler"/>
    	<sprint:splitter id="UsbOutbound858HandlerSA" auto-startup="true"
    		 	ref="ShipperOutbound858Handler"
    			input-channel="out858rUdfShipperInBackup"/>
    			<!-- No reply channel needed: messages have REPLY_CHANNEL set in their headers -->
    
    	<sftp:outbound-channel-adapter id="eft.out858.shipper.tecoop.udf"
    		session-factory="eft_out858_SftpSessionFactory"
    		cache-sessions="false"
    		remote-file-separator="${eft.file.sep}"
    		channel="out858rUdfOutTECOOP"
    		remote-directory="${push.eft.out858r.udf.dir}"/>
    Any ideas? Can I not set the reply channel as a String? Any help is appreciated.

  • #2
    You need a reference to the channel, not just its name; you can resolve a channel name with a channel resolver...

    Code:
    BeanFactoryChannelResolver resolver = new BeanFactoryChannelResolver(applicationContext);
    MessageChannel replyChannel = resolver.resolveChannelName("out858rUdfOutTECOOP");
    You can just define the channel resolver as a bean and inject it; and it will automatically get a reference to the context.

    Comment


    • #3
      Thanks Gary, I figured it was something in this vein.

      Comment

      Working...
      X