You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by life1style1 <ch...@gmail.com> on 2013/07/24 10:06:30 UTC

Message not getting delivered from FTP to Activemq

Hi All, 

I am absolutely new to Apache Camel framework. 
I am trying to route a message from FTP to Activemq. 

There are no exceptions but the message is not getting delivered in
ActiveMQ's queue. 

I am using the following code : 
        
                 CamelContext context = new DefaultCamelContext(); 
                
                ConnectionFactory connectionFactory = new
ActiveMQConnectionFactory("tcp://localhost:61616"); 
                
                context.addComponent("activeMQ",
JmsComponent.jmsComponentAutoAcknowledge(connectionFactory)); 
                
                context.addRoutes(new RouteBuilder() { 
                    public void configure() { 
                       
from("ftp://nbleigftp@someserver//somefiles/password=secret").to("activeMQ:queue:EIGIN");            	
                        
                        
                    } 
                });	         
                
                context.start(); 
                Thread.sleep(1000); 
                context.stop(); 
                System.out.println("Sent"); 


But when I am doing the opposite i.e routing the message from ActiveMq to
FTP its working fine. 

I have used the following: 
from("activeMQ:queue:EIGIN").to("ftp://myftpserver/myFILES/?password=secret"); 

Please let me know what I am missing. 

Thanks in advance. 



--
View this message in context: http://camel.465427.n5.nabble.com/Message-not-getting-delivered-from-FTP-to-Activemq-tp5736181.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Message not getting delivered from FTP to Activemq

Posted by life1style1 <ch...@gmail.com>.
Hi,

When transferring files from remote FTP if the connection gets hindered due
to some reason then is there any way camel takes care of this thing?




--
View this message in context: http://camel.465427.n5.nabble.com/Message-not-getting-delivered-from-FTP-to-Activemq-tp5736181p5737183.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Message not getting delivered from FTP to Activemq

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

Take a look at the localWorkDirectory or streamDownload options as by
default the file is loaded into memory. So you may run out of memory.
And for big files you need to use these options instead.

Read more on the ftp doc page at
http://camel.apache.org/ftp2

On Thu, Jul 25, 2013 at 6:19 AM, life1style1
<ch...@gmail.com> wrote:
> Is there any restriction on the file size?
> It is not able to poll a file more than 200 M.B in size.
>
> Thanks.
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Message-not-getting-delivered-from-FTP-to-Activemq-tp5736181p5736247.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



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

Re: Message not getting delivered from FTP to Activemq

Posted by life1style1 <ch...@gmail.com>.
Is there any restriction on the file size?
It is not able to poll a file more than 200 M.B in size.

Thanks.



--
View this message in context: http://camel.465427.n5.nabble.com/Message-not-getting-delivered-from-FTP-to-Activemq-tp5736181p5736247.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Message not getting delivered from FTP to Activemq

Posted by life1style1 <ch...@gmail.com>.
Thanks a lot once again.

I have used "preMove=inprogress&move=.done" to get rid of redundant polling.



--
View this message in context: http://camel.465427.n5.nabble.com/Message-not-getting-delivered-from-FTP-to-Activemq-tp5736181p5736189.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Message not getting delivered from FTP to Activemq

Posted by Claus Ibsen <cl...@gmail.com>.
You can set delete=true to delete the file after you have processed
the file in Camel. Though that would delete the file on the FTP
Server.

There is also options to move the file instead of deleting it etc. Or
use a idempotent consumer in Camel so it will skip the same file etc.

And some other options. Its more what you need to do.

On Wed, Jul 24, 2013 at 10:54 AM, life1style1
<ch...@gmail.com> wrote:
> Thank you so much Claus.
>
> It worked for me.
> Now the issue is that the same file is being polled continuously until the
> sleep value ends.
> Any configurations available to avoid this?
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Message-not-getting-delivered-from-FTP-to-Activemq-tp5736181p5736185.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



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

Re: Message not getting delivered from FTP to Activemq

Posted by life1style1 <ch...@gmail.com>.
Thank you so much Claus.

It worked for me.
Now the issue is that the same file is being polled continuously until the
sleep value ends.
Any configurations available to avoid this?




--
View this message in context: http://camel.465427.n5.nabble.com/Message-not-getting-delivered-from-FTP-to-Activemq-tp5736181p5736185.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Message not getting delivered from FTP to Activemq

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

You only run the application for 1 second that is not a long time. Use
a higher sleep value to have the app run for a bit to give it a chance
to connect to the ftp server and start downloading the file(s).

On Wed, Jul 24, 2013 at 10:06 AM, life1style1
<ch...@gmail.com> wrote:
> Hi All,
>
> I am absolutely new to Apache Camel framework.
> I am trying to route a message from FTP to Activemq.
>
> There are no exceptions but the message is not getting delivered in
> ActiveMQ's queue.
>
> I am using the following code :
>
>                  CamelContext context = new DefaultCamelContext();
>
>                 ConnectionFactory connectionFactory = new
> ActiveMQConnectionFactory("tcp://localhost:61616");
>
>                 context.addComponent("activeMQ",
> JmsComponent.jmsComponentAutoAcknowledge(connectionFactory));
>
>                 context.addRoutes(new RouteBuilder() {
>                     public void configure() {
>
> from("ftp://nbleigftp@someserver//somefiles/password=secret").to("activeMQ:queue:EIGIN");
>
>
>                     }
>                 });
>
>                 context.start();
>                 Thread.sleep(1000);
>                 context.stop();
>                 System.out.println("Sent");
>
>
> But when I am doing the opposite i.e routing the message from ActiveMq to
> FTP its working fine.
>
> I have used the following:
> from("activeMQ:queue:EIGIN").to("ftp://myftpserver/myFILES/?password=secret");
>
> Please let me know what I am missing.
>
> Thanks in advance.
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Message-not-getting-delivered-from-FTP-to-Activemq-tp5736181.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



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