Camel
  1. Camel
  2. CAMEL-3397

Support in-out semantic for file and ftp component

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: 2.5.0
    • Fix Version/s: Future
    • Component/s: camel-core
    • Labels:
      None

      Description

      Currently we only support in-only for file: and ftp: endpoints, in the sense that the content of the message is written to a file and no output gets produced.

      It would be useful to support a scenario in which one could send an empty message to a file with a GET operation such that the content of the file is retrieved as an out instead of written to the file.

        Activity

        Hide
        Claus Ibsen added a comment -

        The producer has too much logic that are bound for writing files.
        The EIP is to use a consumer to read files.

        Show
        Claus Ibsen added a comment - The producer has too much logic that are bound for writing files. The EIP is to use a consumer to read files.
        Hide
        Hadrian Zbarcea added a comment -

        I am not sure this has to offer the full functionality available via pollEnrich. That's the thing I would like to avoid, using a consumer to implement the producer.

        Show
        Hadrian Zbarcea added a comment - I am not sure this has to offer the full functionality available via pollEnrich. That's the thing I would like to avoid, using a consumer to implement the producer.
        Hide
        Claus Ibsen added a comment -

        To leverage all the existing functionally on the consumer side, eg. what should happen with the file after the exchange has been processed? should it be deleted, moved, etc.

        Then it would most likely to leverage a PollingConsumer for the GET command and retrieve the file that way. That will use the consumer under the hood.
        Then you just check if the Exchange returned is null or not. If null then no filed existed.

        And you will then have to transfer the synchronization from the returned Exchange to the existing Exchange, as it contains the on completion logic.
        See the PollEnrich EIP pattern for similar details.

        Show
        Claus Ibsen added a comment - To leverage all the existing functionally on the consumer side, eg. what should happen with the file after the exchange has been processed? should it be deleted, moved, etc. Then it would most likely to leverage a PollingConsumer for the GET command and retrieve the file that way. That will use the consumer under the hood. Then you just check if the Exchange returned is null or not. If null then no filed existed. And you will then have to transfer the synchronization from the returned Exchange to the existing Exchange, as it contains the on completion logic. See the PollEnrich EIP pattern for similar details.

          People

          • Assignee:
            Hadrian Zbarcea
            Reporter:
            Hadrian Zbarcea
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development