You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Ishada <ab...@gmail.com> on 2015/11/09 15:39:42 UTC

Integration Pattern

I am using came in my Integration Project. I am moving files from my local
drive to SFTP server. What I am trying to achieve is once all the files from
my local drive is moved to SFTP Server I should send an email.
Is there any Integration Pattern which would help me to solve it?



--
View this message in context: http://camel.465427.n5.nabble.com/Integration-Pattern-tp5773535.html
Sent from the Camel - Users mailing list archive at Nabble.com.

AW: Integration Pattern

Posted by "Jan Matèrne (jhm)" <ap...@materne.de>.
The "pattern" here I would see
http://camel.apache.org/message.html
http://camel.apache.org/message-channel.html
http://camel.apache.org/message-endpoint.html
http://camel.apache.org/message-router.html
basically http://camel.apache.org/content-based-router.html
http://camel.apache.org/polling-consumer.html


Jan



> -----Ursprüngliche Nachricht-----
> Von: souciance [mailto:souciance.eqdam.rashti@gmail.com]
> Gesendet: Dienstag, 17. November 2015 23:32
> An: users@camel.apache.org
> Betreff: Re: Integration Pattern
> 
> A pattern is not FTP-->E-mail. Its is more abstracted than that.
> 
> Why not simply have a route for the FTP, and if the body is not empty,
> send it to another route which creates the e-mail and sends it?
> 
> 
> 
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Integration-Pattern-
> tp5773535p5774014.html
> Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Integration Pattern

Posted by souciance <so...@gmail.com>.
A pattern is not FTP-->E-mail. Its is more abstracted than that.

Why not simply have a route for the FTP, and if the body is not empty, send
it to another route which creates the e-mail and sends it?



--
View this message in context: http://camel.465427.n5.nabble.com/Integration-Pattern-tp5773535p5774014.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Integration Pattern

Posted by Claus Ibsen <cl...@gmail.com>.
That would repeat sending emails as each poll if there is no file it
triggers an empty message.

If you only want to do this once, then use a filter and check when the
batch is done.

filter(header("CamelBatchComplete"))
   .to("mail ...")
.end()

You can also use simple if you want a == true check

filter(simple("${header.CamelBatchComplete} == true"))


On Tue, Nov 17, 2015 at 9:22 AM, Jan Matèrne (jhm) <ap...@materne.de> wrote:
> Reading files: http://camel.apache.org/file2.html
> - react on "empty dir": sendEmptyMessageWhenIdle
> Sending mails: http://camel.apache.org/mail.html
> SCP: http://camel.apache.org/jsch.html
>
>
> So just thinking loud:
>
> from("file:mydirectory?sendEmptyMessageWhenIdle=true")
>     .choice()
>         .when( simple("${body} == null") )
>
> .to("smtps:user@mailhost?password=secret&to=me@mail.org&subject=Upload-finis
> hed")
>         .otherwise()
>             .to("scp://scp.host.org/dir?username=me&password=secret")
> ;
>
>
>
> Jan
>
>
>
>> -----Ursprüngliche Nachricht-----
>> Von: SteveR [mailto:srichardson@vonage.com]
>> Gesendet: Montag, 9. November 2015 18:34
>> An: users@camel.apache.org
>> Betreff: Re: Integration Pattern
>>
>> Hi Ishada:
>>
>> Maybe checkout the  Camel Mail Component
>> <http://camel.apache.org/mail.html>
>> .
>>
>> SteveR
>>
>>
>>
>> --
>> View this message in context:
>> http://camel.465427.n5.nabble.com/Integration-Pattern-
>> tp5773535p5773547.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

AW: Integration Pattern

Posted by "Jan Matèrne (jhm)" <ap...@materne.de>.
Reading files: http://camel.apache.org/file2.html
- react on "empty dir": sendEmptyMessageWhenIdle
Sending mails: http://camel.apache.org/mail.html
SCP: http://camel.apache.org/jsch.html


So just thinking loud:

from("file:mydirectory?sendEmptyMessageWhenIdle=true")
    .choice()
        .when( simple("${body} == null") )
 
.to("smtps:user@mailhost?password=secret&to=me@mail.org&subject=Upload-finis
hed")
        .otherwise()
            .to("scp://scp.host.org/dir?username=me&password=secret")
;



Jan



> -----Ursprüngliche Nachricht-----
> Von: SteveR [mailto:srichardson@vonage.com]
> Gesendet: Montag, 9. November 2015 18:34
> An: users@camel.apache.org
> Betreff: Re: Integration Pattern
> 
> Hi Ishada:
> 
> Maybe checkout the  Camel Mail Component
> <http://camel.apache.org/mail.html>
> .
> 
> SteveR
> 
> 
> 
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Integration-Pattern-
> tp5773535p5773547.html
> Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Integration Pattern

Posted by SteveR <sr...@vonage.com>.
Hi Ishada:

Maybe checkout the  Camel Mail Component <http://camel.apache.org/mail.html> 
.

SteveR



--
View this message in context: http://camel.465427.n5.nabble.com/Integration-Pattern-tp5773535p5773547.html
Sent from the Camel - Users mailing list archive at Nabble.com.