Results 1 to 6 of 6

Thread: Sending a message to a channel from file channel outbound adapter

  1. #1

    Default Sending a message to a channel from file channel outbound adapter

    hi everyone,

    I have to send a message to channel from a file:outbound-channel-adapter .For example when a below adapter recieves a message i want to send a message to a channel to take the file that is created . I can do it by using a inbound channel adapter but then i have a specify a poller which keeps polling for the file and the poller never terminates .Can this be achieved by some way even if i use a inbound channel adapter can we terminate polling of the inbound adapter once it takes the file from the adapter


    Code:
    <file:outbound-channel-adapter channel="outputFileChannel"  directory="C:\Test\Import"></file:outbound-channel-adapter>

  2. #2
    Join Date
    Oct 2011
    Location
    Mumbai, India
    Posts
    213

    Default

    Are you looking for an outbound-gateway given here
    http://static.springsource.org/sprin.../#file-writing

  3. #3

    Default

    the outbound gateway does serve the purpose but it forwards the whole file to the reply channel which i dont want as the file size will be huge .is there anyway were i can send something else eq a string to the replychannel from file outbound gateway adapter

  4. #4
    Join Date
    Oct 2011
    Location
    Mumbai, India
    Posts
    213

    Default

    Have you tried it? What version of Spring integration are you using? I was under an impression it sends the java.io.File object.
    I ant try it out rt now, but will and get back. Meanwhile can you confirm if it send the complete payload ?

  5. #5

    Default

    yes it sends a java.io.File object .So it means that it will have the complete content of the file right or just a reference to the file .Please correct me if i am wrong

  6. #6
    Join Date
    Jan 2009
    Location
    Ukraine, Kharkov
    Posts
    737

    Default

    Hello
    the complete content of the file right or just a reference to the file
    Yes, it will be only reference. Please, read java.io.File sources. For getting content you can use e.g. FileInputStream.

    Artem Bilan

Posting Permissions

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