Re: Camel resources URI into OSGi environment

2013-07-16 Thread Cristiano Costantini
I must update my previous question:
velocity in facts works fine, it is just xslt which causing issues!

My test route is in fact:



Foo






the velocity: endpoint works, it is the xslt: which fail...
I'm able to run it if I use the full path for just the XSL file:




Foo






Anyone has any suggestion on how to address this problem?

My only suspect is that when I run from eclipse a simple java class with a
main(String[] args) method where I start a  ConfigurableApplicationContext)
where it works, and when I deploy on OSGi, I'm actually using two different
XSLT processors, but I'm not sure how to debug it...

thank you again,

Cristiano




2013/7/16 Cristiano Costantini 

> Hello,
>
> I just tried to deploy my camel routes into an OSGi environment
> (ServiceMix).
>
> I've made a simple maven project with just resources (the beans.xml, .xsl
> and .vm files),
> however the XSLT and Velocity endpoints cannot find the associated files (
> with exception "Failed to resolve endpoint: xslt://testTransform.xsl due
> to: java.io.FileNotFoundException: Cannot find resource in classpath for
> URI: testTransform.xsl").
>
> If I run the route locally (in a simple java console application)
> everything works fine.
>
> Anyone has experience on this type of deployment and can give me some hint?
>
> Thank you,
> Cristiano
>


Re: Camel resources URI into OSGi environment

2013-07-16 Thread Claus Ibsen
If the xsl file is in the classpath of your own bundle, then you need
to export this package. Looks like you put it in a test package.

On Tue, Jul 16, 2013 at 9:27 AM, Cristiano Costantini
 wrote:
> I must update my previous question:
> velocity in facts works fine, it is just xslt which causing issues!
>
> My test route is in fact:
> 
> 
> 
> Foo
> 
> 
> 
> 
> 
>
> the velocity: endpoint works, it is the xslt: which fail...
> I'm able to run it if I use the full path for just the XSL file:
>
> 
> 
> 
> Foo
> 
> 
>  uri="xslt://file:///C:/dev/Sandbox/osgi-deploy-test/src/main/resources/test/test.xsl"
> />
> 
> 
>
> Anyone has any suggestion on how to address this problem?
>
> My only suspect is that when I run from eclipse a simple java class with a
> main(String[] args) method where I start a  ConfigurableApplicationContext)
> where it works, and when I deploy on OSGi, I'm actually using two different
> XSLT processors, but I'm not sure how to debug it...
>
> thank you again,
>
> Cristiano
>
>
>
>
> 2013/7/16 Cristiano Costantini 
>
>> Hello,
>>
>> I just tried to deploy my camel routes into an OSGi environment
>> (ServiceMix).
>>
>> I've made a simple maven project with just resources (the beans.xml, .xsl
>> and .vm files),
>> however the XSLT and Velocity endpoints cannot find the associated files (
>> with exception "Failed to resolve endpoint: xslt://testTransform.xsl due
>> to: java.io.FileNotFoundException: Cannot find resource in classpath for
>> URI: testTransform.xsl").
>>
>> If I run the route locally (in a simple java console application)
>> everything works fine.
>>
>> Anyone has experience on this type of deployment and can give me some hint?
>>
>> Thank you,
>> Cristiano
>>



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


Re: Camel resources URI into OSGi environment

2013-07-16 Thread Cristiano Costantini
Hi Claus and thank you,

the XSL file is on the "src/main/resources/test" folder, and in the same
folder there is the velocity template.

I've tried to add test to maven bundle
plugin but nothing changed.
Is this the correct way to export it?

also it's weird the velocity template on the same folder is found without
exporting explicitly the package, I expect I would have the same issue with
it.

The exception is caused on class ResourceHelper  ==>

Caused by: java.io.FileNotFoundException: Cannot find resource in classpath
for URI: vm\test.xsl
at
org.apache.camel.util.ResourceHelper.resolveMandatoryResourceAsInputStream(ResourceHelper.java:106)
at
org.apache.camel.builder.xml.XsltUriResolver.resolve(XsltUriResolver.java:81)

I will try to check the code of ResourceHelper but I don't know how to
debug when using OSGI (yet).

thank you,

Cristiano





2013/7/16 Claus Ibsen 

> If the xsl file is in the classpath of your own bundle, then you need
> to export this package. Looks like you put it in a test package.
>
> On Tue, Jul 16, 2013 at 9:27 AM, Cristiano Costantini
>  wrote:
> > I must update my previous question:
> > velocity in facts works fine, it is just xslt which causing issues!
> >
> > My test route is in fact:
> > 
> > 
> > 
> > Foo
> > 
> > 
> > 
> > 
> > 
> >
> > the velocity: endpoint works, it is the xslt: which fail...
> > I'm able to run it if I use the full path for just the XSL file:
> >
> > 
> > 
> > 
> > Foo
> > 
> > 
> >  >
> uri="xslt://file:///C:/dev/Sandbox/osgi-deploy-test/src/main/resources/test/test.xsl"
> > />
> > 
> > 
> >
> > Anyone has any suggestion on how to address this problem?
> >
> > My only suspect is that when I run from eclipse a simple java class with
> a
> > main(String[] args) method where I start a
>  ConfigurableApplicationContext)
> > where it works, and when I deploy on OSGi, I'm actually using two
> different
> > XSLT processors, but I'm not sure how to debug it...
> >
> > thank you again,
> >
> > Cristiano
> >
> >
> >
> >
> > 2013/7/16 Cristiano Costantini 
> >
> >> Hello,
> >>
> >> I just tried to deploy my camel routes into an OSGi environment
> >> (ServiceMix).
> >>
> >> I've made a simple maven project with just resources (the beans.xml,
> .xsl
> >> and .vm files),
> >> however the XSLT and Velocity endpoints cannot find the associated
> files (
> >> with exception "Failed to resolve endpoint: xslt://testTransform.xsl due
> >> to: java.io.FileNotFoundException: Cannot find resource in classpath for
> >> URI: testTransform.xsl").
> >>
> >> If I run the route locally (in a simple java console application)
> >> everything works fine.
> >>
> >> Anyone has experience on this type of deployment and can give me some
> hint?
> >>
> >> Thank you,
> >> Cristiano
> >>
>
>
>
> --
> Claus Ibsen
> -
> Red Hat, Inc.
> Email: cib...@redhat.com
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen
>


Re: Camel resources URI into OSGi environment

2013-07-16 Thread Andreas Gies
Elaborating on Claus' answer. The XSLT processor tries to resolve the XSLT
"test/test.xsl". 
In OSGI words, it has to resolve a package "test" which contains the
resource test.xsl. 

Though exporting the package "test" would probably work, I would strongly
recommend to have 
better qualified package names to avoid name clashes in exports.
Especially generically named
packages like "test" or "sample" may very well lead into a world of pain
(been there). 

Once you go about exporting packages, think what you want / need to expose
to other bundles. 
I always keep my internal stuff in a package ending in ".internal" and
have configured my builds
not to export something that matches this pattern.

Good luck 
Andreas







Am 7/16/13(29) 9:29 AM schrieb "Claus Ibsen" unter :

>If the xsl file is in the classpath of your own bundle, then you need
>to export this package. Looks like you put it in a test package.
>
>On Tue, Jul 16, 2013 at 9:27 AM, Cristiano Costantini
> wrote:
>> I must update my previous question:
>> velocity in facts works fine, it is just xslt which causing issues!
>>
>> My test route is in fact:
>> 
>> 
>> 
>> Foo
>> 
>> 
>> 
>> 
>> 
>>
>> the velocity: endpoint works, it is the xslt: which fail...
>> I'm able to run it if I use the full path for just the XSL file:
>>
>> 
>> 
>> 
>> Foo
>> 
>> 
>> > 
>>uri="xslt://file:///C:/dev/Sandbox/osgi-deploy-test/src/main/resources/te
>>st/test.xsl"
>> />
>> 
>> 
>>
>> Anyone has any suggestion on how to address this problem?
>>
>> My only suspect is that when I run from eclipse a simple java class
>>with a
>> main(String[] args) method where I start a
>>ConfigurableApplicationContext)
>> where it works, and when I deploy on OSGi, I'm actually using two
>>different
>> XSLT processors, but I'm not sure how to debug it...
>>
>> thank you again,
>>
>> Cristiano
>>
>>
>>
>>
>> 2013/7/16 Cristiano Costantini 
>>
>>> Hello,
>>>
>>> I just tried to deploy my camel routes into an OSGi environment
>>> (ServiceMix).
>>>
>>> I've made a simple maven project with just resources (the beans.xml,
>>>.xsl
>>> and .vm files),
>>> however the XSLT and Velocity endpoints cannot find the associated
>>>files (
>>> with exception "Failed to resolve endpoint: xslt://testTransform.xsl
>>>due
>>> to: java.io.FileNotFoundException: Cannot find resource in classpath
>>>for
>>> URI: testTransform.xsl").
>>>
>>> If I run the route locally (in a simple java console application)
>>> everything works fine.
>>>
>>> Anyone has experience on this type of deployment and can give me some
>>>hint?
>>>
>>> Thank you,
>>> Cristiano
>>>
>
>
>
>-- 
>Claus Ibsen
>-
>Red Hat, Inc.
>Email: cib...@redhat.com
>Twitter: davsclaus
>Blog: http://davsclaus.com
>Author of Camel in Action: http://www.manning.com/ibsen




Re: Camel resources URI into OSGi environment

2013-07-16 Thread Cristiano Costantini
Thank you Andreas for the hints on how to layout the packages.

(I'm just studying how to make it work and not yet started to refine the
code style,
I will surely take care of your recommendation.)

Could you confirm right way to export a resource in OSGi is to use the
 instruction?

Thank you,

Cristiano





2013/7/16 Andreas Gies 

> Elaborating on Claus' answer. The XSLT processor tries to resolve the XSLT
> "test/test.xsl".
> In OSGI words, it has to resolve a package "test" which contains the
> resource test.xsl.
>
> Though exporting the package "test" would probably work, I would strongly
> recommend to have
> better qualified package names to avoid name clashes in exports.
> Especially generically named
> packages like "test" or "sample" may very well lead into a world of pain
> (been there).
>
> Once you go about exporting packages, think what you want / need to expose
> to other bundles.
> I always keep my internal stuff in a package ending in ".internal" and
> have configured my builds
> not to export something that matches this pattern.
>
> Good luck
> Andreas
>
>
>
>
>
>
>
> Am 7/16/13(29) 9:29 AM schrieb "Claus Ibsen" unter  >:
>
> >If the xsl file is in the classpath of your own bundle, then you need
> >to export this package. Looks like you put it in a test package.
> >
> >On Tue, Jul 16, 2013 at 9:27 AM, Cristiano Costantini
> > wrote:
> >> I must update my previous question:
> >> velocity in facts works fine, it is just xslt which causing issues!
> >>
> >> My test route is in fact:
> >> 
> >> 
> >> 
> >> Foo
> >> 
> >> 
> >> 
> >> 
> >> 
> >>
> >> the velocity: endpoint works, it is the xslt: which fail...
> >> I'm able to run it if I use the full path for just the XSL file:
> >>
> >> 
> >> 
> >> 
> >> Foo
> >> 
> >> 
> >>  >>
> >>uri="xslt://file:///C:/dev/Sandbox/osgi-deploy-test/src/main/resources/te
> >>st/test.xsl"
> >> />
> >> 
> >> 
> >>
> >> Anyone has any suggestion on how to address this problem?
> >>
> >> My only suspect is that when I run from eclipse a simple java class
> >>with a
> >> main(String[] args) method where I start a
> >>ConfigurableApplicationContext)
> >> where it works, and when I deploy on OSGi, I'm actually using two
> >>different
> >> XSLT processors, but I'm not sure how to debug it...
> >>
> >> thank you again,
> >>
> >> Cristiano
> >>
> >>
> >>
> >>
> >> 2013/7/16 Cristiano Costantini 
> >>
> >>> Hello,
> >>>
> >>> I just tried to deploy my camel routes into an OSGi environment
> >>> (ServiceMix).
> >>>
> >>> I've made a simple maven project with just resources (the beans.xml,
> >>>.xsl
> >>> and .vm files),
> >>> however the XSLT and Velocity endpoints cannot find the associated
> >>>files (
> >>> with exception "Failed to resolve endpoint: xslt://testTransform.xsl
> >>>due
> >>> to: java.io.FileNotFoundException: Cannot find resource in classpath
> >>>for
> >>> URI: testTransform.xsl").
> >>>
> >>> If I run the route locally (in a simple java console application)
> >>> everything works fine.
> >>>
> >>> Anyone has experience on this type of deployment and can give me some
> >>>hint?
> >>>
> >>> Thank you,
> >>> Cristiano
> >>>
> >
> >
> >
> >--
> >Claus Ibsen
> >-
> >Red Hat, Inc.
> >Email: cib...@redhat.com
> >Twitter: davsclaus
> >Blog: http://davsclaus.com
> >Author of Camel in Action: http://www.manning.com/ibsen
>
>
>


Re: Camel resources URI into OSGi environment

2013-07-16 Thread Andreas Gies
Depending on how you start your OSGi container, you can always add the
configuration for remote debugging to your launcher script.
For my own development I have written a small wrapper around Pax Exam that
uses a container.properties file to set the JVM's runtime
paramaters (incl. debugging). For inspiration you can have a look at

https://github.com/atooni/de.woq.osgi.java/blob/master/de.woq.osgi.java.lau
ncher/src/main/java/de/woq/osgi/java/container/Main.java

For me that works very well and I use pax-runner composites to keep my
container profiles around.

Best regards 
Andreas




Am 7/16/13(29) 9:41 AM schrieb "Cristiano Costantini" unter
:

>Hi Claus and thank you,
>
>the XSL file is on the "src/main/resources/test" folder, and in the same
>folder there is the velocity template.
>
>I've tried to add test to maven bundle
>plugin but nothing changed.
>Is this the correct way to export it?
>
>also it's weird the velocity template on the same folder is found without
>exporting explicitly the package, I expect I would have the same issue
>with
>it.
>
>The exception is caused on class ResourceHelper  ==>
>
>Caused by: java.io.FileNotFoundException: Cannot find resource in
>classpath
>for URI: vm\test.xsl
>at
>org.apache.camel.util.ResourceHelper.resolveMandatoryResourceAsInputStream
>(ResourceHelper.java:106)
>at
>org.apache.camel.builder.xml.XsltUriResolver.resolve(XsltUriResolver.java:
>81)
>
>I will try to check the code of ResourceHelper but I don't know how to
>debug when using OSGI (yet).
>
>thank you,
>
>Cristiano
>
>
>
>
>
>2013/7/16 Claus Ibsen 
>
>> If the xsl file is in the classpath of your own bundle, then you need
>> to export this package. Looks like you put it in a test package.
>>
>> On Tue, Jul 16, 2013 at 9:27 AM, Cristiano Costantini
>>  wrote:
>> > I must update my previous question:
>> > velocity in facts works fine, it is just xslt which causing issues!
>> >
>> > My test route is in fact:
>> > 
>> > 
>> > 
>> > Foo
>> > 
>> > 
>> > 
>> > 
>> > 
>> >
>> > the velocity: endpoint works, it is the xslt: which fail...
>> > I'm able to run it if I use the full path for just the XSL file:
>> >
>> > 
>> > 
>> > 
>> > Foo
>> > 
>> > 
>> > > >
>> 
>>uri="xslt://file:///C:/dev/Sandbox/osgi-deploy-test/src/main/resources/te
>>st/test.xsl"
>> > />
>> > 
>> > 
>> >
>> > Anyone has any suggestion on how to address this problem?
>> >
>> > My only suspect is that when I run from eclipse a simple java class
>>with
>> a
>> > main(String[] args) method where I start a
>>  ConfigurableApplicationContext)
>> > where it works, and when I deploy on OSGi, I'm actually using two
>> different
>> > XSLT processors, but I'm not sure how to debug it...
>> >
>> > thank you again,
>> >
>> > Cristiano
>> >
>> >
>> >
>> >
>> > 2013/7/16 Cristiano Costantini 
>> >
>> >> Hello,
>> >>
>> >> I just tried to deploy my camel routes into an OSGi environment
>> >> (ServiceMix).
>> >>
>> >> I've made a simple maven project with just resources (the beans.xml,
>> .xsl
>> >> and .vm files),
>> >> however the XSLT and Velocity endpoints cannot find the associated
>> files (
>> >> with exception "Failed to resolve endpoint: xslt://testTransform.xsl
>>due
>> >> to: java.io.FileNotFoundException: Cannot find resource in classpath
>>for
>> >> URI: testTransform.xsl").
>> >>
>> >> If I run the route locally (in a simple java console application)
>> >> everything works fine.
>> >>
>> >> Anyone has experience on this type of deployment and can give me some
>> hint?
>> >>
>> >> Thank you,
>> >> Cristiano
>> >>
>>
>>
>>
>> --
>> Claus Ibsen
>> -
>> Red Hat, Inc.
>> Email: cib...@redhat.com
>> Twitter: davsclaus
>> Blog: http://davsclaus.com
>> Author of Camel in Action: http://www.manning.com/ibsen
>>




Re: Camel resources URI into OSGi environment

2013-07-16 Thread Andreas Gies
Hi

I have used that instruction in the past. By now I find it easier to
configure the bundle plugin including a file "osgi.bnd"
which lives in the bundle root directory alongside the pom file.

The bundle-plugin would be configured as:


  org.apache.felix
  maven-bundle-plugin
  2.3.7
  true
  

  manifest
  process-classes
  
  manifest
 

  
  

jar
bundle
war
  
  
<_include>-osgi.bnd
  
  



Note that this configuration also allows me to OSGIFY wars and jars if I
need it. 

A typical osgi.bnd file would look like:

Bundle-Version:\
  ${project.version}

Bundle-SymbolicName:\
  ${bundle.symbolicName}; singleton:=true

Export-Package: ${bundle.namespace}

Import-Package: \
  *

Private-Package: \
  ${bundle.namespace}.internal


The variables ${bundle.namespace} and ${bundle.symbolicName} always
resolve to my artifactId, which is in my bundles always
${project.groupId} + "." + uniqueidentifier.


Having this kind of structure kind of gives you a natural order of
packages and exports.

Have fun
Andreas







Am 7/16/13(29) 9:48 AM schrieb "Cristiano Costantini" unter
:

>Thank you Andreas for the hints on how to layout the packages.
>
>(I'm just studying how to make it work and not yet started to refine the
>code style,
>I will surely take care of your recommendation.)
>
>Could you confirm right way to export a resource in OSGi is to use the
> instruction?
>
>Thank you,
>
>Cristiano
>
>
>
>
>
>2013/7/16 Andreas Gies 
>
>> Elaborating on Claus' answer. The XSLT processor tries to resolve the
>>XSLT
>> "test/test.xsl".
>> In OSGI words, it has to resolve a package "test" which contains the
>> resource test.xsl.
>>
>> Though exporting the package "test" would probably work, I would
>>strongly
>> recommend to have
>> better qualified package names to avoid name clashes in exports.
>> Especially generically named
>> packages like "test" or "sample" may very well lead into a world of pain
>> (been there).
>>
>> Once you go about exporting packages, think what you want / need to
>>expose
>> to other bundles.
>> I always keep my internal stuff in a package ending in ".internal" and
>> have configured my builds
>> not to export something that matches this pattern.
>>
>> Good luck
>> Andreas
>>
>>
>>
>>
>>
>>
>>
>> Am 7/16/13(29) 9:29 AM schrieb "Claus Ibsen" unter
>>> >:
>>
>> >If the xsl file is in the classpath of your own bundle, then you need
>> >to export this package. Looks like you put it in a test package.
>> >
>> >On Tue, Jul 16, 2013 at 9:27 AM, Cristiano Costantini
>> > wrote:
>> >> I must update my previous question:
>> >> velocity in facts works fine, it is just xslt which causing issues!
>> >>
>> >> My test route is in fact:
>> >> 
>> >> 
>> >> 
>> >> Foo
>> >> 
>> >> 
>> >> 
>> >> 
>> >> 
>> >>
>> >> the velocity: endpoint works, it is the xslt: which fail...
>> >> I'm able to run it if I use the full path for just the XSL file:
>> >>
>> >> 
>> >> 
>> >> 
>> >> Foo
>> >> 
>> >> 
>> >> > >>
>> 
uri="xslt://file:///C:/dev/Sandbox/osgi-deploy-test/src/main/resources/
te
>> >>st/test.xsl"
>> >> />
>> >> 
>> >> 
>> >>
>> >> Anyone has any suggestion on how to address this problem?
>> >>
>> >> My only suspect is that when I run from eclipse a simple java class
>> >>with a
>> >> main(String[] args) method where I start a
>> >>ConfigurableApplicationContext)
>> >> where it works, and when I deploy on OSGi, I'm actually using two
>> >>different
>> >> XSLT processors, but I'm not sure how to debug it...
>> >>
>> >> thank you again,
>> >>
>> >> Cristiano
>> >>
>> >>
>> >>
>> >>
>> >> 2013/7/16 Cristiano Costantini 
>> >>
>> >>> Hello,
>> >>>
>> >>> I just tried to deploy my camel routes into an OSGi environment
>> >>> (ServiceMix).
>> >>>
>> >>> I've made a simple maven project with just resources (the beans.xml,
>> >>>.xsl
>> >>> and .vm files),
>> >>> however the XSLT and Velocity endpoints cannot find the associated
>> >>>files (
>> >>> with exception "Failed to resolve endpoint: xslt://testTransform.xsl
>> >>>due
>> >>> to: java.io.FileNotFoundException: Cannot find resource in classpath
>> >>>for
>> >>> URI: testTransform.xsl").
>> >>>
>> >>> If I run the route locally (in a simple java console application)
>> >>> everything works fine.
>> >>>
>> >>> Anyone has experience on this type of deployment and can give me
>>some
>> >>>hint?
>> >>>
>> >>> Thank you,
>> >>> Cristiano
>> >>>
>> >
>> >
>> >
>> >--
>> >Claus Ibsen
>> >-
>> >Red Hat, Inc.
>> >Email: cib...@redhat.com
>> >Twitter: davsclaus
>> >Blog: http://davsclaus.com
>> >Author of Camel in Action: http://www.manning.com/ibsen
>>
>>
>>




How to recover corrupted HawtDB files

2013-07-16 Thread Stefan Burkard
Hi Camel users

I have a component with 2 persistent aggregators. One receives all
messages, one only a part of them. After a lot of test runs without
problems I had yesterday a serious problem with the aggregator persistence
(hawtdb).

I don't know yet what causes the problems, but however, problems can occur.
My problem is that I cannot recover the data from the hawtdb-files.

Im my logs, I got first of all about 8 stacktraces like the attached
"stacktrace1.txt". The number in the error message "The requested page was
not an extent: 35" is growing from stacktrace to stacktrace from 35 to 1163.

Then, I got some stacktraces like the attached "stacktrace2.txt".

Finally I got A LOT of stacktraces like the attached "stacktrace3.txt".

After shutting down the component gracefully, I tried to restart it, but
this throws stacktraces like the attached "stacktrace-startup.txt".

I can only start the component again if I rename the hawtdb-files so they
are ignored and new hawtdb-files are created.

This leaves me with the question: how can I recover the corrupted
hawtdb-files? I didn't found anything about this subject and if this is not
possible, this would be a real show-stopper.

Thanks for any help
Stefan
2013-07-15 17:12:43,766 WARN  [Camel (camel-1) thread #1 - 
AggregateRecoverChecker] hawtdb.HawtDBFile (HawtDBFile.java:180) - Error 
executing work Scan. Will do rollback.
org.fusesource.hawtdb.api.IOPagingException: Invalid extent read request.  The 
requested page was not an extent: 35
at org.fusesource.hawtdb.internal.page.Extent.readHeader(Extent.java:85)
at org.fusesource.hawtdb.internal.page.Extent.free(Extent.java:251)
at org.fusesource.hawtdb.internal.page.Extent.free(Extent.java:245)
at 
org.fusesource.hawtdb.internal.page.HawtTxPageFile.syncBatches(HawtTxPageFile.java:734)
at 
org.fusesource.hawtdb.internal.page.HawtTxPageFile.flush(HawtTxPageFile.java:551)
at 
org.apache.camel.component.hawtdb.HawtDBFile.doExecute(HawtDBFile.java:171)
at org.apache.camel.component.hawtdb.HawtDBFile.execute(HawtDBFile.java:119)
at 
org.apache.camel.component.hawtdb.HawtDBAggregationRepository.scan(HawtDBAggregationRepository.java:272)
at 
org.apache.camel.processor.aggregate.AggregateProcessor$RecoverTask.run(AggregateProcessor.java:750)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at 
java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
at 
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
at 
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181)
at 
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
2013-07-15 17:17:02,995 ERROR [Camel (camel-1) thread #13 - 
JmsConsumer[VORPRODUKTION_LPB.lpbclient.LpbClientService.archive.dms.aggregate]]
 processor.DefaultErrorHandler (MarkerIgnoringBase.java:161) - Failed 
delivery for (MessageId: ID:xa1007.visana.ch-43703-1373900357415-0:10:1:1:2 on 
ExchangeId: ID-xa1007-visana-ch-51384-1373900356429-0-198). Exhausted after 
delivery attempt: 1 caught: java.lang.RuntimeException: Error getting key 
760100323 from repository lpbArchiveDms
java.lang.RuntimeException: Error getting key 760100323 from repository 
lpbArchiveDms
at 
org.apache.camel.component.hawtdb.HawtDBAggregationRepository.get(HawtDBAggregationRepository.java:164)
at 
org.apache.camel.processor.aggregate.AggregateProcessor.doAggregation(AggregateProcessor.java:218)
at 
org.apache.camel.processor.aggregate.AggregateProcessor.process(AggregateProcessor.java:197)
at 
org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)
at 
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:99)
at 
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:56)
at 
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
at 
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
at 
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:70)
at 
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:99)
at 
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:56)
at 
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
   

Re: Incoming message from a JMS queue need to be processed in parallel but keep the ordering of messages

2013-07-16 Thread gquintana
Seda breaks transaction propagation since different threads are used. But you
can replace seda by JMS
from("jms:queue:abc")
.choice()
.when(simple(body.msg.type).isEqualTo("a"))
.to("jms:queue:only_a")
.when(simple(body.msg.type).isEqualTo("b"))
.to("jms:queue:only_b");
from("jms:queue:only_a').to("javaspaces");
from("jms:queue:only_b").to("javaspaces");

// With Message selector and single queue  (if your broker supports it)
from("jms:queue:abc")
.choice()
.when(simple(body.msg.type).isEqualTo("a"))
.setHeader("MyGroupId",1)
.when(simple(body.msg.type).isEqualTo("b"))
.setHeader("MyGroupId",2)
.end
.to("jms:queue:enriched_abc");
from("jms:queue:enriched_abc?selector='MyGroupId=1').to("javaspaces");
from("jms:queue:enriched_abc?selector='MyGroupId=2').to("javaspaces");


// Or with JMSXGroupID (if your broker supports it)
from("jms:queue:abc")
.choice()
.when(simple(body.msg.type).isEqualTo("a"))
.setHeader("JMSXGroupID","a")
.when(simple(body.msg.type).isEqualTo("b"))
.setHeader("JMSXGroupID","b")
.end
.to("jms:queue:enriched_abc");
// Multiple consumers, each one should process a different group
from("jms:queue:enriched_abc?concurrentConsumers=3").to("javaspaces");






--
View this message in context: 
http://camel.465427.n5.nabble.com/Incoming-message-from-a-JMS-queue-need-to-be-processed-in-parallel-but-keep-the-ordering-of-messages-tp5735406p5735705.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Get the exception org.apache.camel.RuntimeCamelException: java.lang.RuntimeException: Protocol mismatch for port 443: engine's protocol is http, the url protocol is https

2013-07-16 Thread cannykanna
Thank you mueller,

Your link was very helpful. My problem got resolved.

Thanks
Kannaiah



--
View this message in context: 
http://camel.465427.n5.nabble.com/Get-the-exception-org-apache-camel-RuntimeCamelException-java-lang-RuntimeException-Protocol-mismatcs-tp5735568p5735710.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Which Component of camel is used for subscriptions or polling?

2013-07-16 Thread cannykanna
I am working on camel 2.11.0. I was able to do routing using cxf component
and perform CRUD operations in my endpoint application. Now how do I do
polling or which component is used for this in camel. 
Subscription or polling: In concurrent intervals of time, whatever updates
or changes happen in my endpoint application, we need to retrieve this
information. This is called polling or subscription.

Thanks
Kannaiah



--
View this message in context: 
http://camel.465427.n5.nabble.com/Which-Component-of-camel-is-used-for-subscriptions-or-polling-tp5735709.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel JPA - Clustered Deployment - Quartz Scheduling

2013-07-16 Thread dkum003
Hi Patrick,

Did you find a solution to this ?

I have a similar requirement where i need to trigger a daily cron schedule
on a cluster environment.
So basically, only one of the instance should wake up on cron time and
sleep.

Regards,
DJ



--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-JPA-Clustered-Deployment-Quartz-Scheduling-tp5733292p5735708.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Which Component of camel is used for subscriptions or polling?

2013-07-16 Thread Christoph Emmersberger
Hi Kannaiah

I assume that you want to poll based upon different timer events.

Have a look at the documentation of a PollingConsumer: 
http://camel.apache.org/polling-consumer.html

You probably would like to end up with something similar like:

from("timer://foo?period=5000").bean(cool, "someBusinessLogic");

- Christoph

On Jul 16, 2013, at 11:05 AM, cannykanna wrote:

> I am working on camel 2.11.0. I was able to do routing using cxf component
> and perform CRUD operations in my endpoint application. Now how do I do
> polling or which component is used for this in camel. 
> Subscription or polling: In concurrent intervals of time, whatever updates
> or changes happen in my endpoint application, we need to retrieve this
> information. This is called polling or subscription.
> 
> Thanks
> Kannaiah
> 
> 
> 
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Which-Component-of-camel-is-used-for-subscriptions-or-polling-tp5735709.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



Run once a month Camel Bean

2013-07-16 Thread kikou1984
Hi,

Is it possible to execute a camel treatment once a month ?

Thxs. 




--
View this message in context: 
http://camel.465427.n5.nabble.com/Run-once-a-month-Camel-Bean-tp5735712.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Run once a month Camel Bean

2013-07-16 Thread Christian Müller
Yes, take a look at the Camel Quartz component.

Best,
Christian
Am 16.07.2013 12:48 schrieb "kikou1984" :

> Hi,
>
> Is it possible to execute a camel treatment once a month ?
>
> Thxs.
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Run-once-a-month-Camel-Bean-tp5735712.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


recipientList and several CamelContext

2013-07-16 Thread alexey-s
Hi all.
There is a process of loading data from external systems.

// first osgi bundle
from("direct:loadFile")
.id("exchangeCheckUnloadedAttach")
.split().method(unloadedAttachSplitter, "findUnloadedAttach")
.recipientList()
.method(dynamicRouter, "getVerifyAttachRoutes")
.aggregationStrategy(verifyLoadAggregation) // operation Boolen OR

.choice()
.when(body(Boolean.class).isEqualTo(Boolean.TRUE))
.log(LoggingLevel.INFO, "load URL ${header.CamelHttpUrl}")
.to("direct:loadFile")
.otherwise()
.log(LoggingLevel.WARN, "skip URL ${header.CamelHttpUrl}")
.to("direct:skipFile")
.end()
.end()

// second osgi bundle
from("vm:appVerifyAttach?concurrentConsumers=1&waitForTaskToComplete=Always")
.id("appVerifyAttch")
.transacted("required")
.bean(verifyLoadAttach, "verify");


2013-07-16 13:23:04,841 | WARN  | oc-read_Worker-2 |
exchangeCheckUnloadedAttach | 103 - org.apache.camel.camel-core - 2.10.3 |
skip URL http://zakupki.gov.ru/pgz/documentdownload?documentId=71943651

2013-07-16 13:23:05,450 | INFO  | appVerifyAttach | VerifyLoadAttach | 150 -
app-exchange-doc-read - 1.4.0 | add to load URL
http://zakupki.gov.ru/pgz/documentdownload?documentId=71943677


The first number in the log entry appears in section choice-otherwise.
The second number will appear in the journal entry from dynamicRouter
process "vm:appVerifyAttach".

Why operator of choice has executed before the process worked
"vm:appVerifyAttach"?

I'm using Apache Karaf 2.2.8 and Apache Camel 2.10.3.




--
View this message in context: 
http://camel.465427.n5.nabble.com/recipientList-and-several-CamelContext-tp5735714.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: recipientList and several CamelContext

2013-07-16 Thread alexey-s
A small mistake. The first process begins
from("quartz://core-oos/attach?cron={{exchange.doc.attach.cron}}&stateful=true")



--
View this message in context: 
http://camel.465427.n5.nabble.com/recipientList-and-several-CamelContext-tp5735714p5735715.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Shutting down a route, inflight messages and splitter

2013-07-16 Thread Aalandril
Hi,

I have an application that uses a few different routes, but basically it
picks up a file, extracts some records using splitter and sends them off to
a jms queue. When attempting to shut down the route I am informed my
messages are still inflight and so have to wait 5 minutes before it can be
shut down. Can I resolve/work around this? Am I misusing the Splitter EIP,
and does it require an Aggregator to be satisfied?

Route #1 - search for signal file - if found, dynamically create route #2
looking for matching data file name
Route #2 - pick up data file, process and send to direct:foo
Route #3 - pick up from direct:foo, use Splitter to split into records and
send each to seda queue
Route #4 - pick up from seda queue and write to jms (seda used as a
throttling mechanism, otherwise could obviously have sent directly to jms)
Shut down Route #2 (no longer required for this filename)

Route #2 is dynamic, the rest are configured in spring. The filename is used
as the id for Route #2

As I'm new to Camel, If anyone can suggest any efficiency improvements in my
flow please feel free :o)

Thanks



--
View this message in context: 
http://camel.465427.n5.nabble.com/Shutting-down-a-route-inflight-messages-and-splitter-tp5735716.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Run once a month Camel Bean

2013-07-16 Thread Joe San
Much simpler approach would be to use a CronScheduledRoutePolicy!

Regards,
Joe


On Tue, Jul 16, 2013 at 1:02 PM, Christian Müller <
christian.muel...@gmail.com> wrote:

> Yes, take a look at the Camel Quartz component.
>
> Best,
> Christian
> Am 16.07.2013 12:48 schrieb "kikou1984" :
>
> > Hi,
> >
> > Is it possible to execute a camel treatment once a month ?
> >
> > Thxs.
> >
> >
> >
> >
> > --
> > View this message in context:
> >
> http://camel.465427.n5.nabble.com/Run-once-a-month-Camel-Bean-tp5735712.html
> > Sent from the Camel - Users mailing list archive at Nabble.com.
> >
>


Re: Shutting down a route, inflight messages and splitter

2013-07-16 Thread gquintana
Read http://camel.apache.org/graceful-shutdown.html, and probably add
startupOrder:
Route #1 startup order 4
Route #2 
Route #3 startup order 2
Route #4 startup order 1

Are your Routes #3 and #4 In-Out or In Only? Is your Splitter using an
aggregation strategy?
In which one of your routes are in-flight messages remaining?



--
View this message in context: 
http://camel.465427.n5.nabble.com/Shutting-down-a-route-inflight-messages-and-splitter-tp5735716p5735720.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Canonical Way to Create a New Message Given Certain Conditions

2013-07-16 Thread al94781
Hi there,

We have a situation in our route whereby, when we encounter an error in
processing an inbound message, we want to flag the original as "Failed" (in
a header) prior to further processing, and also generate a new message to
request a tidy up of resources the original failure may have left behind
which we put on a new request queue.

The question I have is therefore: What is the canonical way to achieve this
with Camel?  

 - A splitter isn't the right way as the new (tidy up) message is not in the
original message to split it out.  
 - A wiretap feels like it might be a possibility, (looking for messages
with a "Failed" header, and reacting as a result by creating the new
message) but I'm not clear if this can operate within the original
transaction (we can't lose messages, and want to ensure a failure at least
guarantees a clean up is attempted).
 - Alternatively we can just use a plain old processor, but this feels as if
we're missing something and a little ad-hoc.

Can anyone help?  We're pretty sure this must be a very common use case.

TIA

Cheers, Andrew



--
View this message in context: 
http://camel.465427.n5.nabble.com/Canonical-Way-to-Create-a-New-Message-Given-Certain-Conditions-tp5735721.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel resources URI into OSGi environment

2013-07-16 Thread Cristiano Costantini
Hi all again,

in the end I think I've detected an issue, I don't know ho to report it, I
don't even know if it is a Camel or ServiceMix/Karaf issue.
I report here what it is about and please help me pointing me to report it
the right way.

The full problem is:
- If I deploy a route using beans.xml file,
- in a ServiceMix 4.5.1 running under windows 7
- where I have an XSLT endpoint which point to a resource in the folder
"src/main/resources/subfolder" i.e.: 

the file "file.xsl" is not seen an the following error is throw:

2013-07-16 14:21:16,589 | ERROR | xtenderThread-12 | ContextLoaderListener
   | 80 - org.springframework.osgi.extender - 1.2.1 | Application
context refresh failed
(OsgiBundleXmlApplicationContext(bundle=test-xslt-bundle,
config=osgibundle:/META-INF/spring/*.xml))
org.apache.camel.RuntimeCamelException:
org.apache.camel.FailedToCreateRouteException: Failed to create route
cxfEntryRoute at: >>> Choice[[When[xpath{//*[local-name()='alert']} ->
[To[xslt://subfolder/file.xsl]]],
Otherwise[[To[log:messagesNotManaged?showAll=true], Stop]]] <<< in route:
Route[[From[cxf:bean:cxfEntry]] -> [Choice[[When[xpath{... because of
Failed to resolve endpoint: xslt://subfolder/file.xsl due to:
java.io.FileNotFoundException: Cannot find resource in classpath for URI:
subfolder\file.xsl
at
org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1316)[96:org.apache.camel.camel-core:2.10.4]
[...]
Caused by: org.apache.camel.FailedToCreateRouteException: Failed to create
route cxfEntryRoute at: >>> Choice[[When[xpath{//*[local-name()='alert']}
-> [To[xslt://subfolder/file.xsl]]],
Otherwise[[To[log:messagesNotManaged?showAll=true], Stop]]] <<< in route:
Route[[From[cxf:bean:cxfEntry]] -> [Choice[[When[xpath{... because of
Failed to resolve endpoint: xslt://subfolder/file.xsl due to:
java.io.FileNotFoundException: Cannot find resource in classpath for URI:
subfolder\file.xsl
at
org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:879)[96:org.apache.camel.camel-core:2.10.4]
[...]
Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to
resolve endpoint: xslt://subfolder/file.xsl due to:
java.io.FileNotFoundException: Cannot find resource in classpath for URI:
subfolder\file.xsl
at
org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:479)[96:org.apache.camel.camel-core:2.10.4]
[...]
Caused by: javax.xml.transform.TransformerException:
java.io.FileNotFoundException: Cannot find resource in classpath for URI:
subfolder\file.xsl
at
org.apache.camel.builder.xml.XsltUriResolver.resolve(XsltUriResolver.java:83)[96:org.apache.camel.camel-core:2.10.4]
[...]
Caused by: java.io.FileNotFoundException: Cannot find resource in classpath
for URI: subfolder\file.xsl
at
org.apache.camel.util.ResourceHelper.resolveMandatoryResourceAsInputStream(ResourceHelper.java:106)[96:org.apache.camel.camel-core:2.10.4]
at
org.apache.camel.builder.xml.XsltUriResolver.resolve(XsltUriResolver.java:81)[96:org.apache.camel.camel-core:2.10.4]
[...]




Relevant clues:
- the same problem does not happen on linux
- if I don't use a "subfolder" i.e. , the route
works also on windows.
- the error is throw when installing the bundle
- the same problem is not present when running the route in a java
application, only when deploying to ServiceMix
- the same problem does not happen on the velocity component which has
similar way to resolve velocity templates resources (i.e. a route with   works on windows).

Additional Clue:
- if I use a bad resource name on velocity template, i see that velocity
does not change the slash to backslash i.e. error due to bad name of file
"subfolder/bad_resource_name.vm",

2013-07-16 14:42:46,567 | ERROR | ault-workqueue-2 | DefaultErrorHandler
   | 96 - org.apache.camel.camel-core - 2.10.4 | Failed delivery
for (MessageId: ID-AOCC-WS2-50100-1373969104441-9-3 on ExchangeId:
ID-AOCC-WS2-50100-1373969104441-9-4). Exhausted after delivery attempt: 1
caught: java.io.FileNotFoundException: Cannot find resource in classpath
for URI: subfolder/bad_resource_name.vm
java.io.FileNotFoundException: Cannot find resource in classpath for URI:
vm/bad_resource_name.vm
at
org.apache.camel.util.ResourceHelper.resolveMandatoryResourceAsInputStream(ResourceHelper.java:106)[96:org.apache.camel.camel-core:2.10.4]
at
org.apache.camel.component.ResourceEndpoint.loadResource(ResourceEndpoint.java:94)[96:org.apache.camel.camel-core:2.10.4]
at
org.apache.camel.component.ResourceEndpoint.getResourceAsInputStreamWithoutCache(ResourceEndpoint.java:83)[96:org.apache.camel.camel-core:2.10.4]
[...]

Quick solution:
- (I will) put the xslt file resources directly under "src/main/resources"
so no use of slashes is required (but I can't follow the advice from
Andreas to use good pacakge names...)


Sorry, until I learn how to debug in Servicemix 

Re: Shutting down a route, inflight messages and splitter

2013-07-16 Thread Aalandril
Thank you for your speedy response. In answer to your questions:

I have read that document, but in this case I only want to shut down Route
#2. When Route #1 picks up the next file I want to to dynamically create a
new (uniquely named) Route #2, but routes #1, #3 and #4 can (hopefully)
remain unaffected.

Routes #3 and #4 are one way (InOnly).

I have not specified an aggregation strategy for the splitter, because I
have no desire to aggregate the messages after they are split.

I'm not sure in which route the in-flight messages are remaining, however as
I am only attempting to shut down route #2, is it too naive to assume it
must be that route? Or does the act of shutting down Route #2 also attempt
to shut down other routes?

I suppose the question I am unsure of is, why are there still inflight
messages? I know the messages have been sent to jms, as I can see them on
the queue, should this not remove them from flight?



--
View this message in context: 
http://camel.465427.n5.nabble.com/Shutting-down-a-route-inflight-messages-and-splitter-tp5735716p5735723.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: recipientList and several CamelContext

2013-07-16 Thread alexey-s
I'm change vm component to direct-vm component.
See http://camel.apache.org/direct-vm.html
It's work!




--
View this message in context: 
http://camel.465427.n5.nabble.com/recipientList-and-several-CamelContext-tp5735714p5735725.html
Sent from the Camel - Users mailing list archive at Nabble.com.


conditional uri

2013-07-16 Thread boris
How could I have a conditional uri string?
For example,
I have http://camel.465427.n5.nabble.com/conditional-uri-tp5735724.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: conditional uri

2013-07-16 Thread David Karlsen
You could either make it configurable with placeholders:
http://camel.apache.org/using-propertyplaceholder.html

or use a when choice: http://camel.apache.org/spring-xml-extensions.html


2013/7/16 boris 

> How could I have a conditional uri string?
> For example,
> I have  for testing.
> I want to have a single xml file for both and manage uri string
> conditionally.
> Thanks,
> Boris
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/conditional-uri-tp5735724.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen


Re: Exceptions when aggregating messages

2013-07-16 Thread cristisor
It seems that I was trying to serialize the exchange properties, which is
nonsense because the exchange that arrives on the new route will contain
it's own properties, and everything was failing probably when trying to
serialize the following property:
*CamelFileExchangeFile=GenericFile[path\filename.txt]*

I don't understand why this was happening but I will only send the
information that I need instead of sending everything.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Exceptions-when-aggregating-messages-tp5735523p5735728.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: conditional uri

2013-07-16 Thread Chris Wolf
It depends on what you mean by "conditional" -  if you mean
conditional at route-definition time, you can use property placeholders
and/or Language Expressions.

If you mean conditional at runtime, then I'm pretty sure you can only do that
with producer endpoints (i.e. "to" endpoints) see:

http://camel.apache.org/how-do-i-use-dynamic-uri-in-to.html

If you want conditional runtime consumer endpoints, the only solution I have
been able to come up with is dynamically created routes that are created at
runtime; this logic is encapsulated in a custom processor.

-Chris




On Tue, Jul 16, 2013 at 9:46 AM, boris  wrote:
> How could I have a conditional uri string?
> For example,
> I have  for testing.
> I want to have a single xml file for both and manage uri string
> conditionally.
> Thanks,
> Boris
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/conditional-uri-tp5735724.html
> Sent from the Camel - Users mailing list archive at Nabble.com.


Ftp connection through SOCKS Proxy.

2013-07-16 Thread ninadmnaik
In our project, we need to establish FTP connection through a SOCKS proxy.
Since Camel uses Apache Commons Net API underneath for FTP connections, I
tried looking into how Commons Net API supports this. Till last year, the
only way to achieve this was to set Java's System Properties as explained
here:

http://wiki.apache.org/commons/Net/FrequentlyAskedQuestions

But according to Java docs
(http://docs.oracle.com/javase/6/docs/technotes/guides/net/properties.html):
"If socksProxyHost is specified then all TCP sockets will use the SOCKS
proxy server to establish a connection or accept one."

The following patch seems to address this problem by using the Proxy class
in Java 6
http://docs.oracle.com/javase/6/docs/technotes/guides/net/proxies.html

Patch to apache commons net:
https://issues.apache.org/jira/browse/NET-468

So is there a way in Camel to achieve this?
The FTP component link:
http://camel.apache.org/ftp.html and the book: "Camel In Action" don't
indicate that this feature is available in Camel yet. 

Can you please advice on this?

Thanks, 
Ninad.






--
View this message in context: 
http://camel.465427.n5.nabble.com/Ftp-connection-through-SOCKS-Proxy-tp5735735.html
Sent from the Camel - Users mailing list archive at Nabble.com.


AW: conditional uri

2013-07-16 Thread jhm
If your xml-route-definition is inside a spring configuration, spring
properties should be possible.

Jan

> -Ursprüngliche Nachricht-
> Von: Chris Wolf [mailto:cwolf.a...@gmail.com]
> Gesendet: Dienstag, 16. Juli 2013 16:17
> An: users@camel.apache.org
> Betreff: Re: conditional uri
> 
> It depends on what you mean by "conditional" -  if you mean conditional
> at route-definition time, you can use property placeholders and/or
> Language Expressions.
> 
> If you mean conditional at runtime, then I'm pretty sure you can only
> do that with producer endpoints (i.e. "to" endpoints) see:
> 
> http://camel.apache.org/how-do-i-use-dynamic-uri-in-to.html
> 
> If you want conditional runtime consumer endpoints, the only solution I
> have been able to come up with is dynamically created routes that are
> created at runtime; this logic is encapsulated in a custom processor.
> 
> -Chris
> 
> 
> 
> 
> On Tue, Jul 16, 2013 at 9:46 AM, boris 
> wrote:
> > How could I have a conditional uri string?
> > For example,
> > I have  uri="direct:start"
> > for testing.
> > I want to have a single xml file for both and manage uri string
> > conditionally.
> > Thanks,
> > Boris
> >
> >
> >
> > --
> > View this message in context:
> > http://camel.465427.n5.nabble.com/conditional-uri-tp5735724.html
> > Sent from the Camel - Users mailing list archive at Nabble.com.



Re: How to recover corrupted HawtDB files

2013-07-16 Thread Christian Müller
I'm not sure whether this is the best forum for this kind of question. May
be posting on the HawtDB mailing list makes more sense...

Only my 0,02 €,
Christian
-

Software Integration Specialist

Apache Camel committer: https://camel.apache.org/team
V.P. Apache Camel: https://www.apache.org/foundation/
Apache Member: https://www.apache.org/foundation/members.html

https://www.linkedin.com/pub/christian-mueller/11/551/642


On Tue, Jul 16, 2013 at 10:12 AM, Stefan Burkard  wrote:

> Hi Camel users
>
> I have a component with 2 persistent aggregators. One receives all
> messages, one only a part of them. After a lot of test runs without
> problems I had yesterday a serious problem with the aggregator persistence
> (hawtdb).
>
> I don't know yet what causes the problems, but however, problems can
> occur. My problem is that I cannot recover the data from the hawtdb-files.
>
> Im my logs, I got first of all about 8 stacktraces like the attached
> "stacktrace1.txt". The number in the error message "The requested page was
> not an extent: 35" is growing from stacktrace to stacktrace from 35 to 1163.
>
> Then, I got some stacktraces like the attached "stacktrace2.txt".
>
> Finally I got A LOT of stacktraces like the attached "stacktrace3.txt".
>
> After shutting down the component gracefully, I tried to restart it, but
> this throws stacktraces like the attached "stacktrace-startup.txt".
>
> I can only start the component again if I rename the hawtdb-files so they
> are ignored and new hawtdb-files are created.
>
> This leaves me with the question: how can I recover the corrupted
> hawtdb-files? I didn't found anything about this subject and if this is not
> possible, this would be a real show-stopper.
>
> Thanks for any help
> Stefan
>
>


Re: Incoming message from a JMS queue need to be processed in parallel but keep the ordering of messages

2013-07-16 Thread Raul Kripalani
On Mon, Jul 15, 2013 at 6:42 PM, salemi  wrote:

> I am not sure if I can use concurrent consumer option since I have to keep
> the order of messgaes for the buckets.
>

Message groups are meant specially for this scenario. A group is assign to
at most 1 consumer at a time. Therefore, until the consumer is not freed
from its current task, it will not process the next message.

I like your idea to have a route that calculates the Group header but doing
> that is it not going to be the bottleneck for the processing. I have to run
> at least 1000 messages per second trough camel.


No, because apart from being multithreaded, the route is asynchronous and
it simply pushes a message onto another queue. It doesn't wait for the
JavaSpaces processing to finish.

How can you grab 100 messages at the time from JMS in a route?


camel-jms / camel-activemq are based on Spring JMS which AFAIK doesn't
support JMS message batching. You could try out the camel-sjms (Simple JMS)
component which does support this pattern.

Or else, you could use the Aggregator EIP, but I don't see much value in
this particular scenario.

Regards,

*Raúl Kripalani*
Apache Camel PMC Member & Committer | Enterprise Architect, Open Source
Integration specialist
http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
http://blog.raulkr.net | twitter: @raulvkM


Re: Incoming message from a JMS queue need to be processed in parallel but keep the ordering of messages

2013-07-16 Thread Raul Kripalani
On Tue, Jul 16, 2013 at 9:48 AM, gquintana wrote:

> Seda breaks transaction propagation since different threads are used. But
> you
> can replace seda by JMS
>

This applies when a Global TransactionManager is in place (e.g. JTA), whose
typical way of synchronizing several atomic TXs is by following the thread
and tracking which TXs are bound to that thread. That's why I specifically
referred to non-XA transactions in my email ;-)

When using local (non-XA) JMS transactions, Camel will use the UnitOfWork
concept along with Synchronizations to commit/rollback the transaction when
the Exchange is done. When using waitForReply=Always, the Exchange won't be
done until the reply is received, and therefore the UoW won't complete
until then.

Regards,

*Raúl Kripalani*
Apache Camel PMC Member & Committer | Enterprise Architect, Open Source
Integration specialist
http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
http://blog.raulkr.net | twitter: @raulvk


Re: Ftp connection through SOCKS Proxy.

2013-07-16 Thread Willem jiang
As you know current camel-ftp is based of common net API, if the NET-468 patch 
is released, I think we can easily as the support of setting the Proxy object.
Please feel free to fill a JIRA[1] and we can keep it in mind :)

[1]https://issues.apache.org/jira/browse/CAMEL  

--  
Willem Jiang

Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://www.fusesource.com | http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) 
(English)
  http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem





On Wednesday, July 17, 2013 at 1:59 AM, ninadmnaik wrote:

> In our project, we need to establish FTP connection through a SOCKS proxy.
> Since Camel uses Apache Commons Net API underneath for FTP connections, I
> tried looking into how Commons Net API supports this. Till last year, the
> only way to achieve this was to set Java's System Properties as explained
> here:
>  
> http://wiki.apache.org/commons/Net/FrequentlyAskedQuestions
>  
> But according to Java docs
> (http://docs.oracle.com/javase/6/docs/technotes/guides/net/properties.html):
> "If socksProxyHost is specified then all TCP sockets will use the SOCKS
> proxy server to establish a connection or accept one."
>  
> The following patch seems to address this problem by using the Proxy class
> in Java 6
> http://docs.oracle.com/javase/6/docs/technotes/guides/net/proxies.html
>  
> Patch to apache commons net:
> https://issues.apache.org/jira/browse/NET-468
>  
> So is there a way in Camel to achieve this?
> The FTP component link:
> http://camel.apache.org/ftp.html and the book: "Camel In Action" don't
> indicate that this feature is available in Camel yet.  
>  
> Can you please advice on this?
>  
> Thanks,  
> Ninad.
>  
>  
>  
>  
>  
>  
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Ftp-connection-through-SOCKS-Proxy-tp5735735.html
> Sent from the Camel - Users mailing list archive at Nabble.com 
> (http://Nabble.com).





Re: Exceptions when aggregating messages

2013-07-16 Thread Willem jiang
Did you enable the option to let camel-jms serialize the exchange?
You need to care about the the property value which could not be serialized if 
that option is turned on.


--  
Willem Jiang

Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://www.fusesource.com | http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) 
(English)
  http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem





On Tuesday, July 16, 2013 at 10:07 PM, cristisor wrote:

> It seems that I was trying to serialize the exchange properties, which is
> nonsense because the exchange that arrives on the new route will contain
> it's own properties, and everything was failing probably when trying to
> serialize the following property:
> *CamelFileExchangeFile=GenericFile[path\filename.txt]*
>  
> I don't understand why this was happening but I will only send the
> information that I need instead of sending everything.
>  
>  
>  
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Exceptions-when-aggregating-messages-tp5735523p5735728.html
> Sent from the Camel - Users mailing list archive at Nabble.com 
> (http://Nabble.com).





Re: Camel resources URI into OSGi environment

2013-07-16 Thread Willem jiang
Hi,   

I just checked the code of XsltUriResolver code in the trunk, it should be 
resolved since Camel 2.11.x.
You may need to consider to upgrade the Camel version of it.

--  
Willem Jiang

Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://www.fusesource.com | http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) 
(English)
  http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem




On Tuesday, July 16, 2013 at 8:53 PM, Cristiano Costantini wrote:

> Hi all again,
>  
> in the end I think I've detected an issue, I don't know ho to report it, I
> don't even know if it is a Camel or ServiceMix/Karaf issue.
> I report here what it is about and please help me pointing me to report it
> the right way.
>  
> The full problem is:
> - If I deploy a route using beans.xml file,
> - in a ServiceMix 4.5.1 running under windows 7
> - where I have an XSLT endpoint which point to a resource in the folder
> "src/main/resources/subfolder" i.e.: 
>  
> the file "file.xsl" is not seen an the following error is throw:
>  
> 2013-07-16 14:21:16,589 | ERROR | xtenderThread-12 | ContextLoaderListener
> | 80 - org.springframework.osgi.extender - 1.2.1 | Application
> context refresh failed
> (OsgiBundleXmlApplicationContext(bundle=test-xslt-bundle,
> config=osgibundle:/META-INF/spring/*.xml))
> org.apache.camel.RuntimeCamelException:
> org.apache.camel.FailedToCreateRouteException: Failed to create route
> cxfEntryRoute at: >>> Choice[[When[xpath{//*[local-name()='alert']} ->
> [To[xslt://subfolder/file.xsl]]],
> Otherwise[[To[log:messagesNotManaged?showAll=true], Stop]]] <<< in route:
> Route[[From[cxf:bean:cxfEntry]] -> [Choice[[When[xpath{... because of
> Failed to resolve endpoint: xslt://subfolder/file.xsl due to:
> java.io.FileNotFoundException: Cannot find resource in classpath for URI:
> subfolder\file.xsl
> at
> org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1316)[96:org.apache.camel.camel-core:2.10.4]
> [...]
> Caused by: org.apache.camel.FailedToCreateRouteException: Failed to create
> route cxfEntryRoute at: >>> Choice[[When[xpath{//*[local-name()='alert']}
> -> [To[xslt://subfolder/file.xsl]]],
> Otherwise[[To[log:messagesNotManaged?showAll=true], Stop]]] <<< in route:
> Route[[From[cxf:bean:cxfEntry]] -> [Choice[[When[xpath{... because of
> Failed to resolve endpoint: xslt://subfolder/file.xsl due to:
> java.io.FileNotFoundException: Cannot find resource in classpath for URI:
> subfolder\file.xsl
> at
> org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:879)[96:org.apache.camel.camel-core:2.10.4]
> [...]
> Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to
> resolve endpoint: xslt://subfolder/file.xsl due to:
> java.io.FileNotFoundException: Cannot find resource in classpath for URI:
> subfolder\file.xsl
> at
> org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:479)[96:org.apache.camel.camel-core:2.10.4]
> [...]
> Caused by: javax.xml.transform.TransformerException:
> java.io.FileNotFoundException: Cannot find resource in classpath for URI:
> subfolder\file.xsl
> at
> org.apache.camel.builder.xml.XsltUriResolver.resolve(XsltUriResolver.java:83)[96:org.apache.camel.camel-core:2.10.4]
> [...]
> Caused by: java.io.FileNotFoundException: Cannot find resource in classpath
> for URI: subfolder\file.xsl
> at
> org.apache.camel.util.ResourceHelper.resolveMandatoryResourceAsInputStream(ResourceHelper.java:106)[96:org.apache.camel.camel-core:2.10.4]
> at
> org.apache.camel.builder.xml.XsltUriResolver.resolve(XsltUriResolver.java:81)[96:org.apache.camel.camel-core:2.10.4]
> [...]
>  
>  
>  
>  
> Relevant clues:
> - the same problem does not happen on linux
> - if I don't use a "subfolder" i.e. , the route
> works also on windows.
> - the error is throw when installing the bundle
> - the same problem is not present when running the route in a java
> application, only when deploying to ServiceMix
> - the same problem does not happen on the velocity component which has
> similar way to resolve velocity templates resources (i.e. a route with  uri="velocity://subfolder/template.vm" /> works on windows).
>  
> Additional Clue:
> - if I use a bad resource name on velocity template, i see that velocity
> does not change the slash to backslash i.e. error due to bad name of file
> "subfolder/bad_resource_name.vm",
>  
> 2013-07-16 14:42:46,567 | ERROR | ault-workqueue-2 | DefaultErrorHandler
> | 96 - org.apache.camel.camel-core - 2.10.4 | Failed delivery
> for (MessageId: ID-AOCC-WS2-50100-1373969104441-9-3 on ExchangeId:
> ID-AOCC-WS2-50100-1373969104441-9-4). Exhausted after delivery attempt: 1
> caught: java.io.FileNotFoundException: Cannot find resource in classpath
> for URI: subfolder/bad_resource_name.vm
> java.io.FileNotFoundException: Cannot find resource in classpath for URI:
> vm/bad_resource_name.vm
> at
> org.apache.camel.

Re: How to use PropertyPlaceholderConfigurer to configure the autoStartup option

2013-07-16 Thread bonnahu
Hi Claus,
It works for me! Thanks a lot!



--
View this message in context: 
http://camel.465427.n5.nabble.com/How-to-use-PropertyPlaceholderConfigurer-to-configure-the-autoStartup-option-tp5735604p5735753.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: How to use PropertyPlaceholderConfigurer to configure the autoStartup option

2013-07-16 Thread bonnahu
Hi Willem,
I am using 2.10.1.

Thanks



--
View this message in context: 
http://camel.465427.n5.nabble.com/How-to-use-PropertyPlaceholderConfigurer-to-configure-the-autoStartup-option-tp5735604p5735754.html
Sent from the Camel - Users mailing list archive at Nabble.com.


[ANNOUNCE] Apache Camel 2.11.1 Released

2013-07-16 Thread hadrian
The Apache Camel project [1] is a powerful open source integration framework 
based on known Enterprise Integration Patterns [2]. 

The Camel community announces the immediate availability of the new patch 
release camel-2.11.1. 

The artifacts are published and ready for you to download [3] either from the 
Apache mirrors or from the Central Maven repository.
For more details please take a look at the release notes [4].

Many thanks to the Camel community for the hard work.

Hadrian

[1] http://camel.apache.org/
[2] http://camel.apache.org/enterprise-integration-patterns.html
[3] http://camel.apache.org/download.html
[4] http://camel.apache.org/camel-2111-release.html


Re: Exceptions when aggregating messages

2013-07-16 Thread cristisor
I'm afraid that I don't understand which option you are talking about. And
how can I "care about the the property value which could not be serialized",
please explain in more details if possible?

Thanks.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Exceptions-when-aggregating-messages-tp5735523p5735765.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Which Component of camel is used for subscriptions or polling?

2013-07-16 Thread cannykanna
Thank you Christopher. Will look into the doc. If there are any requires, i
will let U know..!!

Regards,
Kannaiah



--
View this message in context: 
http://camel.465427.n5.nabble.com/Which-Component-of-camel-is-used-for-subscriptions-or-polling-tp5735709p5735763.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel resources URI into OSGi environment

2013-07-16 Thread Cristiano Costantini
Thank you Willem!

I'm stick to the camel version in ServiceMix (until I have time to try just
Camel + Karaf) which is using 2.10.4 now and moving to 2.10.6 I think in
next revision,
but it is good to know it is fixed!

Regards,
Cristiano



2013/7/17 Willem jiang 

> Hi,
>
> I just checked the code of XsltUriResolver code in the trunk, it should be
> resolved since Camel 2.11.x.
> You may need to consider to upgrade the Camel version of it.
>
> --
> Willem Jiang
>
> Red Hat, Inc.
> FuseSource is now part of Red Hat
> Web: http://www.fusesource.com | http://www.redhat.com
> Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/)
> (English)
>   http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
> Twitter: willemjiang
> Weibo: 姜宁willem
>
>
>
>
> On Tuesday, July 16, 2013 at 8:53 PM, Cristiano Costantini wrote:
>
> > Hi all again,
> >
> > in the end I think I've detected an issue, I don't know ho to report it,
> I
> > don't even know if it is a Camel or ServiceMix/Karaf issue.
> > I report here what it is about and please help me pointing me to report
> it
> > the right way.
> >
> > The full problem is:
> > - If I deploy a route using beans.xml file,
> > - in a ServiceMix 4.5.1 running under windows 7
> > - where I have an XSLT endpoint which point to a resource in the folder
> > "src/main/resources/subfolder" i.e.:  />
> >
> > the file "file.xsl" is not seen an the following error is throw:
> >
> > 2013-07-16 14:21:16,589 | ERROR | xtenderThread-12 |
> ContextLoaderListener
> > | 80 - org.springframework.osgi.extender - 1.2.1 | Application
> > context refresh failed
> > (OsgiBundleXmlApplicationContext(bundle=test-xslt-bundle,
> > config=osgibundle:/META-INF/spring/*.xml))
> > org.apache.camel.RuntimeCamelException:
> > org.apache.camel.FailedToCreateRouteException: Failed to create route
> > cxfEntryRoute at: >>> Choice[[When[xpath{//*[local-name()='alert']} ->
> > [To[xslt://subfolder/file.xsl]]],
> > Otherwise[[To[log:messagesNotManaged?showAll=true], Stop]]] <<< in route:
> > Route[[From[cxf:bean:cxfEntry]] -> [Choice[[When[xpath{... because of
> > Failed to resolve endpoint: xslt://subfolder/file.xsl due to:
> > java.io.FileNotFoundException: Cannot find resource in classpath for URI:
> > subfolder\file.xsl
> > at
> >
> org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1316)[96:org.apache.camel.camel-core:2.10.4]
> > [...]
> > Caused by: org.apache.camel.FailedToCreateRouteException: Failed to
> create
> > route cxfEntryRoute at: >>> Choice[[When[xpath{//*[local-name()='alert']}
> > -> [To[xslt://subfolder/file.xsl]]],
> > Otherwise[[To[log:messagesNotManaged?showAll=true], Stop]]] <<< in route:
> > Route[[From[cxf:bean:cxfEntry]] -> [Choice[[When[xpath{... because of
> > Failed to resolve endpoint: xslt://subfolder/file.xsl due to:
> > java.io.FileNotFoundException: Cannot find resource in classpath for URI:
> > subfolder\file.xsl
> > at
> >
> org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:879)[96:org.apache.camel.camel-core:2.10.4]
> > [...]
> > Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to
> > resolve endpoint: xslt://subfolder/file.xsl due to:
> > java.io.FileNotFoundException: Cannot find resource in classpath for URI:
> > subfolder\file.xsl
> > at
> >
> org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:479)[96:org.apache.camel.camel-core:2.10.4]
> > [...]
> > Caused by: javax.xml.transform.TransformerException:
> > java.io.FileNotFoundException: Cannot find resource in classpath for URI:
> > subfolder\file.xsl
> > at
> >
> org.apache.camel.builder.xml.XsltUriResolver.resolve(XsltUriResolver.java:83)[96:org.apache.camel.camel-core:2.10.4]
> > [...]
> > Caused by: java.io.FileNotFoundException: Cannot find resource in
> classpath
> > for URI: subfolder\file.xsl
> > at
> >
> org.apache.camel.util.ResourceHelper.resolveMandatoryResourceAsInputStream(ResourceHelper.java:106)[96:org.apache.camel.camel-core:2.10.4]
> > at
> >
> org.apache.camel.builder.xml.XsltUriResolver.resolve(XsltUriResolver.java:81)[96:org.apache.camel.camel-core:2.10.4]
> > [...]
> >
> >
> >
> >
> > Relevant clues:
> > - the same problem does not happen on linux
> > - if I don't use a "subfolder" i.e. , the
> route
> > works also on windows.
> > - the error is throw when installing the bundle
> > - the same problem is not present when running the route in a java
> > application, only when deploying to ServiceMix
> > - the same problem does not happen on the velocity component which has
> > similar way to resolve velocity templates resources (i.e. a route with
>  > uri="velocity://subfolder/template.vm" /> works on windows).
> >
> > Additional Clue:
> > - if I use a bad resource name on velocity template, i see that velocity
> > does not change the slash to backslash i.e. error due to bad name of file
> > "subfolder/bad_resource_name.vm",
> >
> > 2013-07-16 14:42:46,567 | ERROR | ault-workqueue-2 |