Results 1 to 3 of 3

Thread: file outbound-channel-adapter write payload only?

  1. #1
    Join Date
    Nov 2008
    Posts
    23

    Default file outbound-channel-adapter write payload only?

    Hello All,

    I have a file outbound channel adapter configured as below and am finding that the files generated have the complete message written to them including the header, e.g.

    Code:
    [Payload=Sat May 05 21:19:30 MDT 2012][Headers={timestamp=1353739161022, id=d677224a-6bca-4849-bdaa-be6d48891609, file_name=input/sample.fnv}]
    Given that the inbound messages are typed as Message<String> how can I configure such that only the payload is written? I've seen examples, for instance the STS template project, which seem to accomplish this w/o any apparent difference that what I'm attempting. In that case the channel-adapter is connected to a header-value-router, but the message type should be the same.

    Thanks for any help!

    --john

    Code:
    <int-file:outbound-channel-adapter
    		id="multibeamFilesOut" directory="file:target/output/multibeam"
    		delete-source-files="false" channel="channel4"/>
    		 
    <int:channel id="channel1">

  2. #2
    Join Date
    Mar 2010
    Location
    Gtr Philadelphia, PA
    Posts
    2,037

    Default

    It looks like something upstream of the adapter is doing this conversion (message.toString()); the adapter can only handle File, byte[] and String payloads; otherwise it throws an exception. The adapter never writes a String representation of the message it receives.

    I suggest you run with DEBUG logging and you will see the message as it progresses through your flow.
    Gary P. Russell
    Spring Integration Team
    SpringSource, a division of VMware

  3. #3
    Join Date
    Nov 2008
    Posts
    23

    Default

    Thanks Gary, that's just what I was looking for!

    --john

Posting Permissions

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