Re: camel-ftp idempotent repository and Exchange commit

2020-11-23 Thread Robin Vanderhallen
Hi Claus,

Thanks for the reply. Can I still use the idempotent repository to prevent 
different nodes from processing the same file even though
the idempotent read lock is not supported? I don’t see any limitations on using 
an idempotent repository on the FTP endpoint.
On 23 Nov 2020, 09:44 +0100, Claus Ibsen , wrote:
> The ftp component does not support idempotent read locks, so you
> cannot do what you do.
>
> On Sun, Nov 22, 2020 at 8:05 AM Robin Vanderhallen
>  wrote:
> >
> > Hi,
> >
> > I’m using file and FTP consumer endpoints (Camel 2.22.1) in a clustered 
> > setup, backed with Hazelcast and write-through persistence using the 
> > following endpoint options:
> > idempotent=true&idempotentRepository=#hazelcastIdempotentRepository&idempotentKey=#keyExpression&readLock=idempotent-changed
> >  for the file endpoint
> > idempotent=true&idempotentRepository=#hazelcastIdempotentRepository&idempotentKey=#keyExpression&readLock=changed
> >  for the FTP endpoint
> >
> > I discovered that there is a difference in the behaviour of both endpoints:
> >
> > file component: confirm method is invoked after processing the files
> > FTP component: confirm method is not invoked after processing the files
> >
> > When readLock=idempotent-changed is set on the file endpoint, 
> > FileIdempotentChangedRepositoryReadLockStrategy is being used and the 
> > releaseExclusiveReadLockOnCommit method is
> > invoked which triggers the confirm method on the idempotent repository.
> > According to the Camel docs this type of read lock is not supported by the 
> > FTP component. In my setup FtpChangedExclusiveReadLockStrategy is being 
> > used, which is never invoking the confirm method
> > on the idempotent repository (releaseExclusiveReadLockOnCommit is an empty 
> > method).
> >
> > I read the following in the Camel in Action book: To commit the Exchange, 
> > the confirm method is invoked on the idempotent repository
> >
> > Does this imply that the Exchange is never committed in case of the FTP 
> > component. Is this expected behaviour?
> >
> > Thanks,
> >
> > Robin
>
>
>
> --
> Claus Ibsen
> -
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2


camel-ftp idempotent repository and Exchange commit

2020-11-21 Thread Robin Vanderhallen
Hi,

I’m using file and FTP consumer endpoints (Camel 2.22.1) in a clustered setup, 
backed with Hazelcast and write-through persistence using the following 
endpoint options:
idempotent=true&idempotentRepository=#hazelcastIdempotentRepository&idempotentKey=#keyExpression&readLock=idempotent-changed
 for the file endpoint
idempotent=true&idempotentRepository=#hazelcastIdempotentRepository&idempotentKey=#keyExpression&readLock=changed
 for the FTP endpoint

I discovered that there is a difference in the behaviour of both endpoints:

file component: confirm method is invoked after processing the files
FTP component: confirm method is not invoked after processing the files

When readLock=idempotent-changed is set on the file endpoint, 
FileIdempotentChangedRepositoryReadLockStrategy is being used and the 
releaseExclusiveReadLockOnCommit method is
invoked which triggers the confirm method on the idempotent repository.
According to the Camel docs this type of read lock is not supported by the FTP 
component. In my setup FtpChangedExclusiveReadLockStrategy is being used, which 
is never invoking the confirm method
on the idempotent repository (releaseExclusiveReadLockOnCommit is an empty 
method).

I read the following in the Camel in Action book: To commit the Exchange, the 
confirm method is invoked on the idempotent repository

Does this imply that the Exchange is never committed in case of the FTP 
component. Is this expected behaviour?

Thanks,

Robin


Re: building Camel in IntelliJ

2019-12-20 Thread Robin Vanderhallen
I’m sure it’s JDK 8. The module class path shows 
/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home.
For some reason, the jdk9+-build profile was enabled automatically in IntelliJ 
(the checkbox is greyed out). This happens for every module I’m opening.
It’s working fine after I uncheck the JDK9 profile and manually select 
jdk8-build.

Regards,

Robin
On 20 Dec 2019, 09:16 +0100, Claus Ibsen , wrote:
> Sounds a bit like you get it build with a java 9 or higher. Can you
> double check that its all JDK 8 in IDEA.
>
> Camel 2.x only support java 8. Java 11 was not fully supported, use
> Camel 3 for that.
>
> On Fri, Dec 20, 2019 at 8:22 AM Robin Vanderhallen
>  wrote:
> >
> > I was trying to build the 2.24.x branch. I did open the entire project. It 
> > works better when I build the sources and open a single module.
> > But when I try to run a test in IntelliJ, I get the following error: 
> > Error:java: invalid flag: -Jjava.xml.bind
> >
> > It’s one of the arguments of the maven-compiler-plugin in the parent POM.
> >
> > 
> > -J--add-modules
> > -Jjava.xml.bind
> > 
> > -parameters
> > 
> >
> > I’m using OpenJDK 1.8.0_202.
> >
> > Regards,
> >
> > Robin
> > On 19 Dec 2019, 17:23 +0100, Omar Al-Safi , wrote:
> > > Oh yeah I never actually ran mvn:idea, I just open it directly in intellj,
> > > most importantly by submodules. Not sure if that is still valid though
> > >
> > > On Thu, Dec 19, 2019, 17:20 Omar Al-Safi  wrote:
> > >
> > > > Which camel version are you referring to? Also, I hope you are not 
> > > > opening
> > > > the full project in intellj as that may cause problems. You can try only
> > > > opening the submodules of the project, e.g: only one component to open 
> > > > in
> > > > intellj.
> > > >
> > > > Regards,
> > > > Omar
> > > >
> > > > On Thu, Dec 19, 2019, 17:05 Robin Vanderhallen <
> > > > robinvanderhal...@gmail.com> wrote:
> > > >
> > > > > Hello,
> > > > >
> > > > > I’m having trouble building Camel from source in IntelliJ. I followed 
> > > > > the
> > > > > instructions on https://camel.apache.org/manual/latest/building.html
> > > > > However, mvn idea:idea is throwing an exception:
> > > > >
> > > > > Failed to execute goal
> > > > > org.apache.maven.plugins:maven-idea-plugin:2.3-atlassian-10:idea
> > > > > (default-cli) on project camel-parent: Execution default-cli of goal
> > > > > org.apache.maven.plugins:maven-idea-plugin:2.3-atlassian-10:idea 
> > > > > failed.:
> > > > > NullPointerException
> > > > >
> > > > > Caused by: java.lang.NullPointerException
> > > > > at org.apache.maven.plugin.idea.IdeaModuleMojo.getLibraryUrl
> > > > > (IdeaModuleMojo.java:1141)
> > > > > at org.apache.maven.plugin.idea.IdeaModuleMojo.rewriteDependencies
> > > > > (IdeaModuleMojo.java:531)
> > > > > at org.apache.maven.plugin.idea.IdeaModuleMojo.rewriteModule
> > > > > (IdeaModuleMojo.java:423)
> > > > > at org.apache.maven.plugin.idea.IdeaMojo.rewriteModule
> > > > > (IdeaMojo.java:236)
> > > > > at org.apache.maven.plugin.idea.IdeaMojo.execute (IdeaMojo.java:216)
> > > > > at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo
> > > > > (DefaultBuildPluginManager.java:137)
> > > > > at org.apache.maven.lifecycle.internal.MojoExecutor.execute
> > > > > (MojoExecutor.java:210)
> > > > > at org.apache.maven.lifecycle.internal.MojoExecutor.execute
> > > > > (MojoExecutor.java:156)
> > > > > at org.apache.maven.lifecycle.internal.MojoExecutor.execute
> > > > > (MojoExecutor.java:148)
> > > > > at
> > > > > org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject
> > > > > (LifecycleModuleBuilder.java:117)
> > > > > at
> > > > > org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject
> > > > > (LifecycleModuleBuilder.java:81)
> > > > > at
> > > > > org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build
> > > > > (SingleThreadedBuilder.java:56)
> > > > > at org.apache.maven.lifecycle.internal.LifecycleStarter.execute
> > > 

Re: building Camel in IntelliJ

2019-12-19 Thread Robin Vanderhallen
I was trying to build the 2.24.x branch. I did open the entire project. It 
works better when I build the sources and open a single module.
But when I try to run a test in IntelliJ, I get the following error: 
Error:java: invalid flag: -Jjava.xml.bind

It’s one of the arguments of the maven-compiler-plugin in the parent POM.


     -J--add-modules
     -Jjava.xml.bind
     
     -parameters


I’m using OpenJDK 1.8.0_202.

Regards,

Robin
On 19 Dec 2019, 17:23 +0100, Omar Al-Safi , wrote:
> Oh yeah I never actually ran mvn:idea, I just open it directly in intellj,
> most importantly by submodules. Not sure if that is still valid though
>
> On Thu, Dec 19, 2019, 17:20 Omar Al-Safi  wrote:
>
> > Which camel version are you referring to? Also, I hope you are not opening
> > the full project in intellj as that may cause problems. You can try only
> > opening the submodules of the project, e.g: only one component to open in
> > intellj.
> >
> > Regards,
> > Omar
> >
> > On Thu, Dec 19, 2019, 17:05 Robin Vanderhallen <
> > robinvanderhal...@gmail.com> wrote:
> >
> > > Hello,
> > >
> > > I’m having trouble building Camel from source in IntelliJ. I followed the
> > > instructions on https://camel.apache.org/manual/latest/building.html
> > > However, mvn idea:idea is throwing an exception:
> > >
> > > Failed to execute goal
> > > org.apache.maven.plugins:maven-idea-plugin:2.3-atlassian-10:idea
> > > (default-cli) on project camel-parent: Execution default-cli of goal
> > > org.apache.maven.plugins:maven-idea-plugin:2.3-atlassian-10:idea failed.:
> > > NullPointerException
> > >
> > > Caused by: java.lang.NullPointerException
> > > at org.apache.maven.plugin.idea.IdeaModuleMojo.getLibraryUrl
> > > (IdeaModuleMojo.java:1141)
> > > at org.apache.maven.plugin.idea.IdeaModuleMojo.rewriteDependencies
> > > (IdeaModuleMojo.java:531)
> > > at org.apache.maven.plugin.idea.IdeaModuleMojo.rewriteModule
> > > (IdeaModuleMojo.java:423)
> > > at org.apache.maven.plugin.idea.IdeaMojo.rewriteModule
> > > (IdeaMojo.java:236)
> > > at org.apache.maven.plugin.idea.IdeaMojo.execute (IdeaMojo.java:216)
> > > at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo
> > > (DefaultBuildPluginManager.java:137)
> > > at org.apache.maven.lifecycle.internal.MojoExecutor.execute
> > > (MojoExecutor.java:210)
> > > at org.apache.maven.lifecycle.internal.MojoExecutor.execute
> > > (MojoExecutor.java:156)
> > > at org.apache.maven.lifecycle.internal.MojoExecutor.execute
> > > (MojoExecutor.java:148)
> > > at
> > > org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject
> > > (LifecycleModuleBuilder.java:117)
> > > at
> > > org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject
> > > (LifecycleModuleBuilder.java:81)
> > > at
> > > org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build
> > > (SingleThreadedBuilder.java:56)
> > > at org.apache.maven.lifecycle.internal.LifecycleStarter.execute
> > > (LifecycleStarter.java:128)
> > > at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
> > > at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
> > > at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
> > > at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
> > > at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
> > > at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
> > > at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
> > > at sun.reflect.NativeMethodAccessorImpl.invoke
> > > (NativeMethodAccessorImpl.java:62)
> > > at sun.reflect.DelegatingMethodAccessorImpl.invoke
> > > (DelegatingMethodAccessorImpl.java:43)
> > > at java.lang.reflect.Method.invoke (Method.java:498)
> > > at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced
> > > (Launcher.java:289)
> > > at org.codehaus.plexus.classworlds.launcher.Launcher.launch
> > > (Launcher.java:229)
> > > at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode
> > > (Launcher.java:415)
> > > at org.codehaus.plexus.classworlds.launcher.Launcher.main
> > > (Launcher.java:356)
> > >
> > > It looks like the Maven IDEA plugin is no longer maintained.
> > >
> > > I’m sure there must be other IntelliJ users building Camel. How are you
> > > handling this?
> > >
> > > Best regards,
> > >
> > > Robin
> > >
> > >


building Camel in IntelliJ

2019-12-19 Thread Robin Vanderhallen
Hello,

I’m having trouble building Camel from source in IntelliJ. I followed the 
instructions on https://camel.apache.org/manual/latest/building.html
However, mvn idea:idea is throwing an exception:

Failed to execute goal 
org.apache.maven.plugins:maven-idea-plugin:2.3-atlassian-10:idea (default-cli) 
on project camel-parent: Execution default-cli of goal 
org.apache.maven.plugins:maven-idea-plugin:2.3-atlassian-10:idea failed.: 
NullPointerException

Caused by: java.lang.NullPointerException
    at org.apache.maven.plugin.idea.IdeaModuleMojo.getLibraryUrl 
(IdeaModuleMojo.java:1141)
    at org.apache.maven.plugin.idea.IdeaModuleMojo.rewriteDependencies 
(IdeaModuleMojo.java:531)
    at org.apache.maven.plugin.idea.IdeaModuleMojo.rewriteModule 
(IdeaModuleMojo.java:423)
    at org.apache.maven.plugin.idea.IdeaMojo.rewriteModule (IdeaMojo.java:236)
    at org.apache.maven.plugin.idea.IdeaMojo.execute (IdeaMojo.java:216)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo 
(DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute 
(MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute 
(MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute 
(MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject 
(LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject 
(LifecycleModuleBuilder.java:81)
    at 
org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build
 (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute 
(LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke 
(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke 
(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced 
(Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch 
(Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode 
(Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main 
(Launcher.java:356)

It looks like the Maven IDEA plugin is no longer maintained.

I’m sure there must be other IntelliJ users building Camel. How are you 
handling this?

Best regards,

Robin



Re: host not found when using http4 in docker container

2018-06-05 Thread Robin Vanderhallen
Are both containers in the same network in the docker compose file?
On 5 Jun 2018, 19:29 +0200, Tim Dudgeon , wrote:
> I'm running camel inside a Docker container and trying to use the HTTP4
> component to post a request to a service running in a different
> container (both containers are managed through Docker compose).
> Essentially I'm trying to do a post to a route like this:
> http4:coreservices:8080/coreservices/rest/v1/services
> where coreservices is the name of the other container.
>
> This fails with a  java.net.UnknownHostException (see below).
> But the other container is definitely accessible from this container as
> if I open a shell in it I can the curl the 'coreservices' host.
>
> Any idea what's going wrong here?
>
> Thanks
> Tim
>
>
> 05-Jun-2018 17:09:34.667 SEVERE [localhost-startStop-1]
> org.apache.camel.util.CamelLogger.log Failed delivery for (MessageId:
> ID-4b81ce1e6383-46459-1528218572076-1-3 on ExchangeId:
> ID-4b81ce1e6383-46459-1528218572076-1-2). Exhausted after delivery
> attempt: 1 caught: java.net.UnknownHostException: coreservices: Name or
> service not known
>
> Message History
> ---
> RouteId  ProcessorId Processor Elapsed (ms)
> [route6    ] [route6    ]
> [direct://post-service-descriptors ] [   283]
> [route6    ] [log1  ] [log ] [ 5]
> [route6    ] [process1  ] [Processor@0xa8e9d5 ] [   173]
> [route6    ] [to1   ]
> [http4:coreservices:8080/coreservices/rest/v1/services ] [    95]
>
> Stacktrace
> ---
>  java.net.UnknownHostException: coreservices: Name or service not known
>     at java.net.Inet4AddressImpl.lookupAllHostAddr(Native Method)
>     at java.net.InetAddress$2.lookupAllHostAddr(InetAddress.java:928)
>     at
> java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1323)
>     at java.net.InetAddress.getAllByName0(InetAddress.java:1276)
>     at java.net.InetAddress.getAllByName(InetAddress.java:1192)
>     at java.net.InetAddress.getAllByName(InetAddress.java:1126)
>     at
> org.apache.http.impl.conn.SystemDefaultDnsResolver.resolve(SystemDefaultDnsResolver.java:45)
>     at
> org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:111)
>     at
> org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:353)
>     at
> org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:380)
>     at
> org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
>     at
> org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184)
>     at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88)
>     at
> org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
>     at
> org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)
>     at
> org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
>     at
> org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:55)
>     at
> org.apache.camel.component.http4.HttpProducer.executeMethod(HttpProducer.java:306)
>     at
> org.apache.camel.component.http4.HttpProducer.process(HttpProducer.java:178)
>     at
> org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)
>     at
> org.apache.camel.processor.SendProcessor.process(SendProcessor.java:145)
>     at
> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:77)
>     at
> org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:542)
>     at
> org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:197)
>     at org.apache.camel.processor.Pipeline.process(Pipeline.java:120)
>     at org.apache.camel.processor.Pipeline.process(Pipeline.java:83)
>     at
> org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:197)
>     at
> org.apache.camel.component.direct.DirectProducer.process(DirectProducer.java:62)
>     at
> org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:197)
>     at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:97)
>     at
> org.apache.camel.impl.ProducerCache$1.doInProducer(ProducerCache.java:529)
>     at
> org.apache.camel.impl.ProducerCache$1.doInProducer(ProducerCache.java:497)
>     at
> org.apache.camel.impl.ProducerCache.doInProducer(ProducerCache.java:365)
>     at
> org.apache.camel.impl.ProducerCache.sendExchange(ProducerCache

Printer component: copies option not working as expected

2018-01-26 Thread Robin Vanderhallen
Hi,

I’m using the Camel printer component to send PDF files to a print queue. When 
I configure the endpoint like this, the lpr command is executed twice with the 
-#2 parameter:
lpr://localhost/printer?copies=2&mediaSize=ISO_A4&flavor=DocFlavor.INPUT_STREAM

component.printer.PrinterProducer DEBUG Printer service printer name: printer
component.printer.PrinterOperations DEBUG Issuing Job 0 to Printer: printer
component.printer.PrinterOperations DEBUG Issuing Job 1 to Printer: printer
ERROR ID-47935-1516954952584-8-4
java.io.IOException: error=1 running: '/usr/bin/lpr' '-Pprinter' '-J file.pdf' 
'-#2' '-o media=A4 sides=one-sided' 
'/opt/tomcat/temp/javaprint7376295310894617090'
/usr/bin/lpr: No file in print request.
javax.print.PrintException: java.io.IOException: error=1 running: 
'/usr/bin/lpr' '-PBriefing' '-J file.pdf' '-#2' '-o media=A4 sides=one-sided' 
'/opt/tomcat/temp/javaprint7376295310894617090'
/usr/bin/lpr: No file in print request.
at sun.print.UnixPrintJob$PrinterSpooler.run(UnixPrintJob.java:1017)
at java.security.AccessController.doPrivileged(Native Method)
at sun.print.UnixPrintJob.print(UnixPrintJob.java:608)
at 
org.apache.camel.component.printer.PrinterOperations.print(PrinterOperations.java:109)
at 
org.apache.camel.component.printer.PrinterOperations.print(PrinterOperations.java:99)
at 
org.apache.camel.component.printer.PrinterProducer.print(PrinterProducer.java:57)
at 
org.apache.camel.component.printer.PrinterProducer.process(PrinterProducer.java:51)
at 
org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)
at 
org.apache.camel.processor.SendDynamicProcessor$1.doInAsyncProducer(SendDynamicProcessor.java:124)
at 
org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:436)
at 
org.apache.camel.processor.SendDynamicProcessor.process(SendDynamicProcessor.java:119)
at 
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:77)
at 
org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:542)
at 
org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:197)
at 
org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:197)
at 
org.apache.camel.component.direct.DirectProducer.process(DirectProducer.java:62)
at 
org.apache.camel.processor.SendProcessor.process(SendProcessor.java:145)
at 
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:77)
at 
org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:542)
at 
org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:197)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:120)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:83)
at 
org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:542)
at 
org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:197)
at 
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:109)
at 
org.apache.camel.processor.MulticastProcessor.doProcessParallel(MulticastProcessor.java:827)
at 
org.apache.camel.processor.MulticastProcessor.access$200(MulticastProcessor.java:85)
at 
org.apache.camel.processor.MulticastProcessor$1.call(MulticastProcessor.java:320)
at 
org.apache.camel.processor.MulticastProcessor$1.call(MulticastProcessor.java:305)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

The first job executes correctly, the second one fails because the input file 
is empty. Why is the lpr command executed twice? The -#2 parameter already 
schedules the desired number of copies.

I think the issue is caused by the following statement being inside the loop:
https://github.com/apache/camel/blob/3505e718db48cc0d8be5b47f6c4030c958d93a5f/components/camel-printer/src/main/java/org/apache/camel/component/printer/PrinterOperations.java#L99
 


I’m using Camel 2.18.1 on JDK8.

Best regards,

Robin


-- 


AVIO

Herkenrodesingel 8/D.3.01

3500 Hasselt

Belgium

T +32 11 72 10 30

www.avio.aero 

Avio - A Thales Group Company

The information contained in this message may be privileged and 
confid