You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by yeandone <wi...@gmail.com> on 2015/01/09 08:05:23 UTC

Help: FTP/SFTP File Delete Problem and FTP/SFTP Polling Problem

Hi, All.

  I have an issue deleting a file with delete=true from a SFTP consumer.  My
route looks like the following:
<route id="A_ROUTE">
		<from
uri="sftp:amdin@xxx.com?password=xxx&amp;delete=true&amp;filter=#fileFilter"/>
			<choice>
				<when>
					<simple>${body} != null</simple>
					<multicast>
					<to uri="direct:a"/>
				        <to uri="direct:b"/>
				    </multicast>
			   </when>
				<otherwise>
				        <to uri="direct:b"/>
				</otherwise>
			</choice>
			<to uri="controlbus:route?routeId=A_Route&amp;action=stop" />
</route>

whenever it runs, it will end up 
WARN Camel (platformSchedulerCamel) thread #7 - sftp://xxx
org.apache.camel.component.file.GenericFileOnCompletion - Rollback file
strategy:
org.apache.camel.component.file.strategy.GenericFileDeleteProcessStrategy@4b474b47
for file: RemoteFile[a.txt]

Does anyone have any idea why it happens? What I want to do is deleting
original file after it's processed by direct: a and direct: b and then stop
the route which will stop the file polling from the sftp location. If
nothing is picked, then I want to do some processing in direct:b and then
stop the route. 

If I remove 			
<to uri="controlbus:route?routeId=A_Route&amp;action=stop" /> at the end,
the file will be deleted. However, the sftp consumer will never stop and
keep polling stfp, which I do not want to happen. 

Any help or any ideas will be appreciated!!!

Thanks,
W 




--
View this message in context: http://camel.465427.n5.nabble.com/Help-FTP-SFTP-File-Delete-Problem-and-FTP-SFTP-Polling-Problem-tp5761486.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Help: FTP/SFTP File Delete Problem and FTP/SFTP Polling Problem

Posted by yeandone <wi...@gmail.com>.
Hi, contractreji.

 Thanks for the reply. I do have all the permissions because I use admin
credentials to access the sftp location. I wonder if you have any idea how
I can resolve the issue.

Thanks

On Tue, Jan 13, 2015 at 6:05 PM, contactreji [via Camel] <
ml-node+s465427n5761660h14@n5.nabble.com> wrote:

> Hey buddy
>
> I had faced similar issue few months back.
> It so happened that my ftp admin hadn't provide delete and write
> authorizations to my ftp credentials .
>
> It would be a good idea to check with ur ftp admin personnel if these
> rights are provided to ur ftp credentials.
>
> Cheers
> Reji
> On 9 Jan 2015 12:36, "yeandone" <[hidden email]
> <http:///user/SendEmail.jtp?type=node&node=5761660&i=0>> wrote:
>
> > Hi, All.
> >
> >   I have an issue deleting a file with delete=true from a SFTP consumer.
> > My
> > route looks like the following:
> > <route id="A_ROUTE">
> >                 <from
> > uri="
> > sftp:[hidden email]
> <http:///user/SendEmail.jtp?type=node&node=5761660&i=1>?password=xxx&amp;delete=true&amp;filter=#fileFilter"/>
>
> >                         <choice>
> >                                 <when>
> >                                         <simple>${body} != null</simple>
> >                                         <multicast>
> >                                         <to uri="direct:a"/>
> >                                         <to uri="direct:b"/>
> >                                     </multicast>
> >                            </when>
> >                                 <otherwise>
> >                                         <to uri="direct:b"/>
> >                                 </otherwise>
> >                         </choice>
> >                         <to
> > uri="controlbus:route?routeId=A_Route&amp;action=stop" />
> > </route>
> >
> > whenever it runs, it will end up
> > WARN Camel (platformSchedulerCamel) thread #7 - sftp://xxx
> > org.apache.camel.component.file.GenericFileOnCompletion - Rollback file
> > strategy:
> >
> >
> org.apache.camel.component.file.strategy.GenericFileDeleteProcessStrategy@4b474b47
> > for file: RemoteFile[a.txt]
> >
> > Does anyone have any idea why it happens? What I want to do is deleting
> > original file after it's processed by direct: a and direct: b and then
> stop
> > the route which will stop the file polling from the sftp location. If
> > nothing is picked, then I want to do some processing in direct:b and
> then
> > stop the route.
> >
> > If I remove
> > <to uri="controlbus:route?routeId=A_Route&amp;action=stop" /> at the
> end,
> > the file will be deleted. However, the sftp consumer will never stop and
> > keep polling stfp, which I do not want to happen.
> >
> > Any help or any ideas will be appreciated!!!
> >
> > Thanks,
> > W
> >
> >
> >
> >
> > --
> > View this message in context:
> >
> http://camel.465427.n5.nabble.com/Help-FTP-SFTP-File-Delete-Problem-and-FTP-SFTP-Polling-Problem-tp5761486.html
> > Sent from the Camel - Users mailing list archive at Nabble.com.
> >
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://camel.465427.n5.nabble.com/Help-FTP-SFTP-File-Delete-Problem-and-FTP-SFTP-Polling-Problem-tp5761486p5761660.html
>  To unsubscribe from Help: FTP/SFTP File Delete Problem and FTP/SFTP
> Polling Problem, click here
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5761486&code=d2lsbGNvdXJzZXJhQGdtYWlsLmNvbXw1NzYxNDg2fDc4ODg5MzE5OQ==>
> .
> NAML
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://camel.465427.n5.nabble.com/Help-FTP-SFTP-File-Delete-Problem-and-FTP-SFTP-Polling-Problem-tp5761486p5761662.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Help: FTP/SFTP File Delete Problem and FTP/SFTP Polling Problem

Posted by Reji Mathews <co...@gmail.com>.
Hey buddy

I had faced similar issue few months back.
It so happened that my ftp admin hadn't provide delete and write
authorizations to my ftp credentials .

It would be a good idea to check with ur ftp admin personnel if these
rights are provided to ur ftp credentials.

Cheers
Reji
On 9 Jan 2015 12:36, "yeandone" <wi...@gmail.com> wrote:

> Hi, All.
>
>   I have an issue deleting a file with delete=true from a SFTP consumer.
> My
> route looks like the following:
> <route id="A_ROUTE">
>                 <from
> uri="
> sftp:amdin@xxx.com?password=xxx&amp;delete=true&amp;filter=#fileFilter"/>
>                         <choice>
>                                 <when>
>                                         <simple>${body} != null</simple>
>                                         <multicast>
>                                         <to uri="direct:a"/>
>                                         <to uri="direct:b"/>
>                                     </multicast>
>                            </when>
>                                 <otherwise>
>                                         <to uri="direct:b"/>
>                                 </otherwise>
>                         </choice>
>                         <to
> uri="controlbus:route?routeId=A_Route&amp;action=stop" />
> </route>
>
> whenever it runs, it will end up
> WARN Camel (platformSchedulerCamel) thread #7 - sftp://xxx
> org.apache.camel.component.file.GenericFileOnCompletion - Rollback file
> strategy:
>
> org.apache.camel.component.file.strategy.GenericFileDeleteProcessStrategy@4b474b47
> for file: RemoteFile[a.txt]
>
> Does anyone have any idea why it happens? What I want to do is deleting
> original file after it's processed by direct: a and direct: b and then stop
> the route which will stop the file polling from the sftp location. If
> nothing is picked, then I want to do some processing in direct:b and then
> stop the route.
>
> If I remove
> <to uri="controlbus:route?routeId=A_Route&amp;action=stop" /> at the end,
> the file will be deleted. However, the sftp consumer will never stop and
> keep polling stfp, which I do not want to happen.
>
> Any help or any ideas will be appreciated!!!
>
> Thanks,
> W
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Help-FTP-SFTP-File-Delete-Problem-and-FTP-SFTP-Polling-Problem-tp5761486.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Re: Help: FTP/SFTP File Delete Problem and FTP/SFTP Polling Problem

Posted by yeandone <wi...@gmail.com>.
Ok Thanks Claus. But if I keep the original code, will those warning
messages have any negative impacts on my logics and route?

On Mon, Jan 12, 2015 at 12:58 AM, Claus Ibsen-2 [via Camel] <
ml-node+s465427n5761580h34@n5.nabble.com> wrote:

> Hi
>
> You can use a route policy, and then stop the consumer in onExchangeDone
> http://camel.apache.org/routepolicy.html
>
> On Mon, Jan 12, 2015 at 8:31 AM, yeandone <[hidden email]
> <http:///user/SendEmail.jtp?type=node&node=5761580&i=0>> wrote:
>
> > Will there be any risks if I stop route like that? After the exchange is
> > processed by both end endpoints direct a and direct b. I need to stop
> the
> > route so that the consumer can stop polling. Can you please give some
> ideas
> > to stop route/consumer properly so that the route and consumer will stop
> > properly without any risks?
> >
> > On Sun, Jan 11, 2015 at 9:36 PM, Claus Ibsen-2 [via Camel] <
> > [hidden email] <http:///user/SendEmail.jtp?type=node&node=5761580&i=1>>
> wrote:
> >
> >> On Sun, Jan 11, 2015 at 3:48 AM, yeandone <[hidden email]
> >> <http:///user/SendEmail.jtp?type=node&node=5761572&i=0>> wrote:
> >>
> >> > Thanks, Claus. Will try a new version. But do you know why it always
> >> > prompts the following warnings when the routes stops? Will they
> impact
> >> > anything and the original file?
> >> >
> >> > 1. If choose not to delete the file, it prompts when the route stops:
> >> >
> >> > WARN Camel (platformSchedulerCamel) thread #7 - sftp://xxx
> >> > org.apache.camel.component.file.GenericFileOnCompletion - Rollback
> file
> >> > strategy:
> >> >
> >>
> org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy@4b474b47
> >> > for file: RemoteFile[a.txt]
> >> >
> >>
> >> Its because you stop the route from the route, eg then the current
> >> exchange is forced to be stopped and thus wants to rollback.
> >>
> >>
> >>
> >> > 2. If choose not to delete the file, it prompts when the route stops:
> >> > WARN Camel (platformSchedulerCamel) thread #7 - sftp://xxx
> >> > org.apache.camel.component.file.GenericFileOnCompletion - Rollback
> file
> >> > strategy:
> >> >
> >>
> org.apache.camel.component.file.strategy.GenericFileNoOpProcessStrategy@4b474b47
> >> > for file: RemoteFile[a.txt]
> >> >
> >> >
> >> >
> >> > On Fri, Jan 9, 2015 at 11:24 PM, Claus Ibsen-2 [via Camel] <
> >> > [hidden email] <http:///user/SendEmail.jtp?type=node&node=5761572&i=1>>
>
> >> wrote:
> >> >
> >> >> Try with newer release, there may have been a bug fix
> >> >>
> >> >> On Fri, Jan 9, 2015 at 6:47 PM, yeandone <[hidden email]
> >> >> <http:///user/SendEmail.jtp?type=node&node=5761545&i=0>> wrote:
> >> >>
> >> >> > HI, Claus.
> >> >> >
> >> >> >   Thanks for the prompt reply! I am using Camel 2.12. I also tried
> >> >> adding
> >> >> > aync=true in controlbus
> >> >> > <to
> >> uri="controlbus:route?routeId=A_Route&amp;aync=true&amp;action=stop"
> >> >> />
> >> >> >
> >> >> >   It does help delete the file, but it has some issues with
> polling.
> >> >> Until
> >> >> > the file get deleted and control bus stops, the route still keeps
> >> >> polling
> >> >> > for a while. What I want to do is deleting original file after
> it's
> >> >> > processed by direct: a and direct: b and then stop the route which
> >> will
> >> >> stop
> >> >> > the file polling from the sftp location. If nothing is picked,
> then I
> >> >> want
> >> >> > to do some processing in direct:b and then stop the route and
> polling
> >> >> > immediately.  Any ideas to resolve the issue?
> >> >> >
> >> >> >  Thanks
> >> >> >
> >> >> >
> >> >> >
> >> >> > --
> >> >> > View this message in context:
> >> >>
> >>
> http://camel.465427.n5.nabble.com/Help-FTP-SFTP-File-Delete-Problem-and-FTP-SFTP-Polling-Problem-tp5761486p5761535.html
> >> >> > Sent from the Camel - Users mailing list archive at Nabble.com.
> >> >>
> >> >>
> >> >>
> >> >> --
> >> >> Claus Ibsen
> >> >> -----------------
> >> >> Red Hat, Inc.
> >> >> Email: [hidden email]
> >> >> <http:///user/SendEmail.jtp?type=node&node=5761545&i=1>
> >> >> Twitter: davsclaus
> >> >> Blog: http://davsclaus.com
> >> >> Author of Camel in Action: http://www.manning.com/ibsen
> >> >> hawtio: http://hawt.io/
> >> >> fabric8: http://fabric8.io/
> >> >>
> >> >>
> >> >> ------------------------------
> >> >>  If you reply to this email, your message will be added to the
> >> discussion
> >> >> below:
> >> >>
> >> >>
> >>
> http://camel.465427.n5.nabble.com/Help-FTP-SFTP-File-Delete-Problem-and-FTP-SFTP-Polling-Problem-tp5761486p5761545.html
> >> >>  To unsubscribe from Help: FTP/SFTP File Delete Problem and FTP/SFTP
> >> >> Polling Problem, click here
> >> >> <
> >> >> .
> >> >> NAML
> >> >> <
> >>
> http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
> >>
> >> >>
> >> >
> >> >
> >> >
> >> >
> >> > --
> >> > View this message in context:
> >>
> http://camel.465427.n5.nabble.com/Help-FTP-SFTP-File-Delete-Problem-and-FTP-SFTP-Polling-Problem-tp5761486p5761561.html
> >> > Sent from the Camel - Users mailing list archive at Nabble.com.
> >>
> >>
> >>
> >> --
> >> Claus Ibsen
> >> -----------------
> >> Red Hat, Inc.
> >> Email: [hidden email]
> >> <http:///user/SendEmail.jtp?type=node&node=5761572&i=2>
> >> Twitter: davsclaus
> >> Blog: http://davsclaus.com
> >> Author of Camel in Action: http://www.manning.com/ibsen
> >> hawtio: http://hawt.io/
> >> fabric8: http://fabric8.io/
> >>
> >>
> >> ------------------------------
> >>  If you reply to this email, your message will be added to the
> discussion
> >> below:
> >>
> >>
> http://camel.465427.n5.nabble.com/Help-FTP-SFTP-File-Delete-Problem-and-FTP-SFTP-Polling-Problem-tp5761486p5761572.html
> >>  To unsubscribe from Help: FTP/SFTP File Delete Problem and FTP/SFTP
> >> Polling Problem, click here
> >> <
> >> .
> >> NAML
> >> <
> http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
> >>
> >
> >
> >
> >
> > --
> > View this message in context:
> http://camel.465427.n5.nabble.com/Help-FTP-SFTP-File-Delete-Problem-and-FTP-SFTP-Polling-Problem-tp5761486p5761577.html
> > Sent from the Camel - Users mailing list archive at Nabble.com.
>
>
>
> --
> Claus Ibsen
> -----------------
> Red Hat, Inc.
> Email: [hidden email]
> <http:///user/SendEmail.jtp?type=node&node=5761580&i=2>
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen
> hawtio: http://hawt.io/
> fabric8: http://fabric8.io/
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://camel.465427.n5.nabble.com/Help-FTP-SFTP-File-Delete-Problem-and-FTP-SFTP-Polling-Problem-tp5761486p5761580.html
>  To unsubscribe from Help: FTP/SFTP File Delete Problem and FTP/SFTP
> Polling Problem, click here
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5761486&code=d2lsbGNvdXJzZXJhQGdtYWlsLmNvbXw1NzYxNDg2fDc4ODg5MzE5OQ==>
> .
> NAML
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://camel.465427.n5.nabble.com/Help-FTP-SFTP-File-Delete-Problem-and-FTP-SFTP-Polling-Problem-tp5761486p5761655.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Help: FTP/SFTP File Delete Problem and FTP/SFTP Polling Problem

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

You can use a route policy, and then stop the consumer in onExchangeDone
http://camel.apache.org/routepolicy.html

On Mon, Jan 12, 2015 at 8:31 AM, yeandone <wi...@gmail.com> wrote:
> Will there be any risks if I stop route like that? After the exchange is
> processed by both end endpoints direct a and direct b. I need to stop the
> route so that the consumer can stop polling. Can you please give some ideas
> to stop route/consumer properly so that the route and consumer will stop
> properly without any risks?
>
> On Sun, Jan 11, 2015 at 9:36 PM, Claus Ibsen-2 [via Camel] <
> ml-node+s465427n5761572h86@n5.nabble.com> wrote:
>
>> On Sun, Jan 11, 2015 at 3:48 AM, yeandone <[hidden email]
>> <http:///user/SendEmail.jtp?type=node&node=5761572&i=0>> wrote:
>>
>> > Thanks, Claus. Will try a new version. But do you know why it always
>> > prompts the following warnings when the routes stops? Will they impact
>> > anything and the original file?
>> >
>> > 1. If choose not to delete the file, it prompts when the route stops:
>> >
>> > WARN Camel (platformSchedulerCamel) thread #7 - sftp://xxx
>> > org.apache.camel.component.file.GenericFileOnCompletion - Rollback file
>> > strategy:
>> >
>> org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy@4b474b47
>> > for file: RemoteFile[a.txt]
>> >
>>
>> Its because you stop the route from the route, eg then the current
>> exchange is forced to be stopped and thus wants to rollback.
>>
>>
>>
>> > 2. If choose not to delete the file, it prompts when the route stops:
>> > WARN Camel (platformSchedulerCamel) thread #7 - sftp://xxx
>> > org.apache.camel.component.file.GenericFileOnCompletion - Rollback file
>> > strategy:
>> >
>> org.apache.camel.component.file.strategy.GenericFileNoOpProcessStrategy@4b474b47
>> > for file: RemoteFile[a.txt]
>> >
>> >
>> >
>> > On Fri, Jan 9, 2015 at 11:24 PM, Claus Ibsen-2 [via Camel] <
>> > [hidden email] <http:///user/SendEmail.jtp?type=node&node=5761572&i=1>>
>> wrote:
>> >
>> >> Try with newer release, there may have been a bug fix
>> >>
>> >> On Fri, Jan 9, 2015 at 6:47 PM, yeandone <[hidden email]
>> >> <http:///user/SendEmail.jtp?type=node&node=5761545&i=0>> wrote:
>> >>
>> >> > HI, Claus.
>> >> >
>> >> >   Thanks for the prompt reply! I am using Camel 2.12. I also tried
>> >> adding
>> >> > aync=true in controlbus
>> >> > <to
>> uri="controlbus:route?routeId=A_Route&amp;aync=true&amp;action=stop"
>> >> />
>> >> >
>> >> >   It does help delete the file, but it has some issues with polling.
>> >> Until
>> >> > the file get deleted and control bus stops, the route still keeps
>> >> polling
>> >> > for a while. What I want to do is deleting original file after it's
>> >> > processed by direct: a and direct: b and then stop the route which
>> will
>> >> stop
>> >> > the file polling from the sftp location. If nothing is picked, then I
>> >> want
>> >> > to do some processing in direct:b and then stop the route and polling
>> >> > immediately.  Any ideas to resolve the issue?
>> >> >
>> >> >  Thanks
>> >> >
>> >> >
>> >> >
>> >> > --
>> >> > View this message in context:
>> >>
>> http://camel.465427.n5.nabble.com/Help-FTP-SFTP-File-Delete-Problem-and-FTP-SFTP-Polling-Problem-tp5761486p5761535.html
>> >> > Sent from the Camel - Users mailing list archive at Nabble.com.
>> >>
>> >>
>> >>
>> >> --
>> >> Claus Ibsen
>> >> -----------------
>> >> Red Hat, Inc.
>> >> Email: [hidden email]
>> >> <http:///user/SendEmail.jtp?type=node&node=5761545&i=1>
>> >> Twitter: davsclaus
>> >> Blog: http://davsclaus.com
>> >> Author of Camel in Action: http://www.manning.com/ibsen
>> >> hawtio: http://hawt.io/
>> >> fabric8: http://fabric8.io/
>> >>
>> >>
>> >> ------------------------------
>> >>  If you reply to this email, your message will be added to the
>> discussion
>> >> below:
>> >>
>> >>
>> http://camel.465427.n5.nabble.com/Help-FTP-SFTP-File-Delete-Problem-and-FTP-SFTP-Polling-Problem-tp5761486p5761545.html
>> >>  To unsubscribe from Help: FTP/SFTP File Delete Problem and FTP/SFTP
>> >> Polling Problem, click here
>> >> <
>> >> .
>> >> NAML
>> >> <
>> http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>>
>> >>
>> >
>> >
>> >
>> >
>> > --
>> > View this message in context:
>> http://camel.465427.n5.nabble.com/Help-FTP-SFTP-File-Delete-Problem-and-FTP-SFTP-Polling-Problem-tp5761486p5761561.html
>> > Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>>
>>
>> --
>> Claus Ibsen
>> -----------------
>> Red Hat, Inc.
>> Email: [hidden email]
>> <http:///user/SendEmail.jtp?type=node&node=5761572&i=2>
>> Twitter: davsclaus
>> Blog: http://davsclaus.com
>> Author of Camel in Action: http://www.manning.com/ibsen
>> hawtio: http://hawt.io/
>> fabric8: http://fabric8.io/
>>
>>
>> ------------------------------
>>  If you reply to this email, your message will be added to the discussion
>> below:
>>
>> http://camel.465427.n5.nabble.com/Help-FTP-SFTP-File-Delete-Problem-and-FTP-SFTP-Polling-Problem-tp5761486p5761572.html
>>  To unsubscribe from Help: FTP/SFTP File Delete Problem and FTP/SFTP
>> Polling Problem, click here
>> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5761486&code=d2lsbGNvdXJzZXJhQGdtYWlsLmNvbXw1NzYxNDg2fDc4ODg5MzE5OQ==>
>> .
>> NAML
>> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>>
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Help-FTP-SFTP-File-Delete-Problem-and-FTP-SFTP-Polling-Problem-tp5761486p5761577.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
hawtio: http://hawt.io/
fabric8: http://fabric8.io/

Re: Help: FTP/SFTP File Delete Problem and FTP/SFTP Polling Problem

Posted by yeandone <wi...@gmail.com>.
Will there be any risks if I stop route like that? After the exchange is
processed by both end endpoints direct a and direct b. I need to stop the
route so that the consumer can stop polling. Can you please give some ideas
to stop route/consumer properly so that the route and consumer will stop
properly without any risks?

On Sun, Jan 11, 2015 at 9:36 PM, Claus Ibsen-2 [via Camel] <
ml-node+s465427n5761572h86@n5.nabble.com> wrote:

> On Sun, Jan 11, 2015 at 3:48 AM, yeandone <[hidden email]
> <http:///user/SendEmail.jtp?type=node&node=5761572&i=0>> wrote:
>
> > Thanks, Claus. Will try a new version. But do you know why it always
> > prompts the following warnings when the routes stops? Will they impact
> > anything and the original file?
> >
> > 1. If choose not to delete the file, it prompts when the route stops:
> >
> > WARN Camel (platformSchedulerCamel) thread #7 - sftp://xxx
> > org.apache.camel.component.file.GenericFileOnCompletion - Rollback file
> > strategy:
> >
> org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy@4b474b47
> > for file: RemoteFile[a.txt]
> >
>
> Its because you stop the route from the route, eg then the current
> exchange is forced to be stopped and thus wants to rollback.
>
>
>
> > 2. If choose not to delete the file, it prompts when the route stops:
> > WARN Camel (platformSchedulerCamel) thread #7 - sftp://xxx
> > org.apache.camel.component.file.GenericFileOnCompletion - Rollback file
> > strategy:
> >
> org.apache.camel.component.file.strategy.GenericFileNoOpProcessStrategy@4b474b47
> > for file: RemoteFile[a.txt]
> >
> >
> >
> > On Fri, Jan 9, 2015 at 11:24 PM, Claus Ibsen-2 [via Camel] <
> > [hidden email] <http:///user/SendEmail.jtp?type=node&node=5761572&i=1>>
> wrote:
> >
> >> Try with newer release, there may have been a bug fix
> >>
> >> On Fri, Jan 9, 2015 at 6:47 PM, yeandone <[hidden email]
> >> <http:///user/SendEmail.jtp?type=node&node=5761545&i=0>> wrote:
> >>
> >> > HI, Claus.
> >> >
> >> >   Thanks for the prompt reply! I am using Camel 2.12. I also tried
> >> adding
> >> > aync=true in controlbus
> >> > <to
> uri="controlbus:route?routeId=A_Route&amp;aync=true&amp;action=stop"
> >> />
> >> >
> >> >   It does help delete the file, but it has some issues with polling.
> >> Until
> >> > the file get deleted and control bus stops, the route still keeps
> >> polling
> >> > for a while. What I want to do is deleting original file after it's
> >> > processed by direct: a and direct: b and then stop the route which
> will
> >> stop
> >> > the file polling from the sftp location. If nothing is picked, then I
> >> want
> >> > to do some processing in direct:b and then stop the route and polling
> >> > immediately.  Any ideas to resolve the issue?
> >> >
> >> >  Thanks
> >> >
> >> >
> >> >
> >> > --
> >> > View this message in context:
> >>
> http://camel.465427.n5.nabble.com/Help-FTP-SFTP-File-Delete-Problem-and-FTP-SFTP-Polling-Problem-tp5761486p5761535.html
> >> > Sent from the Camel - Users mailing list archive at Nabble.com.
> >>
> >>
> >>
> >> --
> >> Claus Ibsen
> >> -----------------
> >> Red Hat, Inc.
> >> Email: [hidden email]
> >> <http:///user/SendEmail.jtp?type=node&node=5761545&i=1>
> >> Twitter: davsclaus
> >> Blog: http://davsclaus.com
> >> Author of Camel in Action: http://www.manning.com/ibsen
> >> hawtio: http://hawt.io/
> >> fabric8: http://fabric8.io/
> >>
> >>
> >> ------------------------------
> >>  If you reply to this email, your message will be added to the
> discussion
> >> below:
> >>
> >>
> http://camel.465427.n5.nabble.com/Help-FTP-SFTP-File-Delete-Problem-and-FTP-SFTP-Polling-Problem-tp5761486p5761545.html
> >>  To unsubscribe from Help: FTP/SFTP File Delete Problem and FTP/SFTP
> >> Polling Problem, click here
> >> <
> >> .
> >> NAML
> >> <
> http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
> >>
> >
> >
> >
> >
> > --
> > View this message in context:
> http://camel.465427.n5.nabble.com/Help-FTP-SFTP-File-Delete-Problem-and-FTP-SFTP-Polling-Problem-tp5761486p5761561.html
> > Sent from the Camel - Users mailing list archive at Nabble.com.
>
>
>
> --
> Claus Ibsen
> -----------------
> Red Hat, Inc.
> Email: [hidden email]
> <http:///user/SendEmail.jtp?type=node&node=5761572&i=2>
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen
> hawtio: http://hawt.io/
> fabric8: http://fabric8.io/
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://camel.465427.n5.nabble.com/Help-FTP-SFTP-File-Delete-Problem-and-FTP-SFTP-Polling-Problem-tp5761486p5761572.html
>  To unsubscribe from Help: FTP/SFTP File Delete Problem and FTP/SFTP
> Polling Problem, click here
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5761486&code=d2lsbGNvdXJzZXJhQGdtYWlsLmNvbXw1NzYxNDg2fDc4ODg5MzE5OQ==>
> .
> NAML
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://camel.465427.n5.nabble.com/Help-FTP-SFTP-File-Delete-Problem-and-FTP-SFTP-Polling-Problem-tp5761486p5761577.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Help: FTP/SFTP File Delete Problem and FTP/SFTP Polling Problem

Posted by Claus Ibsen <cl...@gmail.com>.
On Sun, Jan 11, 2015 at 3:48 AM, yeandone <wi...@gmail.com> wrote:
> Thanks, Claus. Will try a new version. But do you know why it always
> prompts the following warnings when the routes stops? Will they impact
> anything and the original file?
>
> 1. If choose not to delete the file, it prompts when the route stops:
>
> WARN Camel (platformSchedulerCamel) thread #7 - sftp://xxx
> org.apache.camel.component.file.GenericFileOnCompletion - Rollback file
> strategy:
> org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy@4b474b47
> for file: RemoteFile[a.txt]
>

Its because you stop the route from the route, eg then the current
exchange is forced to be stopped and thus wants to rollback.



> 2. If choose not to delete the file, it prompts when the route stops:
> WARN Camel (platformSchedulerCamel) thread #7 - sftp://xxx
> org.apache.camel.component.file.GenericFileOnCompletion - Rollback file
> strategy:
> org.apache.camel.component.file.strategy.GenericFileNoOpProcessStrategy@4b474b47
> for file: RemoteFile[a.txt]
>
>
>
> On Fri, Jan 9, 2015 at 11:24 PM, Claus Ibsen-2 [via Camel] <
> ml-node+s465427n5761545h49@n5.nabble.com> wrote:
>
>> Try with newer release, there may have been a bug fix
>>
>> On Fri, Jan 9, 2015 at 6:47 PM, yeandone <[hidden email]
>> <http:///user/SendEmail.jtp?type=node&node=5761545&i=0>> wrote:
>>
>> > HI, Claus.
>> >
>> >   Thanks for the prompt reply! I am using Camel 2.12. I also tried
>> adding
>> > aync=true in controlbus
>> > <to uri="controlbus:route?routeId=A_Route&amp;aync=true&amp;action=stop"
>> />
>> >
>> >   It does help delete the file, but it has some issues with polling.
>> Until
>> > the file get deleted and control bus stops, the route still keeps
>> polling
>> > for a while. What I want to do is deleting original file after it's
>> > processed by direct: a and direct: b and then stop the route which will
>> stop
>> > the file polling from the sftp location. If nothing is picked, then I
>> want
>> > to do some processing in direct:b and then stop the route and polling
>> > immediately.  Any ideas to resolve the issue?
>> >
>> >  Thanks
>> >
>> >
>> >
>> > --
>> > View this message in context:
>> http://camel.465427.n5.nabble.com/Help-FTP-SFTP-File-Delete-Problem-and-FTP-SFTP-Polling-Problem-tp5761486p5761535.html
>> > Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>>
>>
>> --
>> Claus Ibsen
>> -----------------
>> Red Hat, Inc.
>> Email: [hidden email]
>> <http:///user/SendEmail.jtp?type=node&node=5761545&i=1>
>> Twitter: davsclaus
>> Blog: http://davsclaus.com
>> Author of Camel in Action: http://www.manning.com/ibsen
>> hawtio: http://hawt.io/
>> fabric8: http://fabric8.io/
>>
>>
>> ------------------------------
>>  If you reply to this email, your message will be added to the discussion
>> below:
>>
>> http://camel.465427.n5.nabble.com/Help-FTP-SFTP-File-Delete-Problem-and-FTP-SFTP-Polling-Problem-tp5761486p5761545.html
>>  To unsubscribe from Help: FTP/SFTP File Delete Problem and FTP/SFTP
>> Polling Problem, click here
>> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5761486&code=d2lsbGNvdXJzZXJhQGdtYWlsLmNvbXw1NzYxNDg2fDc4ODg5MzE5OQ==>
>> .
>> NAML
>> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>>
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Help-FTP-SFTP-File-Delete-Problem-and-FTP-SFTP-Polling-Problem-tp5761486p5761561.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
hawtio: http://hawt.io/
fabric8: http://fabric8.io/

Re: Help: FTP/SFTP File Delete Problem and FTP/SFTP Polling Problem

Posted by yeandone <wi...@gmail.com>.
Thanks, Claus. Will try a new version. But do you know why it always
prompts the following warnings when the routes stops? Will they impact
anything and the original file?

1. If choose not to delete the file, it prompts when the route stops:

WARN Camel (platformSchedulerCamel) thread #7 - sftp://xxx
org.apache.camel.component.file.GenericFileOnCompletion - Rollback file
strategy:
org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy@4b474b47
for file: RemoteFile[a.txt]

2. If choose not to delete the file, it prompts when the route stops:
WARN Camel (platformSchedulerCamel) thread #7 - sftp://xxx
org.apache.camel.component.file.GenericFileOnCompletion - Rollback file
strategy:
org.apache.camel.component.file.strategy.GenericFileNoOpProcessStrategy@4b474b47
for file: RemoteFile[a.txt]



On Fri, Jan 9, 2015 at 11:24 PM, Claus Ibsen-2 [via Camel] <
ml-node+s465427n5761545h49@n5.nabble.com> wrote:

> Try with newer release, there may have been a bug fix
>
> On Fri, Jan 9, 2015 at 6:47 PM, yeandone <[hidden email]
> <http:///user/SendEmail.jtp?type=node&node=5761545&i=0>> wrote:
>
> > HI, Claus.
> >
> >   Thanks for the prompt reply! I am using Camel 2.12. I also tried
> adding
> > aync=true in controlbus
> > <to uri="controlbus:route?routeId=A_Route&amp;aync=true&amp;action=stop"
> />
> >
> >   It does help delete the file, but it has some issues with polling.
> Until
> > the file get deleted and control bus stops, the route still keeps
> polling
> > for a while. What I want to do is deleting original file after it's
> > processed by direct: a and direct: b and then stop the route which will
> stop
> > the file polling from the sftp location. If nothing is picked, then I
> want
> > to do some processing in direct:b and then stop the route and polling
> > immediately.  Any ideas to resolve the issue?
> >
> >  Thanks
> >
> >
> >
> > --
> > View this message in context:
> http://camel.465427.n5.nabble.com/Help-FTP-SFTP-File-Delete-Problem-and-FTP-SFTP-Polling-Problem-tp5761486p5761535.html
> > Sent from the Camel - Users mailing list archive at Nabble.com.
>
>
>
> --
> Claus Ibsen
> -----------------
> Red Hat, Inc.
> Email: [hidden email]
> <http:///user/SendEmail.jtp?type=node&node=5761545&i=1>
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen
> hawtio: http://hawt.io/
> fabric8: http://fabric8.io/
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://camel.465427.n5.nabble.com/Help-FTP-SFTP-File-Delete-Problem-and-FTP-SFTP-Polling-Problem-tp5761486p5761545.html
>  To unsubscribe from Help: FTP/SFTP File Delete Problem and FTP/SFTP
> Polling Problem, click here
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5761486&code=d2lsbGNvdXJzZXJhQGdtYWlsLmNvbXw1NzYxNDg2fDc4ODg5MzE5OQ==>
> .
> NAML
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://camel.465427.n5.nabble.com/Help-FTP-SFTP-File-Delete-Problem-and-FTP-SFTP-Polling-Problem-tp5761486p5761561.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Help: FTP/SFTP File Delete Problem and FTP/SFTP Polling Problem

Posted by Claus Ibsen <cl...@gmail.com>.
Try with newer release, there may have been a bug fix

On Fri, Jan 9, 2015 at 6:47 PM, yeandone <wi...@gmail.com> wrote:
> HI, Claus.
>
>   Thanks for the prompt reply! I am using Camel 2.12. I also tried adding
> aync=true in controlbus
> <to uri="controlbus:route?routeId=A_Route&amp;aync=true&amp;action=stop" />
>
>   It does help delete the file, but it has some issues with polling. Until
> the file get deleted and control bus stops, the route still keeps polling
> for a while. What I want to do is deleting original file after it's
> processed by direct: a and direct: b and then stop the route which will stop
> the file polling from the sftp location. If nothing is picked, then I want
> to do some processing in direct:b and then stop the route and polling
> immediately.  Any ideas to resolve the issue?
>
>  Thanks
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Help-FTP-SFTP-File-Delete-Problem-and-FTP-SFTP-Polling-Problem-tp5761486p5761535.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
hawtio: http://hawt.io/
fabric8: http://fabric8.io/

Re: Help: FTP/SFTP File Delete Problem and FTP/SFTP Polling Problem

Posted by yeandone <wi...@gmail.com>.
HI, Claus.

  Thanks for the prompt reply! I am using Camel 2.12. I also tried adding
aync=true in controlbus 
<to uri="controlbus:route?routeId=A_Route&amp;aync=true&amp;action=stop" />

  It does help delete the file, but it has some issues with polling. Until
the file get deleted and control bus stops, the route still keeps polling
for a while. What I want to do is deleting original file after it's
processed by direct: a and direct: b and then stop the route which will stop
the file polling from the sftp location. If nothing is picked, then I want
to do some processing in direct:b and then stop the route and polling
immediately.  Any ideas to resolve the issue?

 Thanks



--
View this message in context: http://camel.465427.n5.nabble.com/Help-FTP-SFTP-File-Delete-Problem-and-FTP-SFTP-Polling-Problem-tp5761486p5761535.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Help: FTP/SFTP File Delete Problem and FTP/SFTP Polling Problem

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

What version of Camel do you use?

Also you can try set async=true on the controlbus

On Fri, Jan 9, 2015 at 8:05 AM, yeandone <wi...@gmail.com> wrote:
> Hi, All.
>
>   I have an issue deleting a file with delete=true from a SFTP consumer.  My
> route looks like the following:
> <route id="A_ROUTE">
>                 <from
> uri="sftp:amdin@xxx.com?password=xxx&amp;delete=true&amp;filter=#fileFilter"/>
>                         <choice>
>                                 <when>
>                                         <simple>${body} != null</simple>
>                                         <multicast>
>                                         <to uri="direct:a"/>
>                                         <to uri="direct:b"/>
>                                     </multicast>
>                            </when>
>                                 <otherwise>
>                                         <to uri="direct:b"/>
>                                 </otherwise>
>                         </choice>
>                         <to uri="controlbus:route?routeId=A_Route&amp;action=stop" />
> </route>
>
> whenever it runs, it will end up
> WARN Camel (platformSchedulerCamel) thread #7 - sftp://xxx
> org.apache.camel.component.file.GenericFileOnCompletion - Rollback file
> strategy:
> org.apache.camel.component.file.strategy.GenericFileDeleteProcessStrategy@4b474b47
> for file: RemoteFile[a.txt]
>
> Does anyone have any idea why it happens? What I want to do is deleting
> original file after it's processed by direct: a and direct: b and then stop
> the route which will stop the file polling from the sftp location. If
> nothing is picked, then I want to do some processing in direct:b and then
> stop the route.
>
> If I remove
> <to uri="controlbus:route?routeId=A_Route&amp;action=stop" /> at the end,
> the file will be deleted. However, the sftp consumer will never stop and
> keep polling stfp, which I do not want to happen.
>
> Any help or any ideas will be appreciated!!!
>
> Thanks,
> W
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Help-FTP-SFTP-File-Delete-Problem-and-FTP-SFTP-Polling-Problem-tp5761486.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
hawtio: http://hawt.io/
fabric8: http://fabric8.io/