Announcement Announcement Module
Collapse
No announcement yet.
Sending a message to a channel from file channel outbound adapter Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    Are you looking for an outbound-gateway given here
    http://static.springsource.org/sprin.../#file-writing

    Comment


    • #3
      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

      Comment


      • #4
        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 ?

        Comment


        • #5
          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

          Comment


          • #6
            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

            Comment

            Working...
            X