Integration Pattern

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Integration Pattern

Ishada
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?
Reply | Threaded
Open this post in threaded view
|

Re: Integration Pattern

SteveR
Hi Ishada:

Maybe checkout the Camel Mail Component.

SteveR
Reply | Threaded
Open this post in threaded view
|

AW: Integration Pattern

Jan Matèrne (jhm)
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=[hidden email]&subject=Upload-finis
hed")
        .otherwise()
            .to("scp://scp.host.org/dir?username=me&password=secret")
;



Jan



> -----Ursprüngliche Nachricht-----
> Von: SteveR [mailto:[hidden email]]
> Gesendet: Montag, 9. November 2015 18:34
> An: [hidden email]
> 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.

Reply | Threaded
Open this post in threaded view
|

Re: Integration Pattern

Claus Ibsen-2
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) <[hidden email]> 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=[hidden email]&subject=Upload-finis
> hed")
>         .otherwise()
>             .to("scp://scp.host.org/dir?username=me&password=secret")
> ;
>
>
>
> Jan
>
>
>
>> -----Ursprüngliche Nachricht-----
>> Von: SteveR [mailto:[hidden email]]
>> Gesendet: Montag, 9. November 2015 18:34
>> An: [hidden email]
>> 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
Reply | Threaded
Open this post in threaded view
|

Re: Integration Pattern

souciance
In reply to this post by Ishada
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?
Reply | Threaded
Open this post in threaded view
|

AW: Integration Pattern

Jan Matèrne (jhm)
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:[hidden email]]
> Gesendet: Dienstag, 17. November 2015 23:32
> An: [hidden email]
> 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.