You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by satyaPrakash <sa...@gmail.com> on 2013/01/10 14:23:46 UTC

InOut pattern issue with FTP.

I need to implement the use case where I have to split a big request file
into small request files and send it to FTP server.After receiving request
file, FTP server is creating response files based on the request files
received.FTP server can take their own time to create the response file.So
the sending thread may wait till the response file will be get generated
response from FTP server.So for this use case InOut EIP is most suitable
approach as per my understanding. I am facing issue in getting reply from
the same endpoint which is used in producer[FTP server will create the
response file with same name or different as per user requirement, suppose
the response file name is equal to request File name] . So sending request
to FTP server is working but the same endpoint is not working to get
response from the same FTP server i.e. InOut EIP. If this EIP will work in
complete, it will save a lot of coding.I just want to know your thoughts so
that I can decide best approach to implement said use case.Thanks alot!!!



--
View this message in context: http://camel.465427.n5.nabble.com/InOut-pattern-issue-with-FTP-tp5725273.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: InOut pattern issue with FTP.

Posted by Claus Ibsen <cl...@gmail.com>.
On Sat, Jan 12, 2013 at 8:40 AM, satyaPrakash <sa...@gmail.com> wrote:
> I don't want to create another FTP endpoint to poll the reply files because
> in splitter I am splitting a big request file into small requests and
> uploading the request files on FTP in parallel threads[till this point my
> code is working] and want to aggregate the reply file by the same thread who
> has uploaded the request file to FTP[At least I want response from FTP to
> the same thread, that's the InOut EIP talks about] So as you suggested when
> I will use a dedicated FTP component to poll the reply files, FTP thread
> will work sequentially to poll all the reply files.Means if there are 50
> reply files then it will take a lot of time to finish the polling, which
> will be a bottleneck for us.Also I will have to take care of many things
> like aggregation,thread sync,notification etc.That's why I don't think this
> will be a better approach to go ahead instead of looking into the cause why
> InOut is not working for FTP.
> My expectation from FTP Component:-
>  If I am using InOut EIP for the endpoint say "ftp:xyz" then it should must
> return me response object and this object must have the file which is passed
> to include property.Every thread must be able to work individually for the
> same.

The FTP component does not support request/reply. That is not natural to FTP.
You would need to code this yourself.

For example from a java bean / Camel processor.
Then use a producer to send the ftp file.
And a consumer to download the reply file.



> P.S-
>  I want to translate our code into Camel otherwise I have the Java code for
> the same. But I want to do it in pure  Camel way to support my POC[Proof of
> Concept] as well.So that I can propose to translate the complete project
> into camel.Till now single thread execution of File and FTP component is the
> main bottleneck for me to go ahead.Also,if we will find the way to implement
> the above scenario then  it will act as a  workaround to poll multiple files
> in multithreaded environment and we will find  its implementation in Camel
> Way Only.Thanks a lot Claus.Happy weekends :)
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/InOut-pattern-issue-with-FTP-tp5725273p5725438.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Re: InOut pattern issue with FTP.

Posted by satyaPrakash <sa...@gmail.com>.
I don't want to create another FTP endpoint to poll the reply files because
in splitter I am splitting a big request file into small requests and
uploading the request files on FTP in parallel threads[till this point my
code is working] and want to aggregate the reply file by the same thread who
has uploaded the request file to FTP[At least I want response from FTP to
the same thread, that's the InOut EIP talks about] So as you suggested when
I will use a dedicated FTP component to poll the reply files, FTP thread
will work sequentially to poll all the reply files.Means if there are 50
reply files then it will take a lot of time to finish the polling, which
will be a bottleneck for us.Also I will have to take care of many things
like aggregation,thread sync,notification etc.That's why I don't think this
will be a better approach to go ahead instead of looking into the cause why
InOut is not working for FTP.
My expectation from FTP Component:-
 If I am using InOut EIP for the endpoint say "ftp:xyz" then it should must
return me response object and this object must have the file which is passed
to include property.Every thread must be able to work individually for the
same.
P.S-
 I want to translate our code into Camel otherwise I have the Java code for
the same. But I want to do it in pure  Camel way to support my POC[Proof of
Concept] as well.So that I can propose to translate the complete project
into camel.Till now single thread execution of File and FTP component is the
main bottleneck for me to go ahead.Also,if we will find the way to implement
the above scenario then  it will act as a  workaround to poll multiple files
in multithreaded environment and we will find  its implementation in Camel
Way Only.Thanks a lot Claus.Happy weekends :) 



--
View this message in context: http://camel.465427.n5.nabble.com/InOut-pattern-issue-with-FTP-tp5725273p5725438.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: InOut pattern issue with FTP.

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

This is a bit hard.
Have you considering doing this as a 2-way InOnly instead?

eg split the file, and send each splitted piece as a file to the FTP server.
And have another route that pickup the reply messages as they become ready?

Also I would suggest to use a naming style so the reply messages is
something like
original_name-reply.ext

eg if the original file is
123.txt

then the reply is
123-reply.txt

Or something like that. So you have a pattern you can use as filter to
consume the reply messages.




On Thu, Jan 10, 2013 at 2:23 PM, satyaPrakash <sa...@gmail.com> wrote:
> I need to implement the use case where I have to split a big request file
> into small request files and send it to FTP server.After receiving request
> file, FTP server is creating response files based on the request files
> received.FTP server can take their own time to create the response file.So
> the sending thread may wait till the response file will be get generated
> response from FTP server.So for this use case InOut EIP is most suitable
> approach as per my understanding. I am facing issue in getting reply from
> the same endpoint which is used in producer[FTP server will create the
> response file with same name or different as per user requirement, suppose
> the response file name is equal to request File name] . So sending request
> to FTP server is working but the same endpoint is not working to get
> response from the same FTP server i.e. InOut EIP. If this EIP will work in
> complete, it will save a lot of coding.I just want to know your thoughts so
> that I can decide best approach to implement said use case.Thanks alot!!!
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/InOut-pattern-issue-with-FTP-tp5725273.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen