You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Bharath <bh...@gmail.com> on 2013/12/12 11:29:44 UTC

LocalWorkDirectory is not working when used with multicast

Hi,

    My route is

<from
uri="sftp://hostname:22/input?username=xxxx&amp;password=yyyyy&amp;binary=true&amp;localWorkDirectory=/tmp"
/>
<multicast>
	<to uri="file:/mnt/input" />
        <to uri="file:/mnt/output" />
</multicast>

1) I placed abc.xml in sftp location the file is being transferred only to
/mnt/input
2) /mnt/output is empty
3) I am getting the following exception 
    
(MessageId: ID-bharath-desktop-32973-1386840329681-8-629 on ExchangeId:
ID-bharath-desktop-32973-1386840329681-8-632). Exhausted after delivery
attempt: 1 caught:
org.apache.camel.component.file.GenericFileOperationFailedException: Cannot
store file: /mnt/input/abc.xml
org.apache.camel.component.file.GenericFileOperationFailedException: Cannot
store file: /mnt/input/abc.xml
	at
org.apache.camel.component.file.FileOperations.storeFile(FileOperations.java:264)[148:org.apache.camel.camel-core:2.10.0.fuse-71-047]
	at
org.apache.camel.component.file.GenericFileProducer.writeFile(GenericFileProducer.java:249)[148:org.apache.camel.camel-core:2.10.0.fuse-71-047]
	at
org.apache.camel.component.file.GenericFileProducer.processExchange(GenericFileProducer.java:151)[148:org.apache.camel.camel-core:2.10.0.fuse-71-047]

Caused by: java.io.FileNotFoundException: /tmp/abc.xml (No such file or
directory)
	at java.io.FileInputStream.open(Native Method)[:1.7.0_21]
	at java.io.FileInputStream.<init>(FileInputStream.java:138)[:1.7.0_21]
	at
org.apache.camel.util.FileUtil.copyFile(FileUtil.java:398)[148:org.apache.camel.camel-core:2.10.0.fuse-71-047]
	at
org.apache.camel.util.FileUtil.renameFile(FileUtil.java:382)[148:org.apache.camel.camel-core:2.10.0.fuse-71-047]
	at
org.apache.camel.component.file.FileOperations.writeFileByLocalWorkPath(FileOperations.java:341)[148:org.apache.camel.camel-core:2.10.0.fuse-71-047]

What should I do to get this working?

Camel Version is 2.10.0

Cheers!!!
Bharath.R




--
View this message in context: http://camel.465427.n5.nabble.com/LocalWorkDirectory-is-not-working-when-used-with-multicast-tp5744664.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: LocalWorkDirectory is not working when used with multicast

Posted by Claus Ibsen <cl...@gmail.com>.
Just try with

from  ftp
  to file a
  to file b



On Thu, Dec 12, 2013 at 11:59 AM, Bharath <bh...@gmail.com> wrote:
> Thanks Claus for your quick response!!
>
> It is one of the use case in my application
>
> Just now i tried with parallelProcessing=true option in multicast it worked
> :)
>
> I could able to see the files in both /mnt/input and also /mnt/output
>
> Even though the files are transferred successfully I am getting same
> exceptions in the log and also delete=true option is not working when i
> include in the above sftp endpoint
>
> Cheers!!!
> Bharath.R
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/LocalWorkDirectory-is-not-working-when-used-with-multicast-tp5744664p5744667.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
Make your Camel applications look hawt, try: http://hawt.io

Re: LocalWorkDirectory is not working when used with multicast

Posted by Bharath <bh...@gmail.com>.
Thanks Claus for your quick response!!

It is one of the use case in my application

Just now i tried with parallelProcessing=true option in multicast it worked
:)

I could able to see the files in both /mnt/input and also /mnt/output

Even though the files are transferred successfully I am getting same
exceptions in the log and also delete=true option is not working when i
include in the above sftp endpoint

Cheers!!!
Bharath.R



--
View this message in context: http://camel.465427.n5.nabble.com/LocalWorkDirectory-is-not-working-when-used-with-multicast-tp5744664p5744667.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: LocalWorkDirectory is not working when used with multicast

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

This is expected. As the file component when using local work dir does
a fast-copy by renaming the file. And that can only work once.

So dont do the multicast.

And why do you do that. Is it just for fun, or is there any real life
use-case for that?



On Thu, Dec 12, 2013 at 11:29 AM, Bharath <bh...@gmail.com> wrote:
> Hi,
>
>     My route is
>
> <from
> uri="sftp://hostname:22/input?username=xxxx&amp;password=yyyyy&amp;binary=true&amp;localWorkDirectory=/tmp"
> />
> <multicast>
>         <to uri="file:/mnt/input" />
>         <to uri="file:/mnt/output" />
> </multicast>
>
> 1) I placed abc.xml in sftp location the file is being transferred only to
> /mnt/input
> 2) /mnt/output is empty
> 3) I am getting the following exception
>
> (MessageId: ID-bharath-desktop-32973-1386840329681-8-629 on ExchangeId:
> ID-bharath-desktop-32973-1386840329681-8-632). Exhausted after delivery
> attempt: 1 caught:
> org.apache.camel.component.file.GenericFileOperationFailedException: Cannot
> store file: /mnt/input/abc.xml
> org.apache.camel.component.file.GenericFileOperationFailedException: Cannot
> store file: /mnt/input/abc.xml
>         at
> org.apache.camel.component.file.FileOperations.storeFile(FileOperations.java:264)[148:org.apache.camel.camel-core:2.10.0.fuse-71-047]
>         at
> org.apache.camel.component.file.GenericFileProducer.writeFile(GenericFileProducer.java:249)[148:org.apache.camel.camel-core:2.10.0.fuse-71-047]
>         at
> org.apache.camel.component.file.GenericFileProducer.processExchange(GenericFileProducer.java:151)[148:org.apache.camel.camel-core:2.10.0.fuse-71-047]
>
> Caused by: java.io.FileNotFoundException: /tmp/abc.xml (No such file or
> directory)
>         at java.io.FileInputStream.open(Native Method)[:1.7.0_21]
>         at java.io.FileInputStream.<init>(FileInputStream.java:138)[:1.7.0_21]
>         at
> org.apache.camel.util.FileUtil.copyFile(FileUtil.java:398)[148:org.apache.camel.camel-core:2.10.0.fuse-71-047]
>         at
> org.apache.camel.util.FileUtil.renameFile(FileUtil.java:382)[148:org.apache.camel.camel-core:2.10.0.fuse-71-047]
>         at
> org.apache.camel.component.file.FileOperations.writeFileByLocalWorkPath(FileOperations.java:341)[148:org.apache.camel.camel-core:2.10.0.fuse-71-047]
>
> What should I do to get this working?
>
> Camel Version is 2.10.0
>
> Cheers!!!
> Bharath.R
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/LocalWorkDirectory-is-not-working-when-used-with-multicast-tp5744664.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
Make your Camel applications look hawt, try: http://hawt.io