Re: select message via camel filter

2019-06-06 Thread James Carman
Try using a JMS selector on the URI:

https://camel.apache.org/jms.html


On Thu, Jun 6, 2019 at 1:03 AM Wang Yan  wrote:

> I used below example to select message.
> although it can send matched message to toqueue
> but not matched messages are also dequeued
> What I want to achieve is only matched messages will be
> selected and sent to toqueue .
>
> Any suggestion or hints how to do this with camel filter?
>
> from("activemq:queue:inputqueue?transacted=true")
> .filter(header("foo").isEqualTo("bar"))
> .to("activemq:queue:toqueue");
>


Re: [DISCUSS] - Apache Camel 3 - A new tagline

2019-02-20 Thread James Carman
Apache Camel: Integrate All the Things!
On Wed, Feb 20, 2019 at 6:23 AM Valdis Andersons 
wrote:

> +1 for "Integrate Everything!"
>
> -Original Message-
> From: Francois Papon [mailto:francois.pa...@openobject.fr]
> Sent: 20 February 2019 10:19
> To: users@camel.apache.org
> Subject: Re: [DISCUSS] - Apache Camel 3 - A new tagline
>
> Hi,
>
> I'm agree with Guillaume about not focuses too much on cloud, Camel can be
> use in many other cases.
>
> We can also have:
>
> "Integrate the world" or "Integrate your business"
>
> It's just ideas and may be too "enterprise"...
>
> regards,
>
> François Papon
> fpa...@apache.org
>
> Le 20/02/2019 à 11:38, Guillaume Nodet a écrit :
> >> Apache Camel 3 - A full-stack integration framework for building
> >> cloud-native micro integrations
> >>
> > I think the proposed tagline focuses too much on cloud, and even if
> > that's definitely something we want to emphasize in the set of
> > capabilities that Camel provides, having it in the tag line kinda
> > implies that Camel is mainly focusing on cloud and not traditional
> integration.
> >
> >
> >> "Integrate everything"
> >> "Integrate everything without humps" ;-)
> >>
> > +1 I like both a lot.
> >
> > In the same direction, and to keep the versatile side we could have:
> >   "Integrate everything everywhere"
> > but not sure it's better.
> >
> > Guillaume
> >
> > Le mer. 20 févr. 2019 à 08:28, Burkard Stephan
> >  a écrit :
> >
> >> Hi all
> >>
> >> +1 for "Integrate everything!"
> >> because it is short, catchy and it refers to Camels outstanding
> >> versatility with its hundreds of components.
> >>
> >> It is true that Camel has a lot of other noteworthy features like
> >> runtime flexibility etc. but as soon as the tagline wants to cover
> >> multiple things, it gets "bulky" or "buzzwordy".
> >>
> >> To link the tagline back to the project name and add a pinch of humor
> >> it could also be "Integrate everything without humps" ;-)
> >>
> >
> >> -Ursprüngliche Nachricht-
> >> Von: Steve Huston 
> >> Gesendet: Dienstag, 19. Februar 2019 18:32
> >> An: users@camel.apache.org
> >> Betreff: RE: [DISCUSS] - Apache Camel 3 - A new tagline
> >>
> >> "Integrate everything!"
> >>
> >>> -Original Message-
> >>> From: Claus Ibsen 
> >>> Sent: Tuesday, February 19, 2019 10:52 AM
> >>> To: users@camel.apache.org
> >>> Subject: [DISCUSS] - Apache Camel 3 - A new tagline
> >>>
> >>> Hi
> >>>
> >>> As part of Apache Camel 3, we are working on a new modern website
> >>> (yeah its long overdue, but work are in progress).
> >>>
> >>> As part of that, we should get a new front-page with a new short
> >>> summary what Apache Camel is (eg a tagline).
> >>>
> >>> It would be good to get some ideas rolling what such a tagline could
> >>> be and for users of Camel to come up with suggestions.
> >>>
> >>> As Apache Camel has been around for so long, and that it covers so
> >>> many different use-cases, then its maybe harder to come up with a
> >>> single tag-line that spans all use-cases.
> >>>
> >>> However with the new modern world of containers I came up with:
> >>>
> >>> * Apache Camel 3 - A full-stack integration framework for building
> >>> cloud- native micro integrations
> >>>
> >>>
> >>>
> >>> --
> >>> Claus Ibsen
> >>> -
> >>>
> http://scanmail.trustwave.com/?c=6600=kqnt3DZnRVRDxGKB9mE1Jedd8mhb_nMw1qmhjeAI_A=33=http%3a%2f%2fdavsclaus%2ecom
> @davsclaus
> >>> Camel in Action 2:
> https://scanmail.trustwave.com/?c=6600=kqnt3DZnRVRDxGKB9mE1Jedd8mhb_nMw1qav2Operw=33=https%3a%2f%2fwww%2emanning%2ecom%2fibsen2
> >
>
> Vhi Group DAC (Vhi) is a holding company for insurance and healthcare
> services, which include Vhi Healthcare DAC, Vhi Insurance DAC, Vhi Health
> Services DAC and Vhi Investments DAC. Vhi Healthcare DAC trading as Vhi
> Healthcare and Vhi Insurance DAC trading as Vhi Insurance are regulated by
> the Central Bank of Ireland. Vhi Healthcare is tied to Vhi Insurance DAC
> for health insurance in Ireland which is underwritten by Vhi Insurance DAC.
> Vhi Healthcare is tied to Zurich Life Assurance plc for Vhi Life Term
> Insurance and Vhi Mortgage Protection which is underwritten by Zurich Life
> Assurance plc. Vhi Healthcare is tied to Collinson Insurance Services
> Limited for MultiTrip Travel Insurance, Backpacker Travel Insurance and Vhi
> Dental Insurance which are underwritten by Great Lakes Insurance SE, UK
> branch and for Vhi Canada Cover and Vhi International Health Insurance
> which are underwritten by Astrenska Insurance Limited. For more information
> about the Vhi Group please go to: https://www.vhi.ie/about-vhi.
>
>
> Tá Vhi Group DAC (Vhi) ina chuideachta sealbhaíochta le haghaidh seirbhísí
> árachais agus seirbhísí cúram sláinte, lena n-áirítear Vhi Healthcare DAC,
> Vhi Insurance DAC, Vhi Health Services DAC agus Vhi Investments DAC.
> Déanann Banc Ceannais na hÉireann rialáil ar Vhi Healthcare DAC, ag trádáil
> dó mar Vhi Healthcare, agus ar Vhi Insurance DAC, ag 

Re: Camel internships

2019-02-16 Thread James Carman
Anyone is welcome to contribute to Apache Camel, or any other ASF project
at any time. The foundation also takes part in the Google Summer of Code
every year:

https://community.apache.org/gsoc.html

If a student wishes to participate, I would encourage them to find a
project that interests them and reach out to the community to see if
someone would be willing to mentor them. The Camel community is full of
some very bright and very helpful folks. I would be very surprised if that
request went unanswered.
On Sat, Feb 16, 2019 at 6:59 AM Darius Cooper 
wrote:

> A bit off-topic, but has the Camel team considered using interns for some
> of its project-work?
>
> Often, it takes too much effort to bring a student/intern up to speed; but,
> a large and well-known project like Camel may be able to attract students
> from really good universities, who have already done useful coursework.
>
> To be fair, one would need to give such students some interesting work, and
> work that you really do want done. Yet, to be safe one could try to find
> things that are less "core" and wo';t "break everything" if done wrong.
>
> thoughts?
>


Re: unable to work apache.camel (latest version) with Spring.Boot 2.1.0 Release

2018-12-26 Thread James Carman
https://github.com/spring-projects/spring-boot/issues/13609


On Wed, Dec 26, 2018 at 10:33 AM James Carman 
wrote:

> They disabled bean overriding by default in the latest spring boot. You
> can re-enable it to fix as a workaround.
> On Wed, Dec 26, 2018 at 9:09 AM Onder SEZGIN 
> wrote:
>
>> What's your jdk version?
>> It looks like you have missing jaxb dependencies
>>
>> On Tue, 25 Dec 2018, 16:19 Alper Kopuz >
>> > Hello
>> >
>> > I am using apache.camel version 2.23.0 with spring.boot.version 2.1.0.
>> > RELEASE but I get " error crating bean with name 'camelContext'
>> defined in
>> > .." error while executing my Spring Boot application.
>> >
>> > Do you know the reason why I come across with such kind of error? It was
>> > working fine before upgrading camel version and spring boot version.
>> But,
>> > after I upgraded apache.camel.version and Spring Boot version I got
>> those
>> > errors.
>> > You can find my dependency and error below.
>> > Please let me know if you have more thing.
>> >
>> > Thank you for your helps.
>> >
>> > Best Regards
>> > Alper
>> >
>> > Pom.Xml Dependencies :
>> >
>> > 
>> > 
>> > 
>> > org.springframework.boot
>> > spring-boot-starter-parent
>> > 2.1.0.RELEASE
>> > pom
>> > import
>> > 
>> > 
>> > 
>> >
>> >
>> > 
>> >
>> > org.apache.camel
>> > camel-bom
>> > 2.23.0
>> > pom
>> > import
>> > 
>> >
>> > 
>> >
>> > Error :
>> >
>> > Caused by: org.springframework.beans.factory.BeanCreationException:
>> Error
>> > creating bean with name 'camelContext' defined in class path resource
>> > [org/apache/camel/spring/boot/CamelAutoConfiguration.class]:
>> > Post-processing of merged bean definition failed; nested exception is
>> > java.lang.IllegalStateException: Failed to introspect Class
>> > [org.apache.camel.impl.DefaultCamelContext] from ClassLoader
>> > [jdk.internal.loader.ClassLoaders$AppClassLoader@77556fd]
>> > at
>> >
>> >
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553)
>> > at
>> >
>> >
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:498)
>> > at
>> >
>> >
>> org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
>> > at
>> >
>> >
>> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
>> > at
>> >
>> >
>> org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)
>> > at
>> >
>> >
>> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
>> > at
>> >
>> >
>> org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:273)
>> > at
>> >
>> >
>> org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1239)
>> > at
>> >
>> >
>> org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1166)
>> > at
>> >
>> >
>> org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:855)
>> > at
>> >
>> >
>> org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:758)
>> > ... 77 common frames omitted
>> > Caused by: java.lang.IllegalStateException: Failed to introspect Class
>> > [org.apache.camel.impl.DefaultCamelContext] from ClassLoader
>> > [jdk.internal.loader.ClassLoaders$AppClassLoader@77556fd]
>> > at
>> >
>> >
>> org.springframework.util.ReflectionUtils.getDeclaredFields(ReflectionUtils.java:779)
>> > at
>> >
>> >
>> org.springframework.util.ReflectionUtils.doWithLocalFields(ReflectionUtils.java:711)
>>

Re: unable to work apache.camel (latest version) with Spring.Boot 2.1.0 Release

2018-12-26 Thread James Carman
They disabled bean overriding by default in the latest spring boot. You can
re-enable it to fix as a workaround.
On Wed, Dec 26, 2018 at 9:09 AM Onder SEZGIN  wrote:

> What's your jdk version?
> It looks like you have missing jaxb dependencies
>
> On Tue, 25 Dec 2018, 16:19 Alper Kopuz 
> > Hello
> >
> > I am using apache.camel version 2.23.0 with spring.boot.version 2.1.0.
> > RELEASE but I get " error crating bean with name 'camelContext'  defined
> in
> > .." error while executing my Spring Boot application.
> >
> > Do you know the reason why I come across with such kind of error? It was
> > working fine before upgrading camel version and spring boot version. But,
> > after I upgraded apache.camel.version and Spring Boot version I got those
> > errors.
> > You can find my dependency and error below.
> > Please let me know if you have more thing.
> >
> > Thank you for your helps.
> >
> > Best Regards
> > Alper
> >
> > Pom.Xml Dependencies :
> >
> > 
> > 
> > 
> > org.springframework.boot
> > spring-boot-starter-parent
> > 2.1.0.RELEASE
> > pom
> > import
> > 
> > 
> > 
> >
> >
> > 
> >
> > org.apache.camel
> > camel-bom
> > 2.23.0
> > pom
> > import
> > 
> >
> > 
> >
> > Error :
> >
> > Caused by: org.springframework.beans.factory.BeanCreationException: Error
> > creating bean with name 'camelContext' defined in class path resource
> > [org/apache/camel/spring/boot/CamelAutoConfiguration.class]:
> > Post-processing of merged bean definition failed; nested exception is
> > java.lang.IllegalStateException: Failed to introspect Class
> > [org.apache.camel.impl.DefaultCamelContext] from ClassLoader
> > [jdk.internal.loader.ClassLoaders$AppClassLoader@77556fd]
> > at
> >
> >
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553)
> > at
> >
> >
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:498)
> > at
> >
> >
> org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
> > at
> >
> >
> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
> > at
> >
> >
> org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)
> > at
> >
> >
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
> > at
> >
> >
> org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:273)
> > at
> >
> >
> org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1239)
> > at
> >
> >
> org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1166)
> > at
> >
> >
> org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:855)
> > at
> >
> >
> org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:758)
> > ... 77 common frames omitted
> > Caused by: java.lang.IllegalStateException: Failed to introspect Class
> > [org.apache.camel.impl.DefaultCamelContext] from ClassLoader
> > [jdk.internal.loader.ClassLoaders$AppClassLoader@77556fd]
> > at
> >
> >
> org.springframework.util.ReflectionUtils.getDeclaredFields(ReflectionUtils.java:779)
> > at
> >
> >
> org.springframework.util.ReflectionUtils.doWithLocalFields(ReflectionUtils.java:711)
> > at
> >
> >
> org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.buildResourceMetadata(CommonAnnotationBeanPostProcessor.java:365)
> > at
> >
> >
> org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.findResourceMetadata(CommonAnnotationBeanPostProcessor.java:350)
> > at
> >
> >
> org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessMergedBeanDefinition(CommonAnnotationBeanPostProcessor.java:298)
> > at
> >
> >
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyMergedBeanDefinitionPostProcessors(AbstractAutowireCapableBeanFactory.java:1044)
> > at
> >
> >
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:550)
> > ... 87 common frames omitted
> > Caused by: java.lang.NoClassDefFoundError: Ljavax/xml/bind/JAXBContext;
> > at java.base/java.lang.Class.getDeclaredFields0(Native Method)
> > at java.base/java.lang.Class.privateGetDeclaredFields(Class.java:3062)
> > at java.base/java.lang.Class.getDeclaredFields(Class.java:2249)
> > at
> >
> >
> org.springframework.util.ReflectionUtils.getDeclaredFields(ReflectionUtils.java:774)
> > ... 93 common frames omitted
> > Caused by: 

Re: Best REST (JSON) component to use

2016-07-11 Thread James Carman
Do you really need Camel?  Are you needing to do any "routing" or
anything?  Or, are you just looking to create a REST web service?  If you
don't need Camel, CXF is pretty simple to use for just building JAX-RS web
services by itself.  A lot of folks get caught up in trying to use Camel
for *everything* when it's really not necessary.

On Mon, Jul 11, 2016 at 2:13 PM M.Ismail  wrote:

> Hi,
>
> I have been using CXFRS component for a while and I have noticed that it
> has
> several pending issues including the single item array which is related to
> the jettison provider that is used by default
>
> http://cxf.apache.org/docs/jax-rs-data-bindings.html#JAX-RSDataBindings-DealingwithJettisonarrayserializationissues
> although, a workaround is provided but it is impractical. Other similar
> issues are present too.
>
> So if I'm looking for another REST (JSON) component what is the best one?
> 1- Rest.
> 2- Restlet
> 3- Spark-rest
> 4- Other ???
>
> Regards,
> Ismail
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Best-REST-JSON-component-to-use-tp5785017.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Create 'to' http endpoint (with arguments) with bean

2015-08-21 Thread James Carman
Because beans aren't tied to camel and can be tested in isolation.

On Fri, Aug 21, 2015 at 2:38 AM rwijngaa rino.van.wijngaar...@gmail.com
wrote:

 Work-around:
 (works, but why use bean:xxx at all then? could then just replace it with a
 processor ;-)





 --
 View this message in context:
 http://camel.465427.n5.nabble.com/Create-to-http-endpoint-with-arguments-with-bean-tp5770857p5770876.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



Re: Issue with 'javax.annotation' when installing 'camel' followed by 'cxf' feature

2015-04-08 Thread James Carman
https://github.com/apache/karaf/pull/54


On Wednesday, April 8, 2015, Charlie Mordant cmorda...@gmail.com wrote:

 Hi James,

 Unfortunately, the problem is not here: camel karaf feature declares
 'xml-specs-api' (jaxb, javax.annotations, stax, activation and so on) with
 the 2.2.0 version, while all other Apache projects (openjpa, cxf, amq, and
 even Karaf) are exporting the 2.4.0 ones.
 The only solution I found is to rewrite Camel feature pointing on the 2.4.0
 one (or override third parties manifests such as spring-context...). I may
 be wrong, or do not know all solutions.

 Regards,

 2015-04-07 3:49 GMT+02:00 James Carman ja...@carmanconsulting.com
 javascript:;:

  You need to update jre.properties to make sure you have the right version
  coming from the jre.  What jdk?
 
  On Monday, April 6, 2015, Martin Lichtin lich...@yahoo.com.invalid
  wrote:
 
   In a Karaf 3.0.3 container one cannot install feature 'camel' followed
 by
   installing 'cxf'.
  
   karaf@root() feature:repo-add mvn:org.apache.camel.karaf/
   apache-camel/2.15.1/xml/features
   Adding feature url mvn:org.apache.camel.karaf/apache-camel/2.15.1/xml/
   features
  
   karaf@root() feature:install camel
   karaf@root() feature:install cxf
   Refreshing bundles org.apache.servicemix.bundles.spring-context (79),
   org.apache.servicemix.bundles.spring-beans (77),
   org.apache.servicemix.bundles.spring-context-support (80),
   org.apache.servicemix.bundles.spring-core (75)
   Error executing command: Can't install feature cxf/0.0.0:
   Could not start bundle
  mvn:org.apache.cxf/cxf-rt-rs-extension-providers/3.0.4
   in feature(s) cxf-jaxrs-3.0.4: Uses constraint violation. Unable to
  resolve
   bundle revision org.apache.cxf.cxf-rt-frontend-jaxrs [138.0] because it
   is exposed to package 'javax.annotation' from bundle revisions
   javax.annotation-api [93.0] and org.apache.felix.framework [0] via two
   dependency chains.
  
   Chain 1:
 org.apache.cxf.cxf-rt-frontend-jaxrs [138.0]
   import: ((osgi.wiring.package=javax.annotation)(version=1.2.0)(!(
   version=2.0.0)))
|
   export: osgi.wiring.package=javax.annotation
 javax.annotation-api [93.0]
  
   Chain 2:
 org.apache.cxf.cxf-rt-frontend-jaxrs [138.0]
   import: ((osgi.wiring.package=org.springframework.context.
   annotation)(version=3.1.0)(!(version=5.0.0)))
|
   export: osgi.wiring.package=org.springframework.context.annotation;
   uses:=javax.annotation
 org.apache.servicemix.bundles.spring-context [79.0]
   import: (osgi.wiring.package=javax.annotation)
|
   export: osgi.wiring.package=javax.annotation
 org.apache.felix.framework [0]
   karaf@root()
  
   Anyone else experiencing this issue?
  
   I see that switching the install (i.e. first installing 'cxf') will
 make
   it work, however, it seems a klduge to prescribe an installation
  ordering.
  
  
 



 --
 Charlie Mordant

 Full OSGI/EE stack made with Karaf:
 https://github.com/OsgiliathEnterprise/net.osgiliath.parent



Re: Issue with 'javax.annotation' when installing 'camel' followed by 'cxf' feature

2015-04-08 Thread James Carman
Which JDK are you using to run Karaf?

On Mon, Apr 6, 2015 at 3:17 PM, Martin Lichtin
lich...@yahoo.com.invalid wrote:
 In a Karaf 3.0.3 container one cannot install feature 'camel' followed by
 installing 'cxf'.

 karaf@root() feature:repo-add
 mvn:org.apache.camel.karaf/apache-camel/2.15.1/xml/features
 Adding feature url
 mvn:org.apache.camel.karaf/apache-camel/2.15.1/xml/features

 karaf@root() feature:install camel
 karaf@root() feature:install cxf
 Refreshing bundles org.apache.servicemix.bundles.spring-context (79),
 org.apache.servicemix.bundles.spring-beans (77),
 org.apache.servicemix.bundles.spring-context-support (80),
 org.apache.servicemix.bundles.spring-core (75)
 Error executing command: Can't install feature cxf/0.0.0:
 Could not start bundle
 mvn:org.apache.cxf/cxf-rt-rs-extension-providers/3.0.4 in feature(s)
 cxf-jaxrs-3.0.4: Uses constraint violation. Unable to resolve bundle
 revision org.apache.cxf.cxf-rt-frontend-jaxrs [138.0] because it is exposed
 to package 'javax.annotation' from bundle revisions javax.annotation-api
 [93.0] and org.apache.felix.framework [0] via two dependency chains.

 Chain 1:
   org.apache.cxf.cxf-rt-frontend-jaxrs [138.0]
 import:
 ((osgi.wiring.package=javax.annotation)(version=1.2.0)(!(version=2.0.0)))
  |
 export: osgi.wiring.package=javax.annotation
   javax.annotation-api [93.0]

 Chain 2:
   org.apache.cxf.cxf-rt-frontend-jaxrs [138.0]
 import:
 ((osgi.wiring.package=org.springframework.context.annotation)(version=3.1.0)(!(version=5.0.0)))
  |
 export: osgi.wiring.package=org.springframework.context.annotation;
 uses:=javax.annotation
   org.apache.servicemix.bundles.spring-context [79.0]
 import: (osgi.wiring.package=javax.annotation)
  |
 export: osgi.wiring.package=javax.annotation
   org.apache.felix.framework [0]
 karaf@root()

 Anyone else experiencing this issue?

 I see that switching the install (i.e. first installing 'cxf') will make it
 work, however, it seems a klduge to prescribe an installation ordering.



Re: Issue with 'javax.annotation' when installing 'camel' followed by 'cxf' feature

2015-04-06 Thread James Carman
You need to update jre.properties to make sure you have the right version
coming from the jre.  What jdk?

On Monday, April 6, 2015, Martin Lichtin lich...@yahoo.com.invalid wrote:

 In a Karaf 3.0.3 container one cannot install feature 'camel' followed by
 installing 'cxf'.

 karaf@root() feature:repo-add mvn:org.apache.camel.karaf/
 apache-camel/2.15.1/xml/features
 Adding feature url mvn:org.apache.camel.karaf/apache-camel/2.15.1/xml/
 features

 karaf@root() feature:install camel
 karaf@root() feature:install cxf
 Refreshing bundles org.apache.servicemix.bundles.spring-context (79),
 org.apache.servicemix.bundles.spring-beans (77),
 org.apache.servicemix.bundles.spring-context-support (80),
 org.apache.servicemix.bundles.spring-core (75)
 Error executing command: Can't install feature cxf/0.0.0:
 Could not start bundle mvn:org.apache.cxf/cxf-rt-rs-extension-providers/3.0.4
 in feature(s) cxf-jaxrs-3.0.4: Uses constraint violation. Unable to resolve
 bundle revision org.apache.cxf.cxf-rt-frontend-jaxrs [138.0] because it
 is exposed to package 'javax.annotation' from bundle revisions
 javax.annotation-api [93.0] and org.apache.felix.framework [0] via two
 dependency chains.

 Chain 1:
   org.apache.cxf.cxf-rt-frontend-jaxrs [138.0]
 import: ((osgi.wiring.package=javax.annotation)(version=1.2.0)(!(
 version=2.0.0)))
  |
 export: osgi.wiring.package=javax.annotation
   javax.annotation-api [93.0]

 Chain 2:
   org.apache.cxf.cxf-rt-frontend-jaxrs [138.0]
 import: ((osgi.wiring.package=org.springframework.context.
 annotation)(version=3.1.0)(!(version=5.0.0)))
  |
 export: osgi.wiring.package=org.springframework.context.annotation;
 uses:=javax.annotation
   org.apache.servicemix.bundles.spring-context [79.0]
 import: (osgi.wiring.package=javax.annotation)
  |
 export: osgi.wiring.package=javax.annotation
   org.apache.felix.framework [0]
 karaf@root()

 Anyone else experiencing this issue?

 I see that switching the install (i.e. first installing 'cxf') will make
 it work, however, it seems a klduge to prescribe an installation ordering.




Re: Apache camel monitor activemq

2015-03-25 Thread James Carman
Is it a Camel route that's consuming the messages eventually?  If so,
you can wiretap the messages off and log them if you want.

http://camel.apache.org/wire-tap.html


Re: Apache camel monitor activemq

2015-03-25 Thread James Carman
We have a bit more context from this request from the ActiveMQ mailing
list (double posted) and elsewhere on this list.  As far as I can
tell, they are merely trying to monitor (meaning log to a database)
all messages coming out of one queue.  That's why I asked if the
consumer is a camel route already.  If so, merely doing wiretap is a
quick and easy way to achieve what they were looking to do.  If they
are looking for a more comprehensive monitoring and statistics
approach, then no way would you want to inject that into all your
camel routes using the wiretap DSL.  But, if it's for one particular
queue and one particular route, sure.


On Wed, Mar 25, 2015 at 3:41 PM, Greg Autric gaut...@redhat.com wrote:
 Hi, James,

 Using wiretap is an anti-pattern 'cause you have to change your camel route 
 to inject the wiretap component.
 Monitoring and statistic management should be outside of the camel route.
 The intercept process will copy the message if and only if this message is 
 consume via the JMS component.


 Greg AUTRIC
 JBoss Middleware Consultant

 email   : gautric __at__ redhat __dot__ com
 twitter : @gautric_io

 - Mail original -
 De: James Carman ja...@carmanconsulting.com
 À: users@camel.apache.org
 Envoyé: Mercredi 25 Mars 2015 17:51:57
 Objet: Re: Apache camel monitor activemq

 Is it a Camel route that's consuming the messages eventually?  If so,
 you can wiretap the messages off and log them if you want.

 http://camel.apache.org/wire-tap.html


Re: breadcrumbId does not survive http call

2015-02-10 Thread James Carman
The SOAP endpoint doesn't appear to be pulling headers from the HTTP
part of the message, only the SOAP part.  So, your breadcrumbId would
have to be copied into the SOAP headers in order to propagate, it
seems.

On Tue, Feb 10, 2015 at 8:24 AM, rsteppac2 r...@steppacher.name wrote:
 James,

 thanks for your answer. However, I don't think the BasicMessageFilter is
 responsible for the breadcrumbId not being picked up. The filter is about
 populating the SOAP header element from exchange headers, not the other way
 round.
 My proxy does not use spring-ws, but works on plain http. The proxy does
 some inspection of the raw SOAP XML and SAML header and on success forwards
 the request. The breadcrumbId is set as an HTTP header as expected on the
 forward.  But it is not unmarshalled as an exchange header in my web service
 route. The documentation page for MDC logging claims that the header
 survives across an HTTP transport. Though might be I am expecting too much
 and the claim to support HTTP transport does not include X over HTTP. But
 really just plain HTTP endpoints.

 This is my proxy route:




 Ralf



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/breadcrumbId-does-not-survive-http-call-tp5762528p5762566.html
 Sent from the Camel - Users mailing list archive at Nabble.com.


Re: breadcrumbId does not survive http call

2015-02-10 Thread James Carman
Yeah, I sent a follow-up message saying that.  Do you absolutely
require that the breadcrumb's match between the proxy and your web
service?

On Tue, Feb 10, 2015 at 12:16 PM, rsteppac2 r...@steppacher.name wrote:
 James,

 sorry, I did not want to make the impression of lightheartedly dismissing
 your hint with the BasicMessageFilter. I have extended from it and have
 overridden the  method to not filter any headers. As suspected this is too
 late in the chain. By the time the filter is called the route has already
 been processed.

 I tried to find a hook where I could jump in and make the breadcrumbId from
 the HTTP headers available. But I am stuck.

 The spring-ws endpoint (SpringWebserviceConsumer) does not care at all about
 HTTP headers, only about SOAP headers and properties of the
 org.springframework.ws.context.MessageContext. SOAP headers get converted
 into exchange headers while message context properties get converted into
 exchange properties. Properties could be added by using a
 org.springframework.ws.server.EndpointInterceptor.

 A breadcrumbId property is not picked up. Instead the
 org.apache.camel.impl.DefaultUnitOfWork creates a new breadcrumbId because
 it only checks the in-message headers, not the exchange properties.
 A SOAPHeader breadcrumbId is copied over to the in-message headers and
 actually picked up by the DefaultUnitOfWork, but it is of type
 org.springframework.ws.soap.saaj.SaajSoapHeaderElement, which has no
 toString() implementation.

 So far so inconvenient...

 Ralf

 PS: I am back in the office on Friday



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/breadcrumbId-does-not-survive-http-call-tp5762528p5762572.html
 Sent from the Camel - Users mailing list archive at Nabble.com.


Re: breadcrumbId does not survive http call

2015-02-10 Thread James Carman
What does your web service route look like?

On Tuesday, February 10, 2015, rsteppac2 r...@steppacher.name wrote:

 Hello all,

 I am using Camel (2.14.1) to proxy calls to a web service and for the web
 service implementation itself (camel-spring-ws). I expected the
 breadcrumbId
 to be the same in my proxy route as well as the web service route. The
 proxy
 sends the breadcrumb as an HTTP header, but the web service route does not
 seem to pick it up.

 These are the headers that go over the wire:



 However, the MDC logging shows two separate breadcrumbIds. The proxy uses
 the one that is forwarded in the http header, but the web service still
 created a new one:



 The proxy and web service routes run in separate bundles inside the same
 Karaf server.
 Is there anything else I need to configure for the ws route to pick up the
 breadcrumbId? Or is this a bug?


 Thanks in advance,
 Ralf



 --
 View this message in context:
 http://camel.465427.n5.nabble.com/breadcrumbId-does-not-survive-http-call-tp5762528.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



Re: breadcrumbId does not survive http call

2015-02-10 Thread James Carman
In particular, you might be interested in line 107 of this class:

https://github.com/apache/camel/blob/master/components/camel-spring-ws/src/main/java/org/apache/camel/component/spring/ws/filter/impl/BasicMessageFilter.java



On Tue, Feb 10, 2015 at 7:07 AM, James Carman
ja...@carmanconsulting.com wrote:
 You probably want to read the section The custom header and
 attachment filtering from here:

 http://camel.apache.org/spring-web-services.html



 On Tue, Feb 10, 2015 at 3:39 AM, rsteppac2 r...@steppacher.name wrote:
 Hi James,

 this is how the route looks like I used as an example:



 Ralf



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/breadcrumbId-does-not-survive-http-call-tp5762528p5762530.html
 Sent from the Camel - Users mailing list archive at Nabble.com.


Re: breadcrumbId does not survive http call

2015-02-10 Thread James Carman
You probably want to read the section The custom header and
attachment filtering from here:

http://camel.apache.org/spring-web-services.html



On Tue, Feb 10, 2015 at 3:39 AM, rsteppac2 r...@steppacher.name wrote:
 Hi James,

 this is how the route looks like I used as an example:



 Ralf



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/breadcrumbId-does-not-survive-http-call-tp5762528p5762530.html
 Sent from the Camel - Users mailing list archive at Nabble.com.


Re: breadcrumbId does not survive http call

2015-02-10 Thread James Carman
It's an easy thing to test, right?  Just copy/paste the default impl
into your source and modify it NOT to remove the header.  If you're
right, the problem will still be there.  If I'm right, your problem is
fixed.  It should take you 2 mins tops to wire this up, so you have
very little to lose trying it.  I'm fine with being wrong (it happens
a lot, ask my wife), but if I were you, I wouldn't dismiss the idea
with I don't think since making sure is a simple exercise.

On Tue, Feb 10, 2015 at 8:24 AM, rsteppac2 r...@steppacher.name wrote:
 James,

 thanks for your answer. However, I don't think the BasicMessageFilter is
 responsible for the breadcrumbId not being picked up. The filter is about
 populating the SOAP header element from exchange headers, not the other way
 round.
 My proxy does not use spring-ws, but works on plain http. The proxy does
 some inspection of the raw SOAP XML and SAML header and on success forwards
 the request. The breadcrumbId is set as an HTTP header as expected on the
 forward.  But it is not unmarshalled as an exchange header in my web service
 route. The documentation page for MDC logging claims that the header
 survives across an HTTP transport. Though might be I am expecting too much
 and the claim to support HTTP transport does not include X over HTTP. But
 really just plain HTTP endpoints.

 This is my proxy route:




 Ralf



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/breadcrumbId-does-not-survive-http-call-tp5762528p5762566.html
 Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Is it possible to intercept camel proxy calls?

2015-02-09 Thread James Carman
To be fair, I just did exactly that for a client, so it was fresh on
my mind at the time. :)  Good luck!  Glad to help.


On Mon, Feb 9, 2015 at 2:09 PM, lutfijd lutf...@gmail.com wrote:
 went with the first suggestion, works like a charm, thanks. (why didn't i
 think of that)



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Is-it-possible-to-intercept-camel-proxy-calls-tp5762472p5762515.html
 Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Is it possible to intercept camel proxy calls?

2015-02-08 Thread James Carman
You want to use camel to intercept?  You don't have to proxy straight to
the endpoint.  You could create a new route with a new entry point (a
direct endpoint or something) that terminates at the other endpoint and put
your proxy in front of that.

You could always wrap the proxy in your own dynamic proxy to do AOPish
stuff to it too.

On Friday, February 6, 2015, lutfijd lutf...@gmail.com wrote:

 I have a client application that uses camel proxies to communicate with the
 server (through activemq), i need to intercept the messages on the client
 side before they are sent to the server.

 im using spring and camel (2.9.1), i read the page on interceptors and
 tried
 using them (maily interceptSendToEndpoint) but unfortunately none could
 intercept the messages.

 when i use interceptSendToEndpoint, i can see the following log entry
 19:29:36.405 [main] DEBUG o.a.c.m.InterceptSendToEndpointDefinition -
 Endpoint interceptor should not be added as an event driven consumer route:
 Channel[InterceptEndpointProcessor[*Service -
 Channel[sendTo(Endpoint[direct://InterceptHelper])]]]

 I also tried implementing an interceptionStrategy class, it also wasnt
 intercepting the exchange before they are sent to the queue.

 Thanks



 --
 View this message in context:
 http://camel.465427.n5.nabble.com/Is-it-possible-to-intercept-camel-proxy-calls-tp5762472.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



Re: Please remove me from this list

2014-06-13 Thread James Carman
Send an email to users-unsubscr...@camel.apache.org (as long as you're
sending from the subscribed account).  You'll get back an email asking
you to reply to confirm you want to leave.


On Fri, Jun 13, 2014 at 1:27 PM, Sealfon, Rebecca
rebecca.seal...@citi.com wrote:
 Hi,

 Sorry to spam.  I've deleted my account but am still getting these Camel 
 related emails.  How can I be removed from this list?

 Thanks,
 Rebecca


Re: LoadBalancing does not increaing performace

2014-01-31 Thread James Carman
You're also using direct endpoints in your load balancer.  That's
not going to help you, since it'll just stay on the same thread.
Check out my example here and look at the output:

https://github.com/jwcarman/camel-sandbox/blob/master/src/test/java/com/carmanconsulting/sandbox/camel/LoadBalancerTest.java

On my machine:

[  main] LoadBalancerTest   INFO
Received message Testing 1 on thread main.
[  main] LoadBalancerTest   INFO
Received message Testing 1 on thread main.
[  main] LoadBalancerTest   INFO
Received message Testing 2 on thread main.
[  main] LoadBalancerTest   INFO
Received message Testing 2 on thread main.


On Fri, Jan 31, 2014 at 11:10 AM, Shing Hing Man mat...@yahoo.com wrote:
 Hi,

 I am using Camel 2.11  and I have the following route.

 from(jetty:http://; + hostURL + /adtruth?matchOnUriPrefix=true)
 .process(myProcessor);
 where myProcessor just does a http redirect.



 I am trying to increase the throughput of the above route  (to able to handle 
 more messages per second), by using load balancing round robin :

 from(jetty:http://; + hostURL + /test?matchOnUriPrefix=true)
 .loadBalance().roundRobin()
 .to(direct:worker1)
 .to(direct:worker2)
 .end()
 from(direct:worker1).process(myProcessor);
 from(direct:worker2).process(myProcessor);

 From my bench test,  the performance of the round robin route is similar to 
 the earlier simple route.
 I have also tried replacing direct with seda, but  it resulted in worst 
 performance.



 What is wrong with my round robin route ?

 Thanks in advance for any assistance !

 Shing


Re: Can I write a route that reads an arbitrary database table and stores it in a file?

2014-01-06 Thread James Carman
Yeah, I don't think the SQL component will work for you, since it
requires a DataSource object up front.  Perhaps you can borrow from
it?  That would be overkill IMHO, though


On Mon, Jan 6, 2014 at 9:22 AM, Lothar Werzinger lot...@tradescape.biz wrote:
 I was afraid that I might have to implement that as Java code in a
 processor.
 I was hoping for some kind of dynamic route building that would allow me to
 use the jdbc or sql component.

 Thanks anyway


 On Fri, Jan 3, 2014 at 5:46 PM, James Carman 
 ja...@carmanconsulting.comwrote:

 It's possible, but probably not advisable. :)

 from(cxf:bean:foo).process(new Processor() {
 @Override
 public void process(Exchange exchange) throws
 Exception {
 // Query the database and build up the
 JSONifiable data structure here...
 }
 }).marshal(new JsonDataFormat()).to(file:foo);

 On Fri, Jan 3, 2014 at 8:34 PM, Lothar Werzinger lot...@tradescape.biz
 wrote:
  Hi,
 
  I have the requirement to write a route that listens on a web service
  endpoint and that is supposed to read a database table where the
 connection
  information (host, port, ...) and the table name are passed in via the
 web
  service call, convert the table data to JSON and write it to a file.
 
  Is such a route possible? If yes, can you please point me in the right
  direction?
 
  Thanks in advance!
  --
 
  Lothar Werzinger
 
  Principal Architect
 
  Tradescape, Inc. - Enabling Efficient Digital Marketplaces
 
  +1-650-931-6719 (direct)
 
  +1-800-697-6068 (main) Ext. 116
 
  lot...@tradescape.biz
 
  http://www.tradescape.biz
 
  --
 
 
  This message and any attachment (the message) is intended solely for
 the
  addressees and is confidential. If you receive this message by mistake,
  please delete it and notify the sender immediately. Any use not
  in accordance with its purpose, any out-spread or disclosure, either as a
  whole or partially, is prohibited except with formal approval. Internet
  cannot guarantee the integrity of this message, therefore Tradescape will
  not be liable for the message if modified.
 
  -




 --

 Lothar Werzinger

 Principal Architect

 Tradescape, Inc. - Enabling Efficient Digital Marketplaces

 +1-650-931-6719 (direct)

 +1-800-697-6068 (main) Ext. 116

 lot...@tradescape.biz

 http://www.tradescape.biz

 --


 This message and any attachment (the message) is intended solely for the
 addressees and is confidential. If you receive this message by mistake,
 please delete it and notify the sender immediately. Any use not
 in accordance with its purpose, any out-spread or disclosure, either as a
 whole or partially, is prohibited except with formal approval. Internet
 cannot guarantee the integrity of this message, therefore Tradescape will
 not be liable for the message if modified.

 -


Re: Can I write a route that reads an arbitrary database table and stores it in a file?

2014-01-03 Thread James Carman
It's possible, but probably not advisable. :)

from(cxf:bean:foo).process(new Processor() {
@Override
public void process(Exchange exchange) throws Exception {
// Query the database and build up the
JSONifiable data structure here...
}
}).marshal(new JsonDataFormat()).to(file:foo);

On Fri, Jan 3, 2014 at 8:34 PM, Lothar Werzinger lot...@tradescape.biz wrote:
 Hi,

 I have the requirement to write a route that listens on a web service
 endpoint and that is supposed to read a database table where the connection
 information (host, port, ...) and the table name are passed in via the web
 service call, convert the table data to JSON and write it to a file.

 Is such a route possible? If yes, can you please point me in the right
 direction?

 Thanks in advance!
 --

 Lothar Werzinger

 Principal Architect

 Tradescape, Inc. - Enabling Efficient Digital Marketplaces

 +1-650-931-6719 (direct)

 +1-800-697-6068 (main) Ext. 116

 lot...@tradescape.biz

 http://www.tradescape.biz

 --


 This message and any attachment (the message) is intended solely for the
 addressees and is confidential. If you receive this message by mistake,
 please delete it and notify the sender immediately. Any use not
 in accordance with its purpose, any out-spread or disclosure, either as a
 whole or partially, is prohibited except with formal approval. Internet
 cannot guarantee the integrity of this message, therefore Tradescape will
 not be liable for the message if modified.

 -


Re: Master Slave Camel-ActiveMQ

2013-12-31 Thread James Carman
ActiveMQ or WebSphere MQ?

On Monday, December 30, 2013, Preethi wrote:

 Hi

 We are trying to setup Master slave for ActiveMQ using camel-context. Our
 current architecture is like this.


1.  A camel route which subscribes to MQ topics (these MQ topics are IBM
 topics).
2.  This camel route then takes the message from the topic and
 transforms
 it
3.  The transformed message is saved in the database.

 I have been trying to setup master slave but have not been successful so
 far. This is what I'm doing

 A.An instance of this application deployed on  tomcat.
 B.The slave is just another instance of this same application.Please note
 that the clientids and the subscriber names are the same on both these
 instances. Hence the slave would give the following exception , which is
 expected.

 Cause: JMSWMQ0026: Failed to subscribe to topic '#/#/ITEM/MAINT' using
 MQSUB.; nested exception is com.ibm.mq.MQException: JMSCMQ0001: WebSphere
 MQ
 call failed with compcode '2' ('MQCC_FAILED') reason '2429'
 ('MQRC_SUBSCRIPTION_IN_USE').


 We are using the default KahaDBPersistenceAdapter . The issue here is that
 the slave container runs for few hours and just dies due to insufficient
 java heap space.
 I was trying to configure the kahadb adapter to not poll every 2-3 seconds
 ,
 which it seems to be doing , but haven't been successful so far.

  How do I configure the kahadb to poll during longer intervals (say 5
 mins)?
 Or are there any more options other than the kahadb for this Master Slave
 setup?



 --
 View this message in context:
 http://camel.465427.n5.nabble.com/Master-Slave-Camel-ActiveMQ-tp5745360.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



Re: Throttling by client ID?

2013-12-12 Thread James Carman
I have implemented a version of this logic here:

https://github.com/jwcarman/camel-sandbox/blob/master/src/main/java/com/carmanconsulting/sandbox/camel/throttle/ClientThrottler.java

There's a unit test here:

https://github.com/jwcarman/camel-sandbox/blob/master/src/test/java/com/carmanconsulting/sandbox/camel/throttle/ClientThrottlerTest.java

I'm sure it isn't perfect, but it gives you the general idea.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Throttling-by-client-ID-tp5741032p5744685.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: ISO8583

2013-12-09 Thread James Carman
Camel can support any binary format you want.  It doesn't have
built-in support for these, though.

On Mon, Dec 9, 2013 at 5:12 AM, Manoranjitham G
manoranjitha...@polarisft.com wrote:
 Does camel support ISO8583,ISO20022,EBCDIC dataformats?



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/ISO8583-tp5744502.html
 Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Content Based Routing with Camel

2013-12-09 Thread James Carman
Perhaps you can deserialize the object(s) first before doing CBR
(using a simple expression)?  Or, do you have to detect what type they
are first and then route to the appropriate deserializer?

On Mon, Dec 9, 2013 at 3:15 AM, madusanka
madusankabalasoor...@gmail.com wrote:
 Hi,

 I know that JSONPath component will be available as of camel 2.13. Is there
 a way to perform CBR for JSON payload in other versions of Apache Camel?



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Content-Based-Routing-with-Camel-tp5744495.html
 Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Content Based Routing with Camel

2013-12-09 Thread James Carman
He would need to use a Predicate for CBR.  Either way, it'd be easy to
do, as you pointed out, since it's just a library. :)

Or, if the destination can be calculated based on something in your
JSON (using an expression), you could do something like this:

from(...).deserialize(...).recipientList(simple(some simple expression);

On Mon, Dec 9, 2013 at 7:43 PM, Christian Posta
christian.po...@gmail.com wrote:
 If you're set on JsonPath, you can do so in a POJO or processor as
 it's just a library:

 http://code.google.com/p/json-path/

 On Mon, Dec 9, 2013 at 1:57 PM, Henryk Konsek hekon...@gmail.com wrote:
 Hi guys,

 Perhaps you can deserialize the object(s) first before doing CBR
 (using a simple expression)?

 This is very good suggestion, James. To make it a little more concrete:

 from(...).
   unmarshal().json(JsonLibrary.Gson, Map.class).
 choice().
   when().simple(${body[invoices][latest][netValue]  1000}).to(...).
   otherwise().to(...).
endChoice();

 You can use JSON data format [1] (I use Google GSON in the example) to
 deserialize incoming message. In the example below I deserialize it to
 Map, because I don't know the type of the message (to make things
 little more tricky). And yeah, GSON handles nested Maps pretty well.
 To analyse content of the nested maps structure you might use Simple
 [2] expression (as James suggested) because it supports nested map
 keys notation (as in the example). And nested maps keys is something
 similar to JsonPath you wanted to have :) .

 Cheers.

 [1] http://camel.apache.org/json
 [2] http://camel.apache.org/simple

 --
 Henryk Konsek
 http://henryk-konsek.blogspot.com



 --
 Christian Posta
 http://www.christianposta.com/blog
 twitter: @christianposta


Re: hawtio camel route layout/UI question.

2013-11-18 Thread James Carman
Perhaps you should send this email to their mailing list:

http://hawt.io/community/index.html


On Mon, Nov 18, 2013 at 2:22 PM, arparikh21 ashish.par...@cbeyond.net wrote:
 We use spring DSL for our camel route definitions. I just integrated hawtio
 with our dev environment and it is awesome..

 As part part of our route definition, we added id attribute to each of our
 node to give a meaningful business name.

 However, in the layout diagram, for each node (to's) it shows the uri and
 not what we defined in the id attribute. But in the left side navigation it
 shows the actual id attribute value.

 Can you please help me understand or point us in the direction to show the
 meaningful names in the  camel layout diagram instead of uris

 e.g.
 to id=MyBusinessRules 
 uri=drools:node1/theNewRule/


 In left side navigation under camel context shows : MyBusinessRules but in
 the camel layout shows drools:node1/theNewRul. I would like to see
 MyBusinessRule in the diagram as well..




 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/hawtio-camel-route-layout-UI-question-tp5743455.html
 Sent from the Camel - Users mailing list archive at Nabble.com.


Re: How to contribute to documentation?

2013-11-01 Thread James Carman
It helps when you have someone on the Camel PMC that does the ICLA filings. :)


On Fri, Nov 1, 2013 at 9:35 AM, Carsten Ringe cars...@kopis.de wrote:
 Am 2013-11-01 09:33, schrieb Claus Ibsen:

 And when that does, then create an account on the Camel wiki. eg click
 that edit button in the bottom, and create a new account (if you dont
 have)

 So when your name is on the ICLA list above, then we can grant your
 account edit rights.

 Ok, this happened faster than I thought. My name already shows up in the
 unlisted CLAs section on https://people.apache.org/committer-index.html.

 I created an account on the wiki, my username on Confluence is caringe,
 profile page https://cwiki.apache.org/confluence/display/~caringe. :-)


 Carsten




Re: Best way to consuming same queue from two brokers?

2013-10-23 Thread James Carman
The NoB should be routing your messages for you, shouldn't it?


On Wed, Oct 23, 2013 at 1:52 PM, dunnlow dunn...@yahoo.com wrote:
 Using Camel 2.10.3

 My question: What is the best way to consume msgs from multiple
 brokers/queues and feed those messages through a single route?

 Explanation:

 I currently consume from an activemq broker.  I have several different
 routes that consume messages from different queues on that broker.  Now, the
 admins have updated to a network of brokers.

 The producers of the messages are using failover (there are only two brokers
 at the moment).  Because those producers could place msgs on either broker,
 I want to check both brokers (I had a past issue on a different project
 where the producers failed over briefly and sent msgs to the backup that
 were never consumed even though I was using a failover url.  My solution at
 the time was to always check/consume from both primary and backup - ignoring
 failover - using a second activemq config to the secondary broker).

 My problem is that now I have many routes and I want msgs from either the
 primary or backup jms queue to propagate through those routes without having
 to duplicate the route for each broker.  For example, I DONT want to do this
 for each route (my actual routes are more complex than these):

 route
 from uri=activemq:queue:Queue1/
 bean ref=MyBean method=evaluate/
 to uri=direct:processit/
 /route

 route
 from uri=activemq2:queue:Queue1/
 bean ref=MyBean method=evaluate/
 to uri=direct:processit/
  /route

 I realize I could make the route above a direct route and then consume from
 each broker and send to it, but this still seems ugly:

 route
 from uri=direct_activemq_Queue1/
 bean ref=MyBean method=evaluate/
 to uri=direct:processit/
 /route

 route
 from uri=activemq1:queue:Queue1/
 to uri=direct:direct_activemq_Queue1/
 /route

 route
 from uri=activemq2:queue:Queue1/
 to uri=direct:direct_activemq_Queue1/
  /route

 I've considered combining into a single in-memory queue, but I've never done
 that before and would worry about robustness of the queue (I can't lose any
 messages).

 What is the smart way to do this?

 Thanks very much for any insight!

 -J




 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Best-way-to-consuming-same-queue-from-two-brokers-tp5742100.html
 Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Best way to consuming same queue from two brokers?

2013-10-23 Thread James Carman
Remember that a NoB is not a cluster, per se.  There is no
replication between brokers.  So, if one broker goes down while there
are messages sitting on it, then those messages are lost until the
broker comes back online.  If you're looking for high availability,
then you're barking up the wrong tree.  You need to look into a
Master/Slave setup.

On Wed, Oct 23, 2013 at 2:57 PM, dunnlow dunn...@yahoo.com wrote:
 Thanks James.  Well, yes... sort of.  If a producer sends to one broker, I
 can consume from either as expected...IF both brokers are ok.  My concern
 (that I have from my relayed past experience) is that if I use the failover
 uri and there is a problem, that my consumer will miss some of the message
 produced.  Maybe this isn't a legitimate concern (although, in my
 skepticism's defense, the admin who configured it expressed a lack in
 confidence about it's configuration).  Thus, I think the safest way forward
 may be to point a consumer to each of the brokers.  Considering more brokers
 may come online, what I guess there would be ideally it to funnel all of the
 brokers into a single endpoint from which I could process.  Does that make
 sense or am I way overcomplicating it?  Thanks again.


 James Carman wrote
 The NoB should be routing your messages for you, shouldn't it?





 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Best-way-to-consuming-same-queue-from-two-brokers-tp5742100p5742105.html
 Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Being able to post and reveice email notification to subscribed posts

2013-10-17 Thread James Carman
I don't think it's possible.  You could alternatively subscribe to the
'digest' notifications (once per day).  Send an email to
users-h...@camel.apache.org to get instructions on how to do that.

James

On Thu, Oct 17, 2013 at 4:47 AM, dmytro.puzhay dmytro.puz...@gmail.com wrote:
 Hi, thanks for answer.

 I've sent an email to users-subscr...@camel.apache.org and got confirmation
 link. After that I keep receiving emails about replies to posts I didn't
 know exist.

 I want to be able to freely post to this forum and get email notification if
 somebody replies TO THE TOPIC I'VE CREATED OR REPLIED TO, but not for all
 topics/replies on the forum!. Is it possible?


 contactreji wrote
 Hi..
 How did you subscribe to the forum?
 On subscription you should have got a confirmation link in your inbox..

 Reji


 On Wed, Oct 16, 2013 at 11:24 AM, dmytro.puzhay [via Camel] 

 ml-node+s465427n5741693h62@.nabble

 wrote:

 Hi all,

 I've read http://camel.apache.org/discussion-forums.html and
 http://camel.apache.org/mailing-lists.html and even subscribed to


 users-subscribe@.apache

 , but the matter still looks crypto more
 or less to me.

 Very simple question: I want to be able to freely post to this forum and
 get email notification if somebody replies to the topic I am subscribed
 to
 (god, not for all topics on the forum!). Is it possible to accomplish
 this
 with all that Nabble and mailing lists? :)

 --
  If you reply to this email, your message will be added to the discussion
 below:

 http://camel.465427.n5.nabble.com/Being-able-to-post-and-reveice-email-notification-to-subscribed-posts-tp5741693.html
  To unsubscribe from Camel - Users, click
 herelt;http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codeamp;node=465428amp;code=Y29udGFjdHJlamlAZ21haWwuY29tfDQ2NTQyOHwxMDA0OTE4MjMzgt;
 .
 NAMLlt;http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_vieweramp;id=instant_html%21nabble%3Aemail.namlamp;base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespaceamp;breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.namlgt;






 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Being-able-to-post-and-reveice-email-notification-to-subscribed-posts-tp5741693p5741729.html
 Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Being able to post and reveice email notification to subscribed posts

2013-10-17 Thread James Carman
Only if you want to get them answered ;)


On Thu, Oct 17, 2013 at 9:44 AM, dmytro.puzhay dmytro.puz...@gmail.com wrote:
 Hi James, thanks for answer. It looks like now I only get notifications for
 topics I am subscribed to. Does one still have to moderate my posts?


 James Carman wrote
 I don't think it's possible.  You could alternatively subscribe to the
 'digest' notifications (once per day).  Send an email to

 users-help@.apache

  to get instructions on how to do that.

 James





 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Being-able-to-post-and-reveice-email-notification-to-subscribed-posts-tp5741693p5741767.html
 Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Can't move excel files correctly, ActiveMQ bug?

2013-10-16 Thread James Carman
On what platform are you running your test?  I just ran a test using
your input file using two routes:

from(file://target/inbox).to(jms:queue:myfiles);
from(jms:queue:myfiles).to(file://target/outbox);

The file was copied from inbox to outbox and I was able to open the
file in excel.  If you would like, I can check in my example into
github for you to play with it.

James

On Wed, Oct 16, 2013 at 8:53 AM, niels_s steni...@gmail.com wrote:
 I did some more testing by replacing the activemq queues with direct's but
 the problem stays.
 I'm experiencing this only with Excel files. It seems like interroute
 communication is causing some issues, I'm guessing with encoding but just
 guessing.
 Never saw this before with other kind of files. Anybody an idea what could
 be causing this?
 Or how I could debug this a little further to get some more meaningful
 information?

 @Christian Mueller: Sorry, thought I was already subscribed, is there a way
 to see if I'm subscribed correctly now?



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Can-t-move-excel-files-correctly-ActiveMQ-bug-tp5741661p5741667.html
 Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Can't move excel files correctly, ActiveMQ bug?

2013-10-16 Thread James Carman
I'm on OSX too.  I ran just inside a test case.

https://github.com/jwcarman/camel-sandbox/blob/master/src/test/java/com/carmanconsulting/sandbox/camel/FileCopyTest.java


On Wed, Oct 16, 2013 at 9:27 AM, niels_s steni...@gmail.com wrote:
 Hi James,

 I'm running Mac OS X 10.8.4 with ServiceMix 4.5.1 and deployed a bundle with
 my camelcontext.

 Would be nice if you could push it to github, thans in advance

 Did you run it standalone? Or also in ServiceMix?

 Regards,

 Niels





 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Can-t-move-excel-files-correctly-ActiveMQ-bug-tp5741661p5741670.html
 Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Can't move excel files correctly, ActiveMQ bug?

2013-10-16 Thread James Carman
There are two routes created by the same route builder. Yes, I was
able to open the file from the outbox folder, successfully using
Excel for Mac.  Did you try downloading my example and running it
yourself?


On Wed, Oct 16, 2013 at 9:56 AM, niels_s steni...@gmail.com wrote:
 James,

 did you try to open the file after moving it? I don't experience any
 troubles moving around the file, omly keeping the content the same is an
 issue.

 Would your example involve 2 routes? Not that familiar with the Java DSL.
 Won't the routebuilder only create one route?



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Can-t-move-excel-files-correctly-ActiveMQ-bug-tp5741661p5741674.html
 Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Can't move excel files correctly, ActiveMQ bug?

2013-10-16 Thread James Carman
I added a spring-based test.  Do a rebase.

On Wed, Oct 16, 2013 at 10:38 AM, niels_s steni...@gmail.com wrote:
 Yes, I cloned your repo, got it running and it worked fine.
 In the meanwhile I created a spring DSL project you can find it here:
 https://github.com/niels-s/camel-spring-test
 Basically it's the same setup as your java DSL project. But the results are
 different.
 This time I can't open the file after it has been moved to the output repo.

 This is so strange, eventually the Java en Spring DSL should result in the
 same behavior.
 I can't switch to Java DSL in this project so I need to find a way to get
 this working.

 Thanks for the help so far, if you have any tips keep them coming



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Can-t-move-excel-files-correctly-ActiveMQ-bug-tp5741661p5741678.html
 Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Being able to post and reveice email notification to subscribed posts

2013-10-16 Thread James Carman
Send email to users-subscr...@camel.apache.org


On Wed, Oct 16, 2013 at 2:38 PM, rpcat rpcata...@gmail.com wrote:
 yes,

 from your email that you have used to create your nabble login, send an
 email to users@camel.apache.org with the subject subscribe





 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Being-able-to-post-and-reveice-email-notification-to-subscribed-posts-tp5741693p5741695.html
 Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Being able to post and reveice email notification to subscribed posts

2013-10-16 Thread James Carman
Did you send the confirmation email?

On Wed, Oct 16, 2013 at 2:46 PM, dmytro.puzhay dmytro.puz...@gmail.com wrote:
 Please read my post, I've written there that I already subscribed to
 users-subscr...@camel.apache.org


 James Carman wrote
 Send email to

 users-subscribe@.apache



 On Wed, Oct 16, 2013 at 2:38 PM, rpcat lt;

 rpcatania@

 gt; wrote:
 yes,

 from your email that you have used to create your nabble login, send an
 email to

 users@.apache

  with the subject subscribe





 --
 View this message in context:
 http://camel.465427.n5.nabble.com/Being-able-to-post-and-reveice-email-notification-to-subscribed-posts-tp5741693p5741695.html
 Sent from the Camel - Users mailing list archive at Nabble.com.





 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Being-able-to-post-and-reveice-email-notification-to-subscribed-posts-tp5741693p5741699.html
 Sent from the Camel - Users mailing list archive at Nabble.com.


Re: JMS(local) -to- JMS(remote) bridge

2013-10-15 Thread James Carman
You can't do a network of brokers with ActiveMQ?  I know you say you
may have to switch to Hornet, but why?  Is that the corporate
standard or do you have concerns about ActiveMQ's viability as a
production platform?

On Tue, Oct 15, 2013 at 5:31 PM, brenuart bertrand.renu...@itma.lu wrote:
 Hello,

 I need to setup a jms bridge to connect a local queue to a remote queue with
 a WAN network connection in between. The bridge must cope with
 unavailability of the remote queue because of network failure for instance:
 messages should stay in the local queue and be transparently redelivered
 when the remote queue becomes reachable.

 (Note: currently using ActiveMQ but may have to switch to HornetQ when in
 production)

 My first thought was to setup a simple Camel route that would consume from
 the local queue and deliver to the remote as follows:

route
   from uri=activemq-local:toremote /
   to uri=activemq-remote:fromlocal /
/route

 This works great but how would you handle failure (remote not available) and
 retry?

 Should I make the route transacted and rely on broker redelivery (instead of
 Camel redelivery)? The point is I don't want to loose messages in case the
 local Camel instance crashes. As far as I understand, without transaction,
 the message is removed from the queue and held in memory during the retry...

 Should I play with the Camel ErrorHandler and Redelivery policies?

 In other words, how would you do it?

 Thanks for your advices,
 /Bertrand



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/JMS-local-to-JMS-remote-bridge-tp5741622.html
 Sent from the Camel - Users mailing list archive at Nabble.com.


Netty: messages not propagated back from netty producer

2013-10-13 Thread James Carman
How is the component going to correlate the request with the response?

On Sunday, October 13, 2013, javakurious wrote:

 Upgraded the camel to 2.12.1 .

 No effect ! :(

 Here is the reiteration of the issue and a couple of additional
 observations:

 Route:
 I am getting a webservice request using CXF, I send the request to a remote
 server using netty and pass the response back to the webservice client.


 Given that the default behavior of Netty is async, it's causing a
 disconnect
 between CXF request and the response returned by Netty. Therefore, the
 webservice keeps getting empty response, even though the remote socket is
 responding to Netty , but its getting lost. If the webservice client keep
 sending requests, every once in a while, it actually sees a response.

 So, I set the synchronous parameter to be true. Now, Netty component keeps
 returning empty.It appears that Netty is not waiting for the response from
 remote server, and just moves on to next component. Is there a way to make
 netty block until it receives a response from remote socket ?

 Thanks








 --
 View this message in context:
 http://camel.465427.n5.nabble.com/Netty-messages-not-propagated-back-from-netty-producer-tp5741315p5741486.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



Re: Netty: messages not propagated back from netty producer

2013-10-13 Thread James Carman
I guess there's also the concept of what makes up a response.  How
does the endpoint know how many bytes are included in the response
message from the server?

On Sun, Oct 13, 2013 at 8:42 PM, javakurious javakuri...@gmail.com wrote:
 If I comment out the netty component, then everything works fine. So, CXF
 knows how to connect a request to its response.

 And I was hoping that Netty component does the same. What I don't understand
 is why setting the synchronous parameter to true is not making Netty wait
 for the response..

 Thanks



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Netty-messages-not-propagated-back-from-netty-producer-tp5741315p5741488.html
 Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Help with Dynamic route

2013-10-11 Thread James Carman
Have you tried just using a JMS topic?

On Fri, Oct 11, 2013 at 6:40 AM, gudiseashok gudise.as...@gmail.com wrote:
 Hi I have a requirement, I want start some routes and leave them with
 polling, after some time I want to add some more like that kind.


 example
 from uri=direct:start

 multicast

 to uri=direct:a
 to uri=direct:b

 multicast


 If I want to add another router dynamically to the multicast, like

 from uri=direct:start
 multicast
 .
 to uri=dynamic route here
 multicast


 is this possible if I add if i use dynamicroute configure ( ...from()
 to)
 rouytebuilder.add routes to contact(camelcontext
 like this?
 Please advice...




 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Help-with-Dynamic-route-tp5741336.html
 Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Help with Dynamic route

2013-10-11 Thread James Carman
There is a test case here:

https://github.com/jwcarman/camel-sandbox

Which will show you how to do JMS in camel using a topic.  It's just a
sandbox, but it sets up what you need to play with JMS/camel using
ActiveMQ


On Fri, Oct 11, 2013 at 9:56 AM, gudiseashok gudise.as...@gmail.com wrote:
 Hi James,

 Yeah thanks for pouring plenty of options :-), and I feel JMS Topic would
 fit more in this situation.
 Because what I want is, to have a main route (load on startup) which
 kick-off another routes which does FTP download (with poll-enrich so it will
 be keep on going), so by adding another routes like them should not disturb
 the existing routes which are running.

 Also that makes sence, what you have told about tamperiing existing
 multiprocessor. Shuttingdown existing existing routes and restart by adding
 additional routes (But anyhow I will try the JMS Topic solution first before
 doing this).

 Could you please provide (if you have already) UnitTestClass for this JMS
 Topic - which calls to add routing , never mind if you dont have one. I will
 start doing.

 Thanks again for taking time and helping me out.


 Regards
 Ashok Gudise






 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Help-with-Dynamic-route-tp5741336p5741358.html
 Sent from the Camel - Users mailing list archive at Nabble.com.


Re: How do I convert the map returned to Camel into JSON?

2013-10-11 Thread James Carman
Try converting the body to a String first (since it looks like it's a
byte[]), then log just the body.

On Fri, Oct 11, 2013 at 2:19 PM, erj2code p...@tetraconcepts.com wrote:
 This seems like such a simple thing to do, yet I can't seem to find it in the
 Camel documentation.

 Related to my last question i.e.,
 http://camel.465427.n5.nabble.com/Get-BeanCreationException-when-try-to-add-Jackson-Library-to-my-applicationContext-xml-td5741314.html
 I now have my code putting the JMS logging response messages into JSON
 format.

 Here's what I currently get when I run my code:

 23118 [hello.world.request.timer] INFO  hello.world.request  -
 Exchange[Id:e93861e4-a5be-4d63-b658-5939f414e595,
 ExchangePattern:InOnly, Properties:
 {CamelToEndpoint=log://hello.world.request?showAll=true,
 CamelTimerFiredTime=Fri Oct 11 12:03:20 EDT 2013,
 CamelTimerPeriod=1, CamelTimerName=hello.world.request.timer},
 Headers:{firedTime=Fri Oct 11 12:03:20 EDT 2013}, BodyType:null, Body:null,
 Out: null]

 Returning Map
 key= fruit1DataType, value= String
 key= fruit1, value= apple
 key= fruit1Calories, value= 95
 key= fruit1ColorDataType, value= String
 key= fruit1CaloriesDataType, value= int
 key= fruit1Color, value= red
 23122 [hello.world.request.timer] INFO  hello.world.response  -
 Exchange[Id:e93861e4-a5be-4d63-b658-5939f414e595,
 ExchangePattern:InOnly, Properties:
 {CamelToEndpoint=log://hello.world.response?showAll=true,
 CamelTimerFiredTime=Fri Oct 11 12:03:20 EDT 2013,
 CamelTimerPeriod=1, CamelTimerName=hello.world.request.timer},
 Headers:{firedTime=Fri Oct 11 12:03:20 EDT 2013}, BodyType:byte[], Body:
 {fruit1DataType:String,fruit1:apple,fruit1Calories:95,fruit1ColorDataType:St
 ring,fruit1CaloriesDataType:int,fruit1Color:red}, Out: null]


 Ideally I'd just like to have Camel convert the contents of the map returned
 to JSON and print it to the console like this:



 {fruit1DataType:String,fruit1:apple,fruit1Calories:95,fruit1ColorDataType:String,fruit1CaloriesDataType:int,fruit1Color:red},
 Out: null]

 How do I modify my applicationContext.xml to have Camel do this?

 I think I need a Camel JSON endpoint in route to serialize my map to JSON.
 I found this JSON FAQ:
 http://camel.apache.org/how-do-i-configure-endpoints.html but its not clear
 to me how I would adapt this to serialize my map to JSON.

 Here's my current applicationContext.xml:

 ?xml version=1.0 encoding=UTF-8?

 beans xmlns=http://www.springframework.org/schema/beans;
 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
 xmlns:camel=http://camel.apache.org/schema/spring;
 xmlns:context=http://www.springframework.org/schema/context;
 xmlns:util=http://www.springframework.org/schema/util;
 xsi:schemaLocation=
 http://www.springframework.org/schema/beans
 http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
 http://www.springframework.org/schema/util
 http://www.springframework.org/schema/util/spring-util-3.0.xsd
 http://camel.apache.org/schema/spring
 http://camel.apache.org/schema/spring/camel-spring.xsd
 http://www.springframework.org/schema/context
 http://www.springframework.org/schema/context/spring-context.xsd;

 bean

 class=org.springframework.context.annotation.CommonAnnotationBeanPostProcessor
 /
 context:component-scan base-package=sample /
 context:annotation-config /

 camel:camelContext id=HelloWorldContext


 camel:dataFormats
   camel:json id=jack library=Jackson/
 /camel:dataFormats

 camel:route

 camel:from

 uri=timer://hello.world.request.timer?fixedRate=trueamp;period=1 /
 camel:to
 uri=log:hello.world.request?level=INFO?showAll=true /
 camel:bean ref=helloWorld /


 camel:marshal ref =jack/
 camel:to
 uri=log:hello.world.response?level=INFO?showAll=true /
 /camel:route

 /camel:camelContext

 bean id=jms
 class=org.apache.activemq.camel.component.ActiveMQComponent
 property name=configuration ref=jmsConfig /
 /bean

 bean id=jmsConfig
 class=org.apache.camel.component.jms.JmsConfiguration
 property name=connectionFactory ref=jmsConnectionFactory /
 property name=transacted value=false /
 property name=concurrentConsumers value=1 /
 /bean

 bean id=jmsConnectionFactory
 class=org.apache.activemq.ActiveMQConnectionFactory
 property name=brokerURL value=vm://localhost /
 property name=redeliveryPolicy ref=redeliveryPolicy /
 property name=prefetchPolicy ref=prefetchPolicy /
 /bean

 bean id=prefetchPolicy
 class=org.apache.activemq.ActiveMQPrefetchPolicy
 property name=queuePrefetch value=5 /
 /bean

 bean 

Re: How do I convert the map returned to Camel into JSON?

2013-10-11 Thread James Carman
Try something like this:

camel:route
  camel:from 
uri=timer://hello.world.request.timer?fixedRate=trueamp;period=1
/
  camel:to uri=log:hello.world.request?level=INFO?showAll=true /
  camel:bean ref=helloWorld /
  camel:marshal ref =jack/
  camel:convertBodyTo type=java.lang.String /
  camel:log message=${body}/
  camel:to uri=log:hello.world.response?level=INFO?showAll=true /
/camel:route

On Fri, Oct 11, 2013 at 3:22 PM, erj2code p...@tetraconcepts.com wrote:
 Would I use convertBodyTo described on
 http://camel.apache.org/convertbodyto.html to convert the body to String?

 I'm still a newbie with Camel; could you show me an example?



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/How-do-I-convert-the-map-returned-to-Camel-into-JSON-tp5741370p5741375.html
 Sent from the Camel - Users mailing list archive at Nabble.com.


Re: How do I convert the map returned to Camel into JSON?

2013-10-11 Thread James Carman
No problem.  Happy camel riding!

On Fri, Oct 11, 2013 at 3:38 PM, erj2code p...@tetraconcepts.com wrote:
 Thanks, that worked!



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/How-do-I-convert-the-map-returned-to-Camel-into-JSON-tp5741370p5741377.html
 Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Consume files periodically or on demand

2013-10-09 Thread James Carman
Try pollEnrich() and have two ways of kicking off your route, one
would be with a timer of some sort (the every 8 hours).  The other
would be a JMS queue or direct or seda or something.

On Wed, Oct 9, 2013 at 8:50 AM, christoffer christof...@k15t.com wrote:
 Hi,

 I have a route which uses the file:// component to consume files from a
 directory. The polling interval will be quite large, between 8 hours and a
 day. But now the customer added a new requirement to also consume the files
 on demand - i.e. when he clicks a button. The periodical consumption should
 still work.
 Now my question is: Is there a smart way to do this with Camel, e.g. send a
 trigger message or alike?

 I am using Camel 2.11.0 and Java 6 (Oracle). I have used the Java DSL with
 CamelRouteBuilder to configure my routes.

 Thanks in advance to all camel riders - cheers Chris



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Consume-files-periodically-or-on-demand-tp5741235.html
 Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Throttling by client ID?

2013-10-09 Thread James Carman
On Wed, Oct 9, 2013 at 4:27 PM, Christian Müller
christian.muel...@gmail.com wrote:
 The solution could be something like:

 from(...)
   .throttle(100, header(foo))
   .to(...);

 header(foo) is only an example for an expression...


Yes, that's the idea.  Sounds like a useful enough feature, IMHO.


Re: Throttling by client ID?

2013-10-08 Thread James Carman
The idea would be basically what Claus said.  You'd have an expression
you use in order to correlate messages with one another.  This
expression would be evaluated against incoming messages and the result
would be used to lookup the throttling state for that group in some
map (probably a ConcurrentHashMap wrapped by LRU to prevent memory
leaks or something).

On Mon, Oct 7, 2013 at 3:51 PM, Daniel Bularzik d...@akc.org wrote:
 So obviously, instead of asking Is there a way... I should have asked How 
 do I...

 Consider this a restatement of my original question. How would I go about 
 doing this? A summary of a whiteboard implementation would be sufficient.


 -Original Message-
 From: jcar...@carmanconsulting.com [mailto:jcar...@carmanconsulting.com] On 
 Behalf Of James Carman
 Sent: Monday, October 07, 2013 8:08 AM
 To: users@camel.apache.org
 Subject: Re: Throttling by client ID?

 I actually had to implement that on a whiteboard when interviewing for a 
 certain tech company.  It's not terribly difficult to implement such a beast.


 On Mon, Oct 7, 2013 at 7:59 AM, Daniel Bularzik d...@akc.org wrote:

  We're looking to enforce a per-client SLA; notably, right now we're
 considering how to throttle service use on a per-client basis. I've
 found the Throttler Pattern, but this appears to only useful for
 throttling overall use of the service. Is there a way to use Throttler
 to limit access on a per-client basis? Assume the client ID is
 available in the exchange.*
 ***

 ** **

 Daniel Bularzik, Lead Software Engineer

 8051 Arco Corporate Drive, Suite 100, Raleigh, NC 27617

 919-816-3818, d...@akc.org

 www.akc.org   Facebook https://www.facebook.com/AmericanKennelClub
 Twitter https://twitter.com/akcdoglovers

 ** **



Throttling by client ID?

2013-10-08 Thread James Carman
That is not exactly what the request is about.  It is not throttling only
certain clients. It is throttling all clients but throttling them
individually.  For example, clients cannot send more than 5 requests per
minute per some SLA.

On Tuesday, October 8, 2013, Christian Posta wrote:

 I'll open a JIRA. This seems like a nice feature on the Throttler EIP to
 throttle for certain groups.

 However, couldn't you just route to the throttler?


 from(input).choice().when(clientIdMatch).to(seda:throttle).otherwise().to(direct:service)

 from(seda:throttle).throttle().to(direct:service)


 On Tue, Oct 8, 2013 at 6:57 AM, James Carman ja...@carmanconsulting.com
 wrote:

  The idea would be basically what Claus said.  You'd have an expression
  you use in order to correlate messages with one another.  This
  expression would be evaluated against incoming messages and the result
  would be used to lookup the throttling state for that group in some
  map (probably a ConcurrentHashMap wrapped by LRU to prevent memory
  leaks or something).
 
  On Mon, Oct 7, 2013 at 3:51 PM, Daniel Bularzik d...@akc.org wrote:
   So obviously, instead of asking Is there a way... I should have asked
  How do I...
  
   Consider this a restatement of my original question. How would I go
  about doing this? A summary of a whiteboard implementation would be
  sufficient.
  
  
   -Original Message-
   From: jcar...@carmanconsulting.com [mailto:
 jcar...@carmanconsulting.com]
  On Behalf Of James Carman
   Sent: Monday, October 07, 2013 8:08 AM
   To: users@camel.apache.org
   Subject: Re: Throttling by client ID?
  
   I actually had to implement that on a whiteboard when interviewing for
 a
  certain tech company.  It's not terribly difficult to implement such a
  beast.
  
  
   On Mon, Oct 7, 2013 at 7:59 AM, Daniel Bularzik d...@akc.org wrote:
  
We're looking to enforce a per-client SLA; notably, right now we're
   considering how to throttle service use on a per-client basis. I've
   found the Throttler Pattern, but this appears to only useful for
   throttling overall use of the service. Is there a way to use Throttler
   to limit access on a per-client basis? Assume the client ID is
   available in the exchange.*
   ***
  
   ** **
  
   Daniel Bularzik, Lead Software Engineer
  
   8051 Arco Corporate Drive, Suite 100, Raleigh, NC 27617
  
   919-816-3818, d...@akc.org
  
   www.akc.org   Facebook https://www.facebook.com/AmericanKennelClub
   Twitter https://twitter.com/akcdoglovers
  
   ** **
  
 



 --
 *Christian Posta*
 http://www.christianposta.com/blog
 twitter: @christianposta



Re: Apache Camel Components Poster - (FREE) PDF, JPG URL Links

2013-10-08 Thread James Carman
Many thanks for your efforts!  Great job!

On Tuesday, October 8, 2013, Robert James Liguori wrote:

 Apache Camel 2.12.1 and External Components Poster

 FREE PDFs
 http://gliesian.com/camel/ApacheCamelComponents.pdf
 http://gliesian.com/camel/ApacheCamelComponentsCropMarksAndBleed.pdf

 FREE JPG
 http://gliesian.com/camel/ApacheCamelComponents.jpg

 Ideal print size: 36x24 inches (so the 9pt text font can be read as 9pt).


 Possible printing option #1:
 Just take the above PDF or JPG and use any printing resource you have
 available to you.
 Note: With this option, you can find the most cost effective way for you
 to print the poster.


 Possible printing option #2:
 http://www.uprinting.com/large-format-posters-printing.html
 Note: I did this for the 36x24 dimensions, and it came out awesome!
 Note: Use this file: http://gliesian.com/camel/ApacheCamelComponents.pdffor 
 upload.


 Possible printing option #3:

 http://fineartamerica.com/featured/apache-camel-components-poster-gliesian-llc.html
 Note: I set products on here as the cheapest that the site allowed me to
 set them as.  So, if 600 posters are purchased, I would break even from
 this endeavor. :)  I doubt this would happen though, as I encourage
 everyone to strongly consider options 1 and 2 first.

 Enjoy the poster. Note that it is not perfect, but I did my best. Upcoming
 refinements are planned.

 -- Robert

 Thumbnails
 http://gliesian.com/camel/accp-thumb-mini.jpg
 http://gliesian.com/camel/accp-thumb.jpg
 http://gliesian.com/camel/accp-thumb-2.jpg


Re: Throttling by client ID?

2013-10-07 Thread James Carman
I actually had to implement that on a whiteboard when interviewing for a
certain tech company.  It's not terribly difficult to implement such a
beast.


On Mon, Oct 7, 2013 at 7:59 AM, Daniel Bularzik d...@akc.org wrote:

  We’re looking to enforce a per-client SLA; notably, right now we’re
 considering how to throttle service use on a per-client basis. I’ve found
 the Throttler Pattern, but this appears to only useful for throttling
 overall use of the service. Is there a way to use Throttler to limit access
 on a per-client basis? Assume the client ID is available in the exchange.*
 ***

 ** **

 Daniel Bularzik, Lead Software Engineer

 8051 Arco Corporate Drive, Suite 100, Raleigh, NC 27617

 919-816-3818, d...@akc.org

 www.akc.org   Facebook https://www.facebook.com/AmericanKennelClub
 Twitter https://twitter.com/akcdoglovers

 ** **



Re: How to programmatically find next downstream endpoint in a route.

2013-10-07 Thread James Carman
The next step in the route may not be an endpoint, so it's not
addressable in that way.

On Mon, Oct 7, 2013 at 12:02 PM, Chris cwolf.a...@gmail.com wrote:
 James, thanks for the suggestion - I'll try that, however, I would still
 like to know if/how a given endpoint can programmtically find the next
 down-stream endpoint in a route...


 On 10/4/2013 1:38 PM, James Carman wrote:

 Does a splitter not work for you in this case?

 On Fri, Oct 4, 2013 at 1:28 PM, Chris cwolf.a...@gmail.com wrote:

 Hello,

 I implemented a bean whose method accepts an exchange with a single
 message,
 then generates multiple messages intended for the next endpoint
 down-stream,
 along the lines of this:


 http://camel.apache.org/how-do-i-write-a-custom-processor-which-sends-multiple-messages.html


 However, I'd like to avoid having to explicitly configure the endpoint in
 the bean's ProducerTemplate if it can be found in the route definition.

 In other words, if I have:

 from(direct:start)
 .enrich(bean:MyBean)
 .to(mock:result);   this should be sufficient to indicate producer
 target URI.

 ...and MyBean is:

 public MyBean {
protected ProducerTemplate producer;
public void businessLogic(Exchange exchange) {
if (producer == null) {
producer = exchange.createProducerTemplate();
producer.setDefaultEndpointUri(mock:result);  Why should
 I
 have to do this?  I just want it to go to the next down-stream endpoint
 in
 the pipeline, already defined in the route!!
}
[...bla, bla, bla...]
while (hasStuffToSend) {
producer.setBody(stuff[i]);
}
}
 }





Re: How to programmatically find next downstream endpoint in a route.

2013-10-04 Thread James Carman
Does a splitter not work for you in this case?

On Fri, Oct 4, 2013 at 1:28 PM, Chris cwolf.a...@gmail.com wrote:
 Hello,

 I implemented a bean whose method accepts an exchange with a single message,
 then generates multiple messages intended for the next endpoint down-stream,
 along the lines of this:

 http://camel.apache.org/how-do-i-write-a-custom-processor-which-sends-multiple-messages.html


 However, I'd like to avoid having to explicitly configure the endpoint in
 the bean's ProducerTemplate if it can be found in the route definition.

 In other words, if I have:

 from(direct:start)
 .enrich(bean:MyBean)
 .to(mock:result);   this should be sufficient to indicate producer
 target URI.

 ...and MyBean is:

 public MyBean {
   protected ProducerTemplate producer;
   public void businessLogic(Exchange exchange) {
   if (producer == null) {
   producer = exchange.createProducerTemplate();
   producer.setDefaultEndpointUri(mock:result);  Why should I
 have to do this?  I just want it to go to the next down-stream endpoint in
 the pipeline, already defined in the route!!
   }
   [...bla, bla, bla...]
   while (hasStuffToSend) {
   producer.setBody(stuff[i]);
   }
   }
 }




Re: The Camel Components Poster - PDF - FREE

2013-10-04 Thread James Carman
Thanks, Shane!  We appreciate your guidance.

James

On Fri, Oct 4, 2013 at 5:12 PM, Shane Curcuru a...@shanecurcuru.org wrote:
 (Please note the mix of mailing lists)

 The most important thing is that Apache product brands are referred to by
 their full name - i.e. Apache Camel - in at least both the first and most
 prominent places in a document.  That means the title (either graphically in
 the display, or the window title in a PDF viewer, whatever) should include
 Apache Camel wherever practical.

 Beyond that, this looks like a great poster; I wasn't even aware of how many
 different direct integration points are already out there!

 Since this is clearly educational materials, a cheatsheet, or additional
 documentation about Apache Camel and related software that goes above and
 beyond what the camel.apache.org website provides as normal documentation,
 it's perfectly appropriate to include a footer or other Created by
 attribution for whoever does the work to create this.  So the logo in the
 footer is fine, especially because it's not directly with the Camel name or
 logo.  It's certainly appropriate for your company to get credit for the
 design!

 As a volunteer-run public charity that produces software for the public
 good, we need to ensure that our trademarks are respected, especially by
 software vendors of all stripes.  However outside individuals and companies
 producing extra educational materials about Apache software - like training,
 books, and cool API docs like this - can help users to find out about and
 make use of Apache software, which is a benefit to everyone.  As long as our
 brands are respected, we definitely appreciate the work people do like this.

 Thanks,
 - Shane Curcuru
   VP, Brand Management




 On 10/4/13 5:00 PM, Christian Müller wrote:

 Hi Robert!

 Thanks for your good work. We appreciate it. It looks really cool and I
 think this poster provides a good overview which components do we have
 in each particular area.

 As outlined in [1] and mentioned by James, you should
 - refer to The Apache Camel Components Poster instead of The Camel
 Components Poster

 Thanks for your cooperation and willing to update the poster.

 I don't think it's an issue to have the GLIESIAN, LLC. whatermark and
 footer, but prefer to have the trademarks ok. Therefore, I also put
 trademarks@ in CC to request their permission that you can publish/sell
 this poster [2] after the mentioned update.

 [1] http://www.apache.org/foundation/marks/#guidelines
 [2] http://gliesian.com/camel/TheCamelComponentPosterWithWatermark.pdf

 Best,

 Christian Müller
 V.P. Apache Camel


 On Fri, Oct 4, 2013 at 12:22 AM, gliesian glies...@yahoo.com
 mailto:glies...@yahoo.com wrote:

 Hi James,

 I looked at the cover of the Camel in Action book and Apache is
 not
 mentioned anywhere:

 http://www.amazon.com/Camel-Action-Claus-Ibsen/dp/1935182366/ref=sr_1_1?ie=UTF8qid=1380838736sr=8-1keywords=camel+in+action

 So, I figured that the approach I took with the title of the poster
 was
 okay, The Camel Components Poster.

 I do mention Apache in a few places on the poster...
 (1) Bottom left: Camel Components (Apache and External)
 (2) Bottom right: http://camel.apache.org/components.html
 (3) In some of the descriptions: e.g. Apache ServiceMix.

 I can update the poster anyway that is appropriate, please just let
 me know
 exactly what to do, and I will do it.

 Sincerely,
 Robert Liguori





 --
 View this message in context:

 http://camel.465427.n5.nabble.com/The-Camel-Components-Poster-PDF-FREE-tp5740752p5740847.html
 Sent from the Camel - Users mailing list archive at Nabble.com.





Re: OSGI marshal and bindy

2013-10-03 Thread James Carman
You depend on Spring APIs, not the container.  The Aries transaction
manager implements PlatformTransactionManager, allowing you to use
transactions in OSGi without running in a Spring container.

On Thursday, October 3, 2013, Charles Moulliard wrote:

 Best way James excepted for Camel Tx Route as we depend on Spring and
 blueprint can be used until now ;-)


 On Mon, Sep 30, 2013 at 1:53 PM, James Carman 
 ja...@carmanconsulting.comjavascript:;
 wrote:

  You should really consider using camel-blueprint.  This is the best
  way to use Camel in an OSGi environment.  You will run into quite a
  bit of troubles to get everything working right if you try to do it
  manually.
 
  On Mon, Sep 30, 2013 at 7:06 AM, mabels meno.ab...@adviser.com wrote:
   Hello,
  
   i now use the OsgiDefaultCamelContext and now it runs like excepted. I
  had
   to
   install
  
   osgi:install -s mvn:org.apache.camel/camel-core-osgi/2.12.1
  
   features:install eventadmin
  
   these both are needed some how.
  
   Thanks
  
   meno
  
  
   On Mon, Sep 30, 2013 at 12:21 PM, Claus Ibsen-2 [via Camel] 
   ml-node+s465427n5740481...@n5.nabble.com wrote:
  
   Hi
  
   You cannot use the DefaultCamelContext, you have to use an OSGi one.
   Also the package scan should be osgi aware.
  
   Though its often easier to use a blueprint xml file to bootstrap Camel
   in OSGi as it setup all the OSGi stuff for you.
  
   Though in camel-core-osgi there is the osgi pieces you would need to
   do this manually.
  
  
   On Mon, Sep 30, 2013 at 12:10 PM, mabels [hidden email]
  http://user/SendEmail.jtp?type=nodenode=5740481i=0
   wrote:
  
Hello,
   
what you mean how i run it, i have a small bundle which i start with
osgi::install ...
in karaf. In prepartion i loaded all needed camel features.
The Activator looks like this:
   
final CamelContext camelContext = new DefaultCamelContext();
camelContext.disableJMX();
DefaultPackageScanClassResolver defaultPackageScanClassResolver
 =
   new
DefaultPackageScanClassResolver();
camelContext.addComponent(filer, new FilerComponent());
try {
  camelContext.addRoutes(new RouteBuilder() {
public void configure() {
  DataFormat bindy = new ShopFeedProdukt();
   
  from(file:///tmp/input)
  .split(org.apache.camel.component.stax.StAXBuilder
  .stax(ShopFeedProdukt.class, false))
  .streaming()
  .marshal(bindy)
  //.marshal().bindy(BindyType.Csv,
org.apache.camel.bindy.model)
  //.marshal(new
  BindyCsvDataFormat(ShopFeedProdukt.class))
  .to(filer:///tmp/output?suffix=.csv)
  .end();
   
}
  });
  camelContext.start();
   
Hopefully this helps
   
meno
   
   
On Mon, Sep 30, 2013 at 12:05 PM, Claus Ibsen-2 [via Camel] 
[hidden email] 
 http://user/SendEmail.jtp?type=nodenode=5740481i=1
  
   wrote:
   --
 Charles Moulliard
 Apache Committer / Architect @RedHat
 Twitter : @cmoulliard | Blog :  http://cmoulliard.github.io



Re: Apache Camel - war project How to process the Queue and set to another queue?

2013-10-03 Thread James Carman
That second route with no to is stealing your messages, I'd guess.
 I am actually surprised you're able to create a route with no to.
I'm curious to play with that phenomenon in a test case.

On Thu, Oct 3, 2013 at 11:36 AM, Andreas Gies andr...@wayofquality.de wrote:
 Hi,

 it might be me, but I think your 2nd route is missing a to-element.
 You need to do something with message like drop it to a file or at least log
 it.

 Otherwise, like others have pointed out, using beans as payload is bad
 practice
 in integration applications. However, you seem to be happy with that ...

 Best regards
 Andreas


 On 09/30/2013 12:44 PM, kosalads wrote:

 I have done a small app which connect to the camel war and do the
 processing
 and set to another queue. However, when I process sample xml files it does
 goes to the relevant queues and process. Unfortunately, when I use Bean
 Object via camel It doesnt get updated in the 2nd queue.

 If I explain bit more , This is how I have configured in the application
 context which is in the camel war deployed in Jetty server.


  camelContext xmlns=http://camel.apache.org/schema/spring;
  route
  from uri=activemq:inQ /
  to uri=activemq:outQ /
  /route
  /camelContext

  bean id=activemq
 class=org.apache.activemq.camel.component.ActiveMQComponent
  property name=brokerURL value=tcp://localhost:61616 /
  /bean

   camelContext xmlns=http://camel.apache.org/schema/spring;
  route
  from uri=activemq:outQ /
  /route
  /camelContext

 I have crated three applications.

 1. Standalone application which connect to the camel war and send the Pojo
 Class to the Queue (inQ).
 2. Camel war application which has above configuration. So when I pass the
 Bean Object to the inQ it should send to the outQ
 (Based on above configuration)
 3. There is another application which reads the outQ and try to retrieve
 Bean Object.

 So what happens is that I could send the Pojo bean to the inQ but it
 doesnt
 seems to be route to the outQ. So when I try to read from the outQ the
 queue
 is empty.

 Could you please let me know how we can handle above scenario and what is
 the best way to handle this.




 --
 View this message in context:
 http://camel.465427.n5.nabble.com/Apache-Camel-war-project-How-to-process-the-Queue-and-set-to-another-queue-tp5740524.html
 Sent from the Camel - Users mailing list archive at Nabble.com.




Re: Apache Camel - war project How to process the Queue and set to another queue?

2013-10-03 Thread James Carman
Are you sure?  I thought bean was only a producer (or processor).
Anyway, the use case seems kind of silly and probably will lead to
mysterious things going on (like jms messages being stolen ;)


On Thu, Oct 3, 2013 at 5:44 PM, Christian Müller
christian.muel...@gmail.com wrote:
 Maybe
 from
   bean

 is a valid route...

 Best,
 Christian
 Am 03.10.2013 17:46 schrieb James Carman ja...@carmanconsulting.com:

 That second route with no to is stealing your messages, I'd guess.
  I am actually surprised you're able to create a route with no to.
 I'm curious to play with that phenomenon in a test case.

 On Thu, Oct 3, 2013 at 11:36 AM, Andreas Gies andr...@wayofquality.de
 wrote:
  Hi,
 
  it might be me, but I think your 2nd route is missing a to-element.
  You need to do something with message like drop it to a file or at least
 log
  it.
 
  Otherwise, like others have pointed out, using beans as payload is bad
  practice
  in integration applications. However, you seem to be happy with that ...
 
  Best regards
  Andreas
 
 
  On 09/30/2013 12:44 PM, kosalads wrote:
 
  I have done a small app which connect to the camel war and do the
  processing
  and set to another queue. However, when I process sample xml files it
 does
  goes to the relevant queues and process. Unfortunately, when I use Bean
  Object via camel It doesnt get updated in the 2nd queue.
 
  If I explain bit more , This is how I have configured in the application
  context which is in the camel war deployed in Jetty server.
 
 
   camelContext xmlns=http://camel.apache.org/schema/spring;
   route
   from uri=activemq:inQ /
   to uri=activemq:outQ /
   /route
   /camelContext
 
   bean id=activemq
  class=org.apache.activemq.camel.component.ActiveMQComponent
   property name=brokerURL value=tcp://localhost:61616 /
   /bean
 
camelContext xmlns=http://camel.apache.org/schema/spring;
   route
   from uri=activemq:outQ /
   /route
   /camelContext
 
  I have crated three applications.
 
  1. Standalone application which connect to the camel war and send the
 Pojo
  Class to the Queue (inQ).
  2. Camel war application which has above configuration. So when I pass
 the
  Bean Object to the inQ it should send to the outQ
  (Based on above configuration)
  3. There is another application which reads the outQ and try to retrieve
  Bean Object.
 
  So what happens is that I could send the Pojo bean to the inQ but it
  doesnt
  seems to be route to the outQ. So when I try to read from the outQ the
  queue
  is empty.
 
  Could you please let me know how we can handle above scenario and what
 is
  the best way to handle this.
 
 
 
 
  --
  View this message in context:
 
 http://camel.465427.n5.nabble.com/Apache-Camel-war-project-How-to-process-the-Queue-and-set-to-another-queue-tp5740524.html
  Sent from the Camel - Users mailing list archive at Nabble.com.
 
 



Re: The Camel Components Poster - PDF - FREE

2013-10-03 Thread James Carman
You might want to run that thing by the trademarks folks if you're
going to be selling it or having folks print it.  You might need to
have it say Apache Camel.

On Thu, Oct 3, 2013 at 5:55 PM, Raul Kripalani r...@evosent.com wrote:
 Robert,

 Many thanks for this fantastic contribution to the Camel community! I did
 vote for another design but I liked this one too ;-)
 Given that the Camel component catalogue is ever expanding, it would be a
 good idea to include the Camel version line that the poster applies to. I
 guess it's too late for that?

 Keep it up!

 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

 On Wed, Oct 2, 2013 at 2:27 PM, gliesian glies...@yahoo.com wrote:


 The Camel Components Poster - PDF - FREE
 http://gliesian.com/camel/TheCamelComponentPosterWithWatermark.pdf

 The Camel Components Poster - PRINTED - NOT SO FREE

 http://fineartamerica.com/featured/the-camel-components-poster-robert-liguori.html

 -- Robert



 --
 View this message in context:
 http://camel.465427.n5.nabble.com/The-Camel-Components-Poster-PDF-FREE-tp5740752.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



Re: The Camel Components Poster - PDF - FREE

2013-10-03 Thread James Carman
Robert,

I'd hang on a bit before you start printing these things off.  We may
need to get permission to do so first
(http://www.apache.org/foundation/marks/#guidelines).  Okay?  Thank
you for the hard work and time you've put into this thing, though!
Let's just make sure it's legit before we start telling people to
print it or buy it or whatever.

Thanks,

James Carman, Assistant Secretary
Apache Software Foundation

On Wed, Oct 2, 2013 at 9:27 AM, gliesian glies...@yahoo.com wrote:

 The Camel Components Poster - PDF - FREE
 http://gliesian.com/camel/TheCamelComponentPosterWithWatermark.pdf

 The Camel Components Poster - PRINTED - NOT SO FREE
 http://fineartamerica.com/featured/the-camel-components-poster-robert-liguori.html

 -- Robert



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/The-Camel-Components-Poster-PDF-FREE-tp5740752.html
 Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Apache Camel - war project How to process the Queue and set to another queue?

2013-10-03 Thread James Carman
Serializable objects will be sent using a JMS ObjectMessage, not dropped on
the floor.  No need for JSON serialization.  That doesn't mean I don't
agree with you that an alternate serialized form should be used (see
previous comments).

On Friday, October 4, 2013, kraythe . wrote:

 You do know that JMS only accepts certain types right? Anything it doesn't
 understand, like your POJO, will get dropped on the floor. If you serialize
 your object to JSON before writing to the queue and then back from JSON
 when reading, it should work fine.

 *Robert Simmons Jr. MSc. - Lead Java Architect @ EA*
 *Author of: Hardcore Java (2003) and Maintainable Java (2012)*
 *LinkedIn: **http://www.linkedin.com/pub/robert-simmons/40/852/a39*


 On Thu, Oct 3, 2013 at 4:59 PM, James Carman 
 ja...@carmanconsulting.comjavascript:;
 wrote:

  Are you sure?  I thought bean was only a producer (or processor).
  Anyway, the use case seems kind of silly and probably will lead to
  mysterious things going on (like jms messages being stolen ;)
 
 
  On Thu, Oct 3, 2013 at 5:44 PM, Christian Müller
  christian.muel...@gmail.com wrote:
   Maybe
   from
 bean
  
   is a valid route...
  
   Best,
   Christian
   Am 03.10.2013 17:46 schrieb James Carman ja...@carmanconsulting.com
 :
  
   That second route with no to is stealing your messages, I'd guess.
I am actually surprised you're able to create a route with no to.
   I'm curious to play with that phenomenon in a test case.
  
   On Thu, Oct 3, 2013 at 11:36 AM, Andreas Gies 
 andr...@wayofquality.de
   wrote:
Hi,
   
it might be me, but I think your 2nd route is missing a to-element.
You need to do something with message like drop it to a file or at
  least
   log
it.
   
Otherwise, like others have pointed out, using beans as payload is
 bad
practice
in integration applications. However, you seem to be happy with that
  ...
   
Best regards
Andreas
   
   
On 09/30/2013 12:44 PM, kosalads wrote:
   
I have done a small app which connect to the camel war and do the
processing
and set to another queue. However, when I process sample xml files
 it
   does
goes to the relevant queues and process. Unfortunately, when I use
  Bean
Object via camel It doesnt get updated in the 2nd queue.
   
If I explain bit more , This is how I have configured in the
  application
context which is in the camel war deployed in Jetty server.
   
   
 camelContext xmlns=http://camel.apache.org/schema/spring;
 route
 from uri=activemq:inQ /
 to uri=activemq:outQ /
 /route
 /camelContext
   
 bean id=activemq
class=org.apache.activemq.camel.component.ActiveMQComponent
 property name=brokerURL value=tcp://localhost:61616
 /
 /bean
   
  camelContext xmlns=
 http://camel.apache.org/schema/spring
  
 route
 from uri=activemq:outQ /
 /route
 /camelContext
   
I have crated three applications.
   
1. Standalone application which connect to the camel war and send
 the
   Pojo
Class to the Queue (inQ).
2. Camel war application which has above configuration. So when I
  pass
   the
Be


Re: Log dynamic filename

2013-10-02 Thread James Carman
This is related to a security vulnerability which was reported
recently.  Can you try changing to a simple expression rather than a
constant?

On Wed, Oct 2, 2013 at 7:49 AM, c.spiegel c.spie...@waldmann.com wrote:
 Hi there,

 I have a route defined as follows:

 route id=bla
 from uri=
 setHeader headerName=CamelFileName
 constant${date:now:MMddHHmmssSSS}.txt/constant
 /setHeader
 log message=my filename ${header.CamelFileName} !/
 to uri=ftp://bla/
 /route

 The generated filename is (as supposed) the timestamp when it's created plus
 the suffix .txt. But the log entry is the pattern/expression how it's
 defined.

 The filename is 2013100112000.txt but
 the log entry looks like this:
 my filename ${date:now:MMddHHmmssSSS}.txt

 I want to log the generated filename which is set in the header.

 Could someone please tell me what's wrong?

 I'm using Camel 2.8.4.

 Thx in advance.





 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Log-dynamic-filename-tp5740747.html
 Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Need Help in configuring a router to run to run parallally every 30 minutes

2013-10-02 Thread James Carman
Are you looking to use the competing consumers pattern?  If so, then
they'll multicast themselves.

On Wed, Oct 2, 2013 at 11:54 AM, gudiseashok gudise.as...@gmail.com wrote:
 Hi Hilderich

 The config which you gave is looks like perfect match for my requirement,
 now only doubt I have is since we are adding multiple
 routes and bydefault camel behaviour is pipeline. Where do I need to ensure
 that this should happen in parrlell (multi-cast may be?)

 Regards
 Ashok Gudise



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Need-Help-in-configuring-a-router-to-run-to-run-parallally-every-30-minutes-tp5740755p5740769.html
 Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Apache Camel - war project How to process the Queue and set to another queue?

2013-10-01 Thread James Carman
Have you tried turning up logging to see what's going on?  Camel gets
very descriptive at DEBUG level

On Mon, Sep 30, 2013 at 11:17 AM, kosalads kosal...@gmail.com wrote:
 Hi James,

   So how do we handle the below scenario with Camel?



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Apache-Camel-war-project-How-to-process-the-Queue-and-set-to-another-queue-tp5740524p5740574.html
 Sent from the Camel - Users mailing list archive at Nabble.com.


Re: OSGI marshal and bindy

2013-09-30 Thread James Carman
You should really consider using camel-blueprint.  This is the best
way to use Camel in an OSGi environment.  You will run into quite a
bit of troubles to get everything working right if you try to do it
manually.

On Mon, Sep 30, 2013 at 7:06 AM, mabels meno.ab...@adviser.com wrote:
 Hello,

 i now use the OsgiDefaultCamelContext and now it runs like excepted. I had
 to
 install

 osgi:install -s mvn:org.apache.camel/camel-core-osgi/2.12.1

 features:install eventadmin

 these both are needed some how.

 Thanks

 meno


 On Mon, Sep 30, 2013 at 12:21 PM, Claus Ibsen-2 [via Camel] 
 ml-node+s465427n5740481...@n5.nabble.com wrote:

 Hi

 You cannot use the DefaultCamelContext, you have to use an OSGi one.
 Also the package scan should be osgi aware.

 Though its often easier to use a blueprint xml file to bootstrap Camel
 in OSGi as it setup all the OSGi stuff for you.

 Though in camel-core-osgi there is the osgi pieces you would need to
 do this manually.


 On Mon, Sep 30, 2013 at 12:10 PM, mabels [hidden 
 email]http://user/SendEmail.jtp?type=nodenode=5740481i=0
 wrote:

  Hello,
 
  what you mean how i run it, i have a small bundle which i start with
  osgi::install ...
  in karaf. In prepartion i loaded all needed camel features.
  The Activator looks like this:
 
  final CamelContext camelContext = new DefaultCamelContext();
  camelContext.disableJMX();
  DefaultPackageScanClassResolver defaultPackageScanClassResolver =
 new
  DefaultPackageScanClassResolver();
  camelContext.addComponent(filer, new FilerComponent());
  try {
camelContext.addRoutes(new RouteBuilder() {
  public void configure() {
DataFormat bindy = new ShopFeedProdukt();
 
from(file:///tmp/input)
.split(org.apache.camel.component.stax.StAXBuilder
.stax(ShopFeedProdukt.class, false))
.streaming()
.marshal(bindy)
//.marshal().bindy(BindyType.Csv,
  org.apache.camel.bindy.model)
//.marshal(new BindyCsvDataFormat(ShopFeedProdukt.class))
.to(filer:///tmp/output?suffix=.csv)
.end();
 
  }
});
camelContext.start();
 
  Hopefully this helps
 
  meno
 
 
  On Mon, Sep 30, 2013 at 12:05 PM, Claus Ibsen-2 [via Camel] 
  [hidden email] http://user/SendEmail.jtp?type=nodenode=5740481i=1
 wrote:
 
  Hi
 
  How do you run it in OSGi / Karaf?
 
  On Sun, Sep 29, 2013 at 10:38 PM, mabels [hidden email]
 http://user/SendEmail.jtp?type=nodenode=5740473i=0
  wrote:
 
   Hey,
  
   i have the following camel route:
  
   from(file:///tmp/input)
   .split(StAXBuilder.stax(ShopFeedProdukt.class, false))
   .streaming()
   .marshal(new ShopFeedProdukt())
   //.marshal().bindy(BindyType.Csv,
  org.apache.camel.bindy.model)
   //.marshal(new BindyCsvDataFormat(ShopFeedProdukt.class))
   .to(filer:///tmp/output?suffix=.csv)
   .end();
  
   I tried the three marshal implementation. But i get on every
  implementations
   the
   same error, if I run this route in a osgi runtime like karaf. If I
 run
  it
   without
   osgi it runs without a problem.
  
   Here is the stacktrace it is the same for all marshal implementation
 i
   tried.
  
   java.lang.NullPointerException
   at
  
 
 org.apache.camel.dataformat.bindy.util.ConverterUtils.getByteReturn(ConverterUtils.java:41)[64:org.apache.camel.camel-bindy:2.12.1]

 
   at
  
 
 org.apache.camel.dataformat.bindy.csv.BindyCsvDataFormat.marshal(BindyCsvDataFormat.java:67)[64:org.apache.camel.camel-bindy:2.12.1]

 
   at
  
 
 org.apache.camel.processor.MarshalProcessor.process(MarshalProcessor.java:81)[61:org.apache.camel.camel-core:2.12.1]

 
   at
  
 
 org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:398)[61:org.apache.camel.camel-core:2.12.1]

 
   at
  
 
 org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)[61:org.apache.camel.camel-core:2.12.1]

 
   at
  
 
 org.apache.camel.processor.Pipeline.process(Pipeline.java:118)[61:org.apache.camel.camel-core:2.12.1]

 
   at
  
 
 org.apache.camel.processor.Pipeline.process(Pipeline.java:80)[61:org.apache.camel.camel-core:2.12.1]

 
   at
  
 
 org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:398)[61:org.apache.camel.camel-core:2.12.1]

 
   at
  
 
 org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)[61:org.apache.camel.camel-core:2.12.1]

 
   at
  
 
 org.apache.camel.processor.MulticastProcessor.doProcessSequential(MulticastProcessor.java:573)[61:org.apache.camel.camel-core:2.12.1]

 
   at
  
 
 org.apache.camel.processor.MulticastProcessor.doProcessSequential(MulticastProcessor.java:506)[61:org.apache.camel.camel-core:2.12.1]

 
   at
  
 
 

Re: Apache Camel - war project How to process the Queue and set to another queue?

2013-09-30 Thread James Carman
Regardless of whether it's for an internal application, it' still not
wise to use a bean payload on a JMS queue.  You can run into all sorts
of problems with serialization and you're making it virtually
impossible for non-java code to talk to your services.

On Mon, Sep 30, 2013 at 6:58 AM, kosalads kosal...@gmail.com wrote:
 Hi,

   This is for internal Applications and those Objects are serialized and
 using the same class in the both side.

 Provided that above scenario how can I achieve this?




 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Apache-Camel-war-project-How-to-process-the-Queue-and-set-to-another-queue-tp5740524p5740530.html
 Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Apache Camel - war project How to process the Queue and set to another queue?

2013-09-30 Thread James Carman
We're not saying you won't be able to do it.  It will work, but you
will run into troubles down the road with your application and it
makes it less flexible.

Have you tried playing with a unit test (using embedded ActiveMQ)?
It's really easy to set up.

On Mon, Sep 30, 2013 at 8:50 AM, kosalads kosal...@gmail.com wrote:
 Hi James,

   Please note that I was able to send the Java bean to the queue and read
 the same java bean from another application. So I dont think it will be a
 problem to do this.

 But my issue is that I cannot get the Java Object from one queue and set to
 another queue in the same application, So this is what I want to know how to
 handle this?

 Also assume I have a Object with multiple Array lists which has set of Java
 objects. So in this case how can I transfer these data through Apache camel
 as a one Object, If I have a once Java class which I can add all the objects
 then it is easy to transfer this Object through Camel ActiveMQ? Appreciate
 your thoughts on this.


 Thanks in advance.



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Apache-Camel-war-project-How-to-process-the-Queue-and-set-to-another-queue-tp5740524p5740554.html
 Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Extend Camel Loop to support While Behavior

2013-09-30 Thread James Carman
Patches (with unit tests) are always welcome.

On Mon, Sep 30, 2013 at 9:53 AM, Dale King d...@jadabeauty.com wrote:
 There is a JIRA from a year or 2 ago that has no progress. This would be 
 trivial to add.

 The work around is to use distribution list on a header and when you want to 
 exit set that header to null.

 On Sep 30, 2013, at 2:28 AM, Claus Ibsen claus.ib...@gmail.com wrote:

 Hi

 Yeah we have talked about this in the past. Not sure if there is a
 JIRA. You are welcome to look and if you cant find a JIRA then log a
 new JIRA for this.



 On Mon, Sep 30, 2013 at 6:01 AM, Goyal, Arpit arpit.go...@sap.com wrote:
 Hi Claus,

 Is there a plan to support Camel Loop to support While behavior? Is there a 
 jira issue for the same?

 Regards,
 Arpit.



 --
 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: CamelTestSupport Needs a New Method

2013-09-28 Thread James Carman
Patch submitted.

https://issues.apache.org/jira/browse/CAMEL-6792


On Sat, Sep 28, 2013 at 4:40 AM, Claus Ibsen claus.ib...@gmail.com wrote:
 Hi

 Yeah the getMockEndpoint with the 2nd boolean is much better

 On Fri, Sep 27, 2013 at 3:16 PM, Jan Matèrne (jhm) apa...@materne.de wrote:
 Instead of overloading the method I would prefer another one:
 - getMockEndpoint will return the endpoint or null
 - createMockEndpoint will return the endpoint and create one if required
 But that would change the existing API of getMockEndpoint()  :(

 Having a 2nd argument would result in
   getMockEndpoint(uri) {
 // use 'false' as it is the current implementation
 return getMockEndpoint(uri,false)
   }
   getMockEndpoint(uri,boolean create) ...

 Maybe it is just enough to improve the javadoc of getMockEndpoint(), 
 describe the
 auto-creation behaviour and link to context.hasEndpoint(uri) ...


 Jan


 -Ursprüngliche Nachricht-
 Von: Raul Kripalani [mailto:r...@evosent.com]
 Gesendet: Freitag, 27. September 2013 15:36
 An: users@camel.apache.org
 Betreff: Re: CamelTestSupport Needs a New Method

 I would prefer to add another signature for that method such that it
 accepts a 2nd argument create which is a boolean. If true, it will
 create the endpoint; else it will return null.

 I don't think CamelTestSupport should make the assertion; it should be
 the user's code, if that's what he/she is after.

 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

 On Fri, Sep 27, 2013 at 9:11 AM, Willem jiang
 willem.ji...@gmail.comwrote:

  Yeah, it's a good suggestion.
  Please feel free to fill a JIRA[1] for it :)
 
  [1]http://issues.apache.org/jira/browse/CAMEL
 
  --
  Willem Jiang
 
  Red Hat, Inc.
  Web: 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 Friday, September 27, 2013 at 7:54 AM, kraythe . wrote:
 
   There is a problem with the CamelTestSupport class in that if you
   call getMockEndpoint on an endpoint that doesnt exist, it blithely
   returns you an endpoint connected to nothing. The problem is you
 end
   up chasing
  endless
   test failures when the fact is your endpoint is not even there. So
 I
   suggest a method I added to my subclass of CamelTestSupport which
 is:
  
   protected MockEndpoint assertAndGetMockEndpoint(final String uri) {
  
   assertNotNull(context.hasEndpoint(uri));
  
   return getMockEndpoint(uri);
  
   }
  
   This method will make sure that the endpoint is there before
   returning it and it will make tests easier to write.
 
 
 
 




 --
 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: Error when adding dataFormats in camel route file

2013-09-12 Thread James Carman
Put it inside the camelContext element.  It's from the same namespace.

On Thu, Sep 12, 2013 at 10:21 AM, vsmahesh aneesh_...@yahoo.co.in wrote:
 Hi all,

 When I am using dataFormats in my route I am getting the error [INFO]
 Finished at: Thu Sep 12 17:16:32 EEST 2013
 [INFO] Final Memory: 15M/111M
 [INFO]
 
 [ERROR] Failed to execute goal
 org.apache.camel:camel-maven-plugin:2.10.0.fuse-7
 1-047:run (default-cli) on project mes-bw-energyconsumption-queue: null:
 MojoExe
 cutionException: InvocationTargetException: Line 41 in XML document from
 file [D
 :\Project\Mahesh\Workspace\mes-bw-energyconsumption-queue\target\classes\META-IN
 F\spring\camel-route.xml] is invalid; nested exception is
 org.xml.sax.SAXParseEx
 ception: cvc-complex-type.2.4.a: Invalid content was found starting with
 element
  'dataFormats'. One of
 '{http://www.springframework.org/schema/beans:import, 
 http://www.springframework.org/schema/beans:alias,
 http://www.springframework.
 org/schema/beans:bean,
 WC[##other:http://www.springframework.org/schema/beans;
 ]}' is expected. - [Help 1]
 [ERROR]
 [ERROR] To see the full stack trace of the errors, re-run Maven with the -e
 swit
 ch.
 [ERROR] Re-run Maven using the -X switch to enable full debug logging.
 [ERROR]

 My route is like

 dataFormats
 jaxb id=input prettyPrint=true
 contextPath=mes.id59.powerconsumption
 partClass=.id59.powerconsumption.Details /

 /dataFormats

 import resource=classpath:META-INF/spring/camel-cxf.xml /

 camelContext xmlns=http://camel.apache.org/schema/spring;
 route id=Route1_MES_Queue
 from uri=cxf:bean:PowerConsumptionEndpoint/
 marshal ref=input /
 to uri=activemq:queue:EC_InboundQueue/
 /route

 My pom is

 ?xml version=1.0 encoding=UTF-8 standalone=no?
 project xmlns=http://maven.apache.org/POM/4.0.0;
 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
 xsi:schemaLocation=http://maven.apache.org/POM/4.0.0
 http://maven.apache.org/maven-v4_0_0.xsd;

 modelVersion4.0.0/modelVersion



 version1.0.0/version
 groupIdcom.outotec/groupId
 descriptionCreates a web service using the WSDL contract
 first/description
 packagingbundle/packaging




 properties
 
 project.build.sourceEncodingUTF-8/project.build.sourceEncoding
 
 project.reporting.outputEncodingUTF-8/project.reporting.outputEncoding


 /properties

 repositories



 repository
idspring-release/id
urlhttp://maven.springframework.org/release/url
   /repository
   repository
idmaven-us-nuxeo/id
urlhttps://maven-us.nuxeo.org/nexus/content/groups/public/url
   /repository

 repository
 idrelease.fusesource.org/id
 nameFuseSource Release Repository/name
 
 urlhttp://repo.fusesource.com/nexus/content/repositories/releases/url
 snapshots
 enabledfalse/enabled
 /snapshots
 releases
 enabledtrue/enabled
 /releases
 /repository
 repository
 idsnapshot.fusesource.org/id
 nameFuseSource Snapshot Repository/name

 urlhttp://repo.fusesource.com/nexus/content/repositories/snapshots/url
 snapshots
 enabledtrue/enabled
 /snapshots
 releases
 enabledfalse/enabled
 /releases
 /repository

 repository
 idfusesource/id
 nameFuseSource Release Repository/name
 
 urlhttp://repo.fusesource.com/nexus/content/groups/public//url
 snapshots
 enabledfalse/enabled
 /snapshots
 releases
 enabledtrue/enabled
 /releases
 /repository
 repository
 idfusesource.ea/id
 nameFuseSource Community Early Access Release 
 Repository/name
 
 urlhttp://repo.fusesource.com/nexus/content/groups/ea/url
 snapshots
 enabledfalse/enabled
 /snapshots
 releases
 enabledtrue/enabled
 /releases
 /repository
 repository
 idjboss-public-repository-group/id
 nameJBoss Public 

Re: Camel JBDC : Connection pooling

2013-09-11 Thread James Carman
That will do pooling, yes.

On Wed, Sep 11, 2013 at 10:20 PM, myhumandreams
kv.prajeesh.rajas...@gmail.com wrote:
 bean id=springDataSource class=org.apache.commons.dbcp.BasicDataSource
 destroy-method=close 
property name=url value=jdbc:oracle:thin:@localhost:1521:SPRING_TEST
 /
property name=driverClassName value=oracle.jdbc.driver.OracleDriver
 /
property name=username value=root /
property name=password value=root /
property name=removeAbandoned value=true/
property name=initialSize value=20 /
property name=maxActive value=30 /
 /bean

 Pontus this will do rt?



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Camel-JBDC-Connection-pooling-tp5739116p5739196.html
 Sent from the Camel - Users mailing list archive at Nabble.com.


Re: XMPP URI FORMAT MISSING HASH (#) USAGE?

2013-09-11 Thread James Carman
Robert,

The # isn't a special camel thing.  It's actually part of the name of
the channel.  For instance, our IRC channel name is #camel.

James

On Wed, Sep 11, 2013 at 12:26 PM, gliesian rob...@gliesian.com wrote:
 Consider the URI Scheme definition for fragment from
 https://en.wikipedia.org/wiki/URI_scheme:

 The fragment is an optional part separated from the front parts by a hash
 (#). It holds additional identifying information that provides direction
 to a secondary resource, e.g., a section heading (in an article) identified
 by the remainder of the URI.

 Now consider the definitions of IRC and XMPP:

 IRC - Internet Relay Chat (IRC) is a protocol for live interactive Internet
 text messaging (chat) or synchronous conferencing

 XMPP- Extensible Messaging and Presence Protocol (XMPP) is a communications
 protocol for message-oriented middleware based on XML (Extensible Markup
 Language).[1] The protocol was originally named Jabber,[2] and was developed
 by the Jabber open-source community in 1999 for near real-time, instant
 messaging (IM), presence information, and contact list maintenance. Designed
 to be extensible, the protocol has also been used for publish-subscribe
 systems, signalling for VoIP, video, file transfer, gaming, Internet of
 Things applications such as the smart grid, and social networking services.

 Now consider the usage for Camel's IRC and XMPP components:

 IRC URI FORMAT:
 irc:[login@]hostname[:port][/#room][?options]

 XMPP URI FORMAT:
 xmpp://[login@]hostname[:port][/participant][?Options]

 My question is this... shouldn't the hash (#) marker/tag also be used in
 the XMPP URI, similar to what has been done with the IRC URI?

 Thanks,
 Robert



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/XMPP-URI-FORMAT-MISSING-HASH-USAGE-tp5739176.html
 Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Can I use from =direct:abc* for wildcard routing...

2013-08-31 Thread James Carman
Why not just route it to direct://start/event and then the receiving
route can figure out what to do with it?  You're not doing any
conditional routing here anyway.


Re: IntelliJ plugin for Camel / Blueprint / Karaf

2013-08-26 Thread James Carman
Very cool.  Thanks for the hard work, Alan!  I'll check it out.

On Mon, Aug 26, 2013 at 8:11 AM, AlanFoster a...@alanfoster.me wrote:
 Hey guys,

 Just letting you know that if you're doing any sort of Blueprint Camel
 development using IntelliJ that I've just released a new plugin to help with
 developer productivity :)

 The project is open source and further information is available here
 https://github.com/AlanFoster/Camelry

 Be sure to check it out and give any feed back :)

 Cheers
 Alan



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/IntelliJ-plugin-for-Camel-Blueprint-Karaf-tp5737966.html
 Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Numbers of lines in a flat file

2013-07-31 Thread James Carman
http://camel.apache.org/splitter.html


On Wed, Jul 31, 2013 at 8:50 PM, jabe jabegr...@gmail.com wrote:
 How did you get the number of lines from header? Which Camel component did
 you use?



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Numbers-of-lines-in-a-flat-file-tp5732455p5736604.html
 Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Is it Camel Bug?

2013-07-29 Thread James Carman
Why do you need Camel here at all?  If you're just calling a web service,
that's simple enough using just cxf.

On Monday, July 29, 2013, SyedBhai wrote:

 Hello Willem,
   Yes.  This is what I wanted.
   When I add the option synchronous=true it shutsdown gracefully
 immediately.

 Thanks,
 Syed.



 --
 View this message in context:
 http://camel.465427.n5.nabble.com/Is-it-Camel-Bug-tp5736288p5736399.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



Re: Invoking Servlet from Camel

2013-07-29 Thread James Carman
If you just set the query string using the header Exchange.HTTP_QUERY,
then it will use GET automatically.  Also, if you just use an
expression (as Claus was suggesting) to bind the body of the message
to the query parameter, it will use GET automatically also.

On Mon, Jul 29, 2013 at 6:58 AM, Bilgin Ibryam bibr...@gmail.com wrote:
 Hi Syed,

 what you have done should work.
 If you set a message body http4 component will use POST method to do
 the http call and sent the message body as post body.

 Have a look here http://camel.apache.org/http4.html

 You can also set the http method manually if you prefer, like this:
  .setHeader(Exchange.HTTP_METHOD,
 constant(org.apache.camel.component.http4.HttpMethods.POST))

 But notice that in this case, in your servlet you will get the call
 from doPost method and not from doGet

 HTH
 Bilgin

 On 29 July 2013 11:38, SyedBhai syedahmed.c...@hotmail.com wrote:
 Hi guys,
   I am having a servlet.  It expects one parameter, say 'message'.
   I want to invoke it using camel.
   I am able to invoke it successfully as a HTTP GET method as follows:

 from(direct:start).to(http://192.168.221.109:8080/DSP1/ServletDsp?message=HelloCamel;);
 String response=template.requestBody(direct:start, null,
 String.class);

   What I want is instead of passing the parameter in the query string, can I
 pass it as a message body?
 String response=template.requestBody(direct:start, HelloCamel,
 String.class);

   Is there a way to accomplish this?

   I have already visited Camel Servlet Component webpage.

   It doesn't help.

 Thanks,
 Syed.



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Invoking-Servlet-from-Camel-tp5736417.html
 Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Is it Camel Bug?

2013-07-29 Thread James Carman
Well, you said all you needed to do was call a web service.  If that's
all you need, Camel is overkill.  Now, if you have other points of
integration, sure Camel's the right choice.

On Mon, Jul 29, 2013 at 2:48 PM, SyedBhai syedahmed.c...@hotmail.com wrote:
 Sir,
   You asked why do you need camel at all?
   The answer is firstly I know camel not cxf.
   Secondly I need to communicate with external programs which could be tcp
 services, udp services, web services, servlets, etc.
   So using camel I can write uniform code to communicate with all the above
 mentioned programs.
   Do you have any more questions?

 Thanks,
 Syed.



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Is-it-Camel-Bug-tp5736288p5736447.html
 Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Is it Camel Bug?

2013-07-27 Thread James Carman
We see the same messages you do in our Tomcat logs.  However, Tomcat shuts down 
just fine and there are no memory leaks.  Now, we don't stop/start the web 
application all the time using the manager, though.  In production, we usually 
shut the entire Tomcat instance down and bring it back up once we've fixed what 
we are fixing.


On Jul 26, 2013, at 7:15 AM, SyedBhai syedahmed.c...@hotmail.com wrote:

 Nope.
 Sir, mine is a web application.  If I call System.exit() tomcat server will
 shutdown.
 
 Syed.
 
 
 
 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Is-it-Camel-Bug-tp5736288p5736292.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



Re: Camel Scala DSL and IntelliJ

2013-02-11 Thread James Carman
How about from(file://...).to(file:///)

You're trying to call to on a java.lang.String literal object.

On Feb 11, 2013, at 5:30 AM, Joe San codeintheo...@gmail.com wrote:

 Guys,
 
 I'm just trying a simple Scala DSL using intelli. I have a project created
 and tried configuring a simple route as below:
 
 class SimpleRouter extends App {
 
  def main(args : Array[String]) {
 
val camelContext = new DefaultCamelContext()
 
camelContext.addRoutes(new RouteBuilder() {
  def configure() {
 
 file://Users/joe/Desktop/test.xml.to(file://Users/joe/Desktop/test1.xml)
  }
})
 
camelContext.start()
 
Thread.sleep(1000)
 
camelContext.stop()
 
  }
 
 }
 
 But I get to see the following error when I tried to run the above route:
 
 scala: value to is not a member of java.lang.String
 
 file://Users/joe/Desktop/test.xml.to(file://Users/joe/Desktop/test1.xml)
 
 Any idea as to why the intellij would not recognize the dsl? Is there
 anything that I have to do additionally?
 
 Regards,
 Joe
  ^



Re: Does Camel JPA component implement it's own connection pooling?

2013-02-01 Thread James Carman
Chris,

Here's my complete class:

public class JpaTest
{
public static void main(String[] args)
{
ClassPathXmlApplicationContext ctx = new 
ClassPathXmlApplicationContext(classpath:/META-INF/spring-beans.xml);
final EntityManagerFactory factory = 
ctx.getBean(EntityManagerFactory.class);
final JpaTransactionManager transactionManager = new 
JpaTransactionManager(factory);

TransactionTemplate template = new 
TransactionTemplate(transactionManager);
template.execute(new TransactionCallbackWithoutResult()
{
@Override
protected void doInTransactionWithoutResult(TransactionStatus 
status)
{
EntityManager em = 
EntityManagerFactoryUtils.getTransactionalEntityManager(factory);
for (int i = 0; i  10; ++i)
{
MyEntity entity = new MyEntity();
entity.setName(name);
em.persist(entity);
}
}
});

}
}


Here's the output I see when I turn up OpenJPA's logging:

02-01@06:30:54 TRACE (SQL) - t 2063246672, conn 936619118 executing 
prepstmnt 1546366616 INSERT INTO MyEntity (id, name) VALUES (?, ?) [params=?, ?]
02-01@06:30:54 TRACE (SQL) - t 2063246672, conn 936619118 [0 ms] spent
02-01@06:30:54 TRACE (SQL) - t 2063246672, conn 936619118 executing 
prepstmnt 702383716 INSERT INTO MyEntity (id, name) VALUES (?, ?) [params=?, ?]
02-01@06:30:54 TRACE (SQL) - t 2063246672, conn 936619118 [0 ms] spent
02-01@06:30:54 TRACE (SQL) - t 2063246672, conn 936619118 executing 
prepstmnt 245507253 INSERT INTO MyEntity (id, name) VALUES (?, ?) [params=?, ?]
02-01@06:30:54 TRACE (SQL) - t 2063246672, conn 936619118 [0 ms] spent
02-01@06:30:54 TRACE (SQL) - t 2063246672, conn 936619118 executing 
prepstmnt 924315284 INSERT INTO MyEntity (id, name) VALUES (?, ?) [params=?, ?]
02-01@06:30:54 TRACE (SQL) - t 2063246672, conn 936619118 [0 ms] spent
02-01@06:30:54 TRACE (SQL) - t 2063246672, conn 936619118 executing 
prepstmnt 70275790 INSERT INTO MyEntity (id, name) VALUES (?, ?) [params=?, ?]
02-01@06:30:54 TRACE (SQL) - t 2063246672, conn 936619118 [0 ms] spent
02-01@06:30:54 TRACE (SQL) - t 2063246672, conn 936619118 executing 
prepstmnt 9196680 INSERT INTO MyEntity (id, name) VALUES (?, ?) [params=?, ?]
02-01@06:30:54 TRACE (SQL) - t 2063246672, conn 936619118 [0 ms] spent
02-01@06:30:54 TRACE (SQL) - t 2063246672, conn 936619118 executing 
prepstmnt 2097261823 INSERT INTO MyEntity (id, name) VALUES (?, ?) [params=?, ?]
02-01@06:30:54 TRACE (SQL) - t 2063246672, conn 936619118 [0 ms] spent
02-01@06:30:54 TRACE (SQL) - t 2063246672, conn 936619118 executing 
prepstmnt 2030360950 INSERT INTO MyEntity (id, name) VALUES (?, ?) [params=?, ?]
02-01@06:30:54 TRACE (SQL) - t 2063246672, conn 936619118 [0 ms] spent
02-01@06:30:54 TRACE (SQL) - t 2063246672, conn 936619118 executing 
prepstmnt 761335820 INSERT INTO MyEntity (id, name) VALUES (?, ?) [params=?, ?]
02-01@06:30:54 TRACE (SQL) - t 2063246672, conn 936619118 [0 ms] spent
02-01@06:30:54 TRACE (SQL) - t 2063246672, conn 936619118 executing 
prepstmnt 1063557914 INSERT INTO MyEntity (id, name) VALUES (?, ?) [params=?, ?]
02-01@06:30:54 TRACE (SQL) - t 2063246672, conn 936619118 [0 ms] spent
02-01@06:30:54 TRACE (JDBC) - t 2063246672, conn 936619118 [1 ms] commit
02-01@06:30:54 TRACE (JDBC) - t 2063246672, conn 936619118 [0 ms] close


It looks like it'll use the same connection object for each insert and commit 
and close it at the end (I'm using DriverManagerDataSource just to make sure it 
won't pool).


On Jan 31, 2013, at 9:14 PM, James Carman jcar...@carmanconsulting.com wrote:

 Try this:
 
   JpaTransactionManager transactionManager = new 
 JpaTransactionManager(factory);
 
TransactionTemplate template = new 
 TransactionTemplate(transactionManager);
template.execute(new TransactionCallbackWithoutResult()
{
@Override
protected void doInTransactionWithoutResult(TransactionStatus 
 status)
{
EntityManager em = 
 EntityManagerFactoryUtils.getTransactionalEntityManager(factory);
MyEntity entity = new MyEntity();
em.persist(entity);
}
});
 
 On Jan 31, 2013, at 5:49 PM, Chris Wolf cwolf.a...@gmail.com wrote:
 
 James,
 
 Ok, now using TransactionTemplate, but I'm back to where I was - the
 same apparent connection leak, only now
 the code is hideous with all those nested anonymous classes and whatnot... ;)
 
 
  -Chris
 
   static void saveToDB(final ListMdBaseData data) throws Exception {
  EntityManagerFactory emf = Persistence
  .createEntityManagerFactory(marketdata);
  
  final JpaTemplate jpaTempl = new JpaTemplate(emf);
  jpaTempl.afterPropertiesSet

Re: Google Plus - Apache Group

2013-02-01 Thread James Carman
Please don't use this Google Plus community for project-related discussions 
(design discussions, etc.), though.  That needs to be on the mailing lists in 
order to keep the community in-the-loop.
 

On Feb 1, 2013, at 8:59 AM, Charles Moulliard ch0...@gmail.com wrote:

 Hi,
 
 For our supporters/fans and people who belong in Apache Camel project, I
 would like to inform you that we have created a Google Plus community for
 Camel (https://plus.google.com/u/0/communities/106271384875356488225).
 Don't hesitate to send us yours pictures/events and initiate great
 discussion
 
 Regards,
 
 -- 
 Charles Moulliard
 Apache Committer / Sr. Enterprise Architect (RedHat)
 Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com



Re: Google Plus - Apache Group

2013-02-01 Thread James Carman
A picture of a camel with a red hat on with the words Apache Camel.  Really?  

On Feb 1, 2013, at 8:59 AM, Charles Moulliard ch0...@gmail.com wrote:

 Hi,
 
 For our supporters/fans and people who belong in Apache Camel project, I
 would like to inform you that we have created a Google Plus community for
 Camel (https://plus.google.com/u/0/communities/106271384875356488225).
 Don't hesitate to send us yours pictures/events and initiate great
 discussion
 
 Regards,
 
 -- 
 Charles Moulliard
 Apache Committer / Sr. Enterprise Architect (RedHat)
 Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com



Re: Google Plus - Apache Group

2013-02-01 Thread James Carman
I'm not a Camel committer or PMC member, but I *am* an ASF member and I find it 
troubling how much Fuse/RedHat uses these lists to promote themselves (like a 
picture of a camel wearing a red hat).  Hopefully they don't use their 
influence in any other inappropriate ways.

On Feb 1, 2013, at 9:09 AM, James Carman jcar...@carmanconsulting.com wrote:

 A picture of a camel with a red hat on with the words Apache Camel.  
 Really?  
 
 On Feb 1, 2013, at 8:59 AM, Charles Moulliard ch0...@gmail.com wrote:
 
 Hi,
 
 For our supporters/fans and people who belong in Apache Camel project, I
 would like to inform you that we have created a Google Plus community for
 Camel (https://plus.google.com/u/0/communities/106271384875356488225).
 Don't hesitate to send us yours pictures/events and initiate great
 discussion
 
 Regards,
 
 -- 
 Charles Moulliard
 Apache Committer / Sr. Enterprise Architect (RedHat)
 Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com
 



Re: Does Camel JPA component implement it's own connection pooling?

2013-02-01 Thread James Carman
Chris,

Something like this works for me (had to change it a bit to sanitize it):

persistence xmlns=http://java.sun.com/xml/ns/persistence;
 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
 xsi:schemaLocation=http://java.sun.com/xml/ns/persistence 
http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd;
 version=2.0
persistence-unit name=metadata-service transaction-type=RESOURCE_LOCAL

providerorg.apache.openjpa.persistence.PersistenceProviderImpl/provider
classcom.myco.entity.MyEntity/class
exclude-unlisted-classestrue/exclude-unlisted-classes
properties
property name=openjpa.Log value=slf4j /
/properties
/persistence-unit
/persistence

I use Spring to configure it, though:

bean id=entityManagerFactory 
class=org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean
property name=dataSource ref=dataSource/
property name=jpaProperties
props
prop 
key=openjpa.jdbc.SynchronizeMappings${db.synchronizeMappings}/prop
/props
/property
/bean

I have found that just using Spring from the get-go actually saves me so much 
time, because I don't get these little weird hiccups (I get others ;).  This 
stuff has been tested by lots of folks before me. :)

James

On Feb 1, 2013, at 10:39 AM, Chris Wolf cwolf.a...@gmail.com wrote:

 James,
 
 I just replied to your message from last night - I got it working by
 using your latest suggestion plus enabling DBCP connection pooling,
 although I don't know why pooling should matter.
 
 I notice that you were able to get OpenJPA logging to work - I'd sure
 be interested in seeing your persistence.xml settings for that - I
 have not been able to get any logging from OpenJPA and I tried the
 default, the log4j and slf4j backends - all to no avail...
 
 As for my final implementation, I think this latest code from you is
 the cleanest (for my purposes).  Again, thanks so much for the help.
 
   -Chris
 
 On Fri, Feb 1, 2013 at 6:32 AM, James Carman
 jcar...@carmanconsulting.com wrote:
 Chris,
 
 Here's my complete class:
 
 public class JpaTest
 {
public static void main(String[] args)
{
ClassPathXmlApplicationContext ctx = new 
 ClassPathXmlApplicationContext(classpath:/META-INF/spring-beans.xml);
final EntityManagerFactory factory = 
 ctx.getBean(EntityManagerFactory.class);
final JpaTransactionManager transactionManager = new 
 JpaTransactionManager(factory);
 
TransactionTemplate template = new 
 TransactionTemplate(transactionManager);
template.execute(new TransactionCallbackWithoutResult()
{
@Override
protected void doInTransactionWithoutResult(TransactionStatus 
 status)
{
EntityManager em = 
 EntityManagerFactoryUtils.getTransactionalEntityManager(factory);
for (int i = 0; i  10; ++i)
{
MyEntity entity = new MyEntity();
entity.setName(name);
em.persist(entity);
}
}
});
 
}
 }
 
 
 Here's the output I see when I turn up OpenJPA's logging:
 
 02-01@06:30:54 TRACE (SQL) - t 2063246672, conn 936619118 executing 
 prepstmnt 1546366616 INSERT INTO MyEntity (id, name) VALUES (?, ?) 
 [params=?, ?]
 02-01@06:30:54 TRACE (SQL) - t 2063246672, conn 936619118 [0 ms] spent
 02-01@06:30:54 TRACE (SQL) - t 2063246672, conn 936619118 executing 
 prepstmnt 702383716 INSERT INTO MyEntity (id, name) VALUES (?, ?) [params=?, 
 ?]
 02-01@06:30:54 TRACE (SQL) - t 2063246672, conn 936619118 [0 ms] spent
 02-01@06:30:54 TRACE (SQL) - t 2063246672, conn 936619118 executing 
 prepstmnt 245507253 INSERT INTO MyEntity (id, name) VALUES (?, ?) [params=?, 
 ?]
 02-01@06:30:54 TRACE (SQL) - t 2063246672, conn 936619118 [0 ms] spent
 02-01@06:30:54 TRACE (SQL) - t 2063246672, conn 936619118 executing 
 prepstmnt 924315284 INSERT INTO MyEntity (id, name) VALUES (?, ?) [params=?, 
 ?]
 02-01@06:30:54 TRACE (SQL) - t 2063246672, conn 936619118 [0 ms] spent
 02-01@06:30:54 TRACE (SQL) - t 2063246672, conn 936619118 executing 
 prepstmnt 70275790 INSERT INTO MyEntity (id, name) VALUES (?, ?) [params=?, 
 ?]
 02-01@06:30:54 TRACE (SQL) - t 2063246672, conn 936619118 [0 ms] spent
 02-01@06:30:54 TRACE (SQL) - t 2063246672, conn 936619118 executing 
 prepstmnt 9196680 INSERT INTO MyEntity (id, name) VALUES (?, ?) [params=?, ?]
 02-01@06:30:54 TRACE (SQL) - t 2063246672, conn 936619118 [0 ms] spent
 02-01@06:30:54 TRACE (SQL) - t 2063246672, conn 936619118 executing 
 prepstmnt 2097261823 INSERT INTO MyEntity (id, name) VALUES (?, ?) 
 [params=?, ?]
 02-01@06:30:54 TRACE (SQL) - t 2063246672, conn 936619118 [0 ms] spent
 02-01@06:30:54 TRACE (SQL) - t 2063246672, conn 936619118 executing 
 prepstmnt 2030360950 INSERT INTO MyEntity (id

Re: Does Camel JPA component implement it's own connection pooling?

2013-02-01 Thread James Carman
The problem you're facing is that they use a limited set of channels for 
their logging:

http://openjpa.apache.org/builds/1.0.2/apache-openjpa-1.0.2/docs/manual/ref_guide_logging.html#ref_guide_logging_channels

So, you're kind of stuck with those knobs to turn.  It is rather verbose, I'll 
agree.  Unfortunately, for a lot of the channels, you have to jack them all the 
way up to TRACE to get them to give you anything.

On Feb 1, 2013, at 10:51 AM, Chris Wolf cwolf.a...@gmail.com wrote:

 Just to clarify, for me, these logging settings work:
 
 property name=openjpa.Log value=openjpa.jdbc.JDBC=TRACE/
 
 
 -= or, for SQL =-
 
 property name=openjpa.Log value=SQL=TRACE/
 property name=openjpa.ConnectionFactoryProperties
  value=PrettyPrint=true, PrettyPrintLineLength=72/
 property name=openjpa.ConnectionFactoryProperties
  value=printParameters=true/
 
 But the first one (JDBC logging) is too verbose - it's either all or
 nothing, which is why I wanted to setup the slf4j or log4j backend to
 be able to have more fine-grained settings.  If you've been able to
 figure that out, that would be great.  I've already posted on the
 openjpa users list about that, but nothing from there yet...
 
 
 
 On Fri, Feb 1, 2013 at 10:39 AM, Chris Wolf cwolf.a...@gmail.com wrote:
 James,
 
 I just replied to your message from last night - I got it working by
 using your latest suggestion plus enabling DBCP connection pooling,
 although I don't know why pooling should matter.
 
 I notice that you were able to get OpenJPA logging to work - I'd sure
 be interested in seeing your persistence.xml settings for that - I
 have not been able to get any logging from OpenJPA and I tried the
 default, the log4j and slf4j backends - all to no avail...
 
 As for my final implementation, I think this latest code from you is
 the cleanest (for my purposes).  Again, thanks so much for the help.
 
   -Chris
 
 On Fri, Feb 1, 2013 at 6:32 AM, James Carman
 jcar...@carmanconsulting.com wrote:
 Chris,
 
 Here's my complete class:
 
 public class JpaTest
 {
public static void main(String[] args)
{
ClassPathXmlApplicationContext ctx = new 
 ClassPathXmlApplicationContext(classpath:/META-INF/spring-beans.xml);
final EntityManagerFactory factory = 
 ctx.getBean(EntityManagerFactory.class);
final JpaTransactionManager transactionManager = new 
 JpaTransactionManager(factory);
 
TransactionTemplate template = new 
 TransactionTemplate(transactionManager);
template.execute(new TransactionCallbackWithoutResult()
{
@Override
protected void doInTransactionWithoutResult(TransactionStatus 
 status)
{
EntityManager em = 
 EntityManagerFactoryUtils.getTransactionalEntityManager(factory);
for (int i = 0; i  10; ++i)
{
MyEntity entity = new MyEntity();
entity.setName(name);
em.persist(entity);
}
}
});
 
}
 }
 
 
 Here's the output I see when I turn up OpenJPA's logging:
 
 02-01@06:30:54 TRACE (SQL) - t 2063246672, conn 936619118 executing 
 prepstmnt 1546366616 INSERT INTO MyEntity (id, name) VALUES (?, ?) 
 [params=?, ?]
 02-01@06:30:54 TRACE (SQL) - t 2063246672, conn 936619118 [0 ms] spent
 02-01@06:30:54 TRACE (SQL) - t 2063246672, conn 936619118 executing 
 prepstmnt 702383716 INSERT INTO MyEntity (id, name) VALUES (?, ?) 
 [params=?, ?]
 02-01@06:30:54 TRACE (SQL) - t 2063246672, conn 936619118 [0 ms] spent
 02-01@06:30:54 TRACE (SQL) - t 2063246672, conn 936619118 executing 
 prepstmnt 245507253 INSERT INTO MyEntity (id, name) VALUES (?, ?) 
 [params=?, ?]
 02-01@06:30:54 TRACE (SQL) - t 2063246672, conn 936619118 [0 ms] spent
 02-01@06:30:54 TRACE (SQL) - t 2063246672, conn 936619118 executing 
 prepstmnt 924315284 INSERT INTO MyEntity (id, name) VALUES (?, ?) 
 [params=?, ?]
 02-01@06:30:54 TRACE (SQL) - t 2063246672, conn 936619118 [0 ms] spent
 02-01@06:30:54 TRACE (SQL) - t 2063246672, conn 936619118 executing 
 prepstmnt 70275790 INSERT INTO MyEntity (id, name) VALUES (?, ?) [params=?, 
 ?]
 02-01@06:30:54 TRACE (SQL) - t 2063246672, conn 936619118 [0 ms] spent
 02-01@06:30:54 TRACE (SQL) - t 2063246672, conn 936619118 executing 
 prepstmnt 9196680 INSERT INTO MyEntity (id, name) VALUES (?, ?) [params=?, 
 ?]
 02-01@06:30:54 TRACE (SQL) - t 2063246672, conn 936619118 [0 ms] spent
 02-01@06:30:54 TRACE (SQL) - t 2063246672, conn 936619118 executing 
 prepstmnt 2097261823 INSERT INTO MyEntity (id, name) VALUES (?, ?) 
 [params=?, ?]
 02-01@06:30:54 TRACE (SQL) - t 2063246672, conn 936619118 [0 ms] spent
 02-01@06:30:54 TRACE (SQL) - t 2063246672, conn 936619118 executing 
 prepstmnt 2030360950 INSERT INTO MyEntity (id, name) VALUES (?, ?) 
 [params=?, ?]
 02-01@06:30:54 TRACE (SQL) - t 2063246672, conn 936619118 [0 ms] spent

Re: CAMEL + IBM MQ7 + Spring3.0

2013-02-01 Thread James Carman
I don't think that was what they were asking.  You shouldn't have to use a 
specific component for each topic.  

On Feb 1, 2013, at 12:19 PM, am.raheem am.rah...@gmail.com wrote:

 Hi,
 
 It was my problem. I was using same jms component for three different
 topics. That's why i was getting that error. Now I made three different
 camel jms components it worked.
 Thanks for the suggestion to use durableSubscriber.
 
 Thanks,
 Raheem
 On Fri, Feb 1, 2013 at 9:33 AM, Claus Ibsen-2 [via Camel] 
 ml-node+s465427n5726768...@n5.nabble.com wrote:
 
 Hi
 
 Do you have any connection pooling or some sort?
 
 On Fri, Feb 1, 2013 at 4:25 PM, am.raheem [hidden 
 email]http://user/SendEmail.jtp?type=nodenode=5726768i=0
 wrote:
 
 Hi
 
 
 When Iam trying with the below durable configurations
 
 bean id=jms
 class=org.apache.camel.component.jms.JmsComponent
property name=configuration
bean
 class=org.apache.camel.component.jms.JmsConfiguration
property name=connectionFactory
 ref=jmsConnectionFactory/
property name=clientId value=819 /
property name=durableSubscriptionName value=myTopic /
 
 /bean
/property
/bean
 
 I am getting the below error:
 
 Caused by: com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed
 with
 compcode '2' ('MQCC_FAILED') reason '2429' ('MQRC_SUBSCRIPTION_IN_USE').
at
 
 com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:223)
 
 ~[com.ibm.mqjms-7.0.1.1.jar:7.0.1.1 - k701-101-091116].
 Any sugessions on this error?
 
 Thanks,
 Raheem
 
 
 
 --
 View this message in context:
 http://camel.465427.n5.nabble.com/CAMEL-IBM-MQ7-Spring3-0-tp5726692p5726765.html
 
 Sent from the Camel - Users mailing list archive at Nabble.com.
 
 
 
 --
 Claus Ibsen
 -
 Red Hat, Inc.
 FuseSource is now part of Red Hat
 Email: [hidden email]http://user/SendEmail.jtp?type=nodenode=5726768i=1
 Web: http://fusesource.com
 Twitter: davsclaus
 Blog: http://davsclaus.com
 Author of Camel in Action: http://www.manning.com/ibsen
 
 
 --
 If you reply to this email, your message will be added to the discussion
 below:
 
 http://camel.465427.n5.nabble.com/CAMEL-IBM-MQ7-Spring3-0-tp5726692p5726768.html
 To unsubscribe from CAMEL + IBM MQ7 + Spring3.0, click 
 herehttp://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=5726692code=YW0ucmFoZWVtQGdtYWlsLmNvbXw1NzI2NjkyfDE2OTMwOTk3Mw==
 .
 NAMLhttp://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewerid=instant_html%21nabble%3Aemail.namlbase=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespacebreadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
 
 
 
 
 
 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/CAMEL-IBM-MQ7-Spring3-0-tp5726692p5726788.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



Re: CAMEL + IBM MQ7 + Spring3.0

2013-02-01 Thread James Carman
Ahhh.  Sorry, didn't see the durable subscription part there.  

On Feb 1, 2013, at 12:30 PM, am.raheem am.rah...@gmail.com wrote:

 We are setting the clientId  durableSubscriptionName at CAMEL JMS
 component level. If we use same component for all the topics , definitely
 there will be SUBSCRIPTION_IN_USE error will come. So, i am using different
 component for every topic.
 
 
 
 
 On Fri, Feb 1, 2013 at 11:23 AM, James Carman-2 [via Camel] 
 ml-node+s465427n5726789...@n5.nabble.com wrote:
 
 I don't think that was what they were asking.  You shouldn't have to use a
 specific component for each topic.
 
 On Feb 1, 2013, at 12:19 PM, am.raheem [hidden 
 email]http://user/SendEmail.jtp?type=nodenode=5726789i=0
 wrote:
 
 Hi,
 
 It was my problem. I was using same jms component for three different
 topics. That's why i was getting that error. Now I made three different
 camel jms components it worked.
 Thanks for the suggestion to use durableSubscriber.
 
 Thanks,
 Raheem
 On Fri, Feb 1, 2013 at 9:33 AM, Claus Ibsen-2 [via Camel] 
 [hidden email] http://user/SendEmail.jtp?type=nodenode=5726789i=1
 wrote:
 
 Hi
 
 Do you have any connection pooling or some sort?
 
 On Fri, Feb 1, 2013 at 4:25 PM, am.raheem [hidden email]
 http://user/SendEmail.jtp?type=nodenode=5726768i=0
 wrote:
 
 Hi
 
 
 When Iam trying with the below durable configurations
 
bean id=jms
 class=org.apache.camel.component.jms.JmsComponent
   property name=configuration
   bean
 class=org.apache.camel.component.jms.JmsConfiguration
   property name=connectionFactory
 ref=jmsConnectionFactory/
   property name=clientId value=819 /
   property name=durableSubscriptionName value=myTopic /
 
/bean
   /property
   /bean
 
 I am getting the below error:
 
 Caused by: com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call
 failed
 with
 compcode '2' ('MQCC_FAILED') reason '2429'
 ('MQRC_SUBSCRIPTION_IN_USE').
   at
 
 
 com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:223)
 
 
 ~[com.ibm.mqjms-7.0.1.1.jar:7.0.1.1 - k701-101-091116].
 Any sugessions on this error?
 
 Thanks,
 Raheem
 
 
 
 --
 View this message in context:
 
 http://camel.465427.n5.nabble.com/CAMEL-IBM-MQ7-Spring3-0-tp5726692p5726765.html
 
 Sent from the Camel - Users mailing list archive at Nabble.com.
 
 
 
 --
 Claus Ibsen
 -
 Red Hat, Inc.
 FuseSource is now part of Red Hat
 Email: [hidden email]
 http://user/SendEmail.jtp?type=nodenode=5726768i=1
 Web: http://fusesource.com
 Twitter: davsclaus
 Blog: http://davsclaus.com
 Author of Camel in Action: http://www.manning.com/ibsen
 
 
 --
 If you reply to this email, your message will be added to the
 discussion
 below:
 
 
 
 .
 NAML
 http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewerid=instant_html%21nabble%3Aemail.namlbase=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespacebreadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
 
 
 
 
 
 
 --
 View this message in context:
 http://camel.465427.n5.nabble.com/CAMEL-IBM-MQ7-Spring3-0-tp5726692p5726788.html
 
 Sent from the Camel - Users mailing list archive at Nabble.com.
 
 
 
 --
 If you reply to this email, your message will be added to the discussion
 below:
 
 http://camel.465427.n5.nabble.com/CAMEL-IBM-MQ7-Spring3-0-tp5726692p5726789.html
 To unsubscribe from CAMEL + IBM MQ7 + Spring3.0, click 
 herehttp://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=5726692code=YW0ucmFoZWVtQGdtYWlsLmNvbXw1NzI2NjkyfDE2OTMwOTk3Mw==
 .
 NAMLhttp://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewerid=instant_html%21nabble%3Aemail.namlbase=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespacebreadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
 
 
 
 
 
 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/CAMEL-IBM-MQ7-Spring3-0-tp5726692p5726791.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



Re: Does Camel JPA component implement it's own connection pooling?

2013-01-31 Thread James Carman
Well, you're managing your entity manager yourself, right?  You could
have a bug in there that's leaving it open?  Can you use Spring or
some other technology to do this for you in a way where you can be
sure everything gets cleaned up?


On Thu, Jan 31, 2013 at 2:28 PM, Chris Wolf cwolf.a...@gmail.com wrote:
 Howdy Matthias,

 Yes, in an earlier post to this thread, I mentioned that 120
 connections were being opened (the max). So, yes, the max connections
 limit is being hit.

 I observe this by tailing the TNS listener log

 c:/app/userId/diag/tnslsnr/userId/listener/trace/listener.log

 (Oracle-11g on Windows7)


 The question is why?  Unless I have a connection leak.

-Chris


 On Thu, Jan 31, 2013 at 2:21 PM, Matthias Lüneberg
 matthias.lueneb...@googlemail.com wrote:
 Hi,

 Is it possible that the oracle database has reached its max 
 connections/processes limit?

 I found an article: 
 http://www.dadbm.com/2011/11/oracle-listener-refused-connection-ora-12519-troubleshooting/

 Maybe its a database failure. Can you have a look at this?

 HTH, Matthias

 Am 31.01.2013 um 18:48 schrieb Chris Wolf cwolf.a...@gmail.com:

 James,

 Here is what it looks like.  At first, I was using the jpa://
 endpoint, but then I needed to implement a custom processor to handle
 additional logic.  Thanks for having a look...

   -Chris

 from(file:/tmp/local/data?filter=#filterpreMove=/tmp/local/holding/${file:onlyname}.${id}move=/tmp/local/archivemoveFailed=/tmp/local/errorsreadLock=changed)
 .unmarshal(cpmdfileFormat)
 .processRef(dataStore)
 //.to(jpa:?persistenceUnit=marketdata)
 .beanRef(oneshotPoller, resumeJpaConsumer); // signal consumer
 route to begin


 Bean for dataStore:

 public class CPMDPersister implements Processor {
   private static final transient Logger log =
 LoggerFactory.getLogger(CPMDPersister.class);
   IGenericDAOMdBaseData mdBaseDataDAO;
   IGenericDAOMdCurveData mdCurveDataDAO;

   public CPMDPersister(){}

public CPMDPersister(IGenericDAOMdBaseData mdBaseDataDAO,
 IGenericDAOMdCurveData mdCurveDataDAO) {
   this.mdBaseDataDAO = mdBaseDataDAO;
   this.mdCurveDataDAO = mdCurveDataDAO;
}

   @Override
   public void process(Exchange exchange) throws Exception {
   Message inMsg = exchange.getIn();

   @SuppressWarnings(unchecked)
   ListMdBaseData mdBaseData =
 (ArrayListMdBaseData)inMsg.getBody(ArrayList.class);

   IntervalElapsedTimer avg = new IntervalElapsedTimer();
   avg.start();
   mdBaseDataDAO.begin();

   for (MdBaseData md : mdBaseData) {
   setParentReferences(md);
   mdBaseDataDAO.save(md);
   avg.lap();
   log.debug(JPA Persist MD: {}, {},
   new Object[] {md.toString(), avg.toString()});
   }

   mdBaseDataDAO.commit();

   log.debug(JPA Persist: {}, avg.toString());
   int a = 0;
   }

   void setParentReferences(MdBaseData md) {
   for (MdCurveData cd : md.getMdCurveData()) {
   if (cd.getMdBaseData() == null)
   cd.setMdBaseData(new ArrayListMdBaseData());
   if (!cd.getMdBaseData().contains(md))
   cd.getMdBaseData().add(md);
   }
   }
 }

 The DAOs, are a thin wrapper around EntityManager, like:

   @SuppressWarnings(unchecked)
   public ListT findAll() {
   return entityManager.createQuery(from  + 
 entityType.getName())
   .getResultList();
   }
   public void begin() {
   this.entityManager.getTransaction().begin();
   }

   public void commit() {
   this.entityManager.getTransaction().commit();
   this.entityManager.clear();
   }

   public void rollback() {
   this.entityManager.getTransaction().rollback();
   }

 On Thu, Jan 31, 2013 at 12:34 PM, James Carman
 ja...@carmanconsulting.com wrote:
 What does your route look like?


 On Thu, Jan 31, 2013 at 11:58 AM, Chris Wolf cwolf.a...@gmail.com wrote:
 I have further determined that it's an OpenJPA issue (or user error,
 but how can that be?) ;)

 I will report back when I get to the bottom of it.  Thanks a lot,

 Chris

 On Sat, Jan 26, 2013 at 2:47 AM, Willem Jiang willem.ji...@gmail.com 
 wrote:
 Can you share us your camel route? It is important for us to find out 
 the key reason of your issue.


 发自我的 iPhone

 在 2013-1-26,上午5:22,Chris Wolf cwolf.a...@gmail.com 写道:

 On Fri, Jan 25, 2013 at 3:55 PM, Chris Wolf cwolf.a...@gmail.com 
 wrote:
 I ask because when I use jpa:  in producer mode, I get this error:
 Caused by: oracle.net.ns.NetException: Listener refused the connection
 with the following error:
 ORA-12519, TNS:no appropriate service handler found

 Strangely, using  jpa: in consumer mode

Re: Does Camel JPA component implement it's own connection pooling?

2013-01-31 Thread James Carman
Well, it looks like you're also managing your own transactions.
Perhaps just use Spring for the transaction management.


On Thu, Jan 31, 2013 at 2:35 PM, Chris Wolf cwolf.a...@gmail.com wrote:
 Right, I looked into that but the Spring docs say that JpaTemplate is
 deprecated in favor of native JPA APIs.

 http://static.springsource.org/spring/docs/3.1.x/javadoc-api/org/springframework/orm/jpa/JpaTemplate.html

 I am using OpenJPA-2.1

 Thanks,

-Chris

 On Thu, Jan 31, 2013 at 2:29 PM, James Carman
 ja...@carmanconsulting.com wrote:
 Well, you're managing your entity manager yourself, right?  You could
 have a bug in there that's leaving it open?  Can you use Spring or
 some other technology to do this for you in a way where you can be
 sure everything gets cleaned up?


 On Thu, Jan 31, 2013 at 2:28 PM, Chris Wolf cwolf.a...@gmail.com wrote:
 Howdy Matthias,

 Yes, in an earlier post to this thread, I mentioned that 120
 connections were being opened (the max). So, yes, the max connections
 limit is being hit.

 I observe this by tailing the TNS listener log

 c:/app/userId/diag/tnslsnr/userId/listener/trace/listener.log

 (Oracle-11g on Windows7)


 The question is why?  Unless I have a connection leak.

-Chris


 On Thu, Jan 31, 2013 at 2:21 PM, Matthias Lüneberg
 matthias.lueneb...@googlemail.com wrote:
 Hi,

 Is it possible that the oracle database has reached its max 
 connections/processes limit?

 I found an article: 
 http://www.dadbm.com/2011/11/oracle-listener-refused-connection-ora-12519-troubleshooting/

 Maybe its a database failure. Can you have a look at this?

 HTH, Matthias

 Am 31.01.2013 um 18:48 schrieb Chris Wolf cwolf.a...@gmail.com:

 James,

 Here is what it looks like.  At first, I was using the jpa://
 endpoint, but then I needed to implement a custom processor to handle
 additional logic.  Thanks for having a look...

   -Chris

 from(file:/tmp/local/data?filter=#filterpreMove=/tmp/local/holding/${file:onlyname}.${id}move=/tmp/local/archivemoveFailed=/tmp/local/errorsreadLock=changed)
 .unmarshal(cpmdfileFormat)
 .processRef(dataStore)
 //.to(jpa:?persistenceUnit=marketdata)
 .beanRef(oneshotPoller, resumeJpaConsumer); // signal consumer
 route to begin


 Bean for dataStore:

 public class CPMDPersister implements Processor {
   private static final transient Logger log =
 LoggerFactory.getLogger(CPMDPersister.class);
   IGenericDAOMdBaseData mdBaseDataDAO;
   IGenericDAOMdCurveData mdCurveDataDAO;

   public CPMDPersister(){}

public CPMDPersister(IGenericDAOMdBaseData mdBaseDataDAO,
 IGenericDAOMdCurveData mdCurveDataDAO) {
   this.mdBaseDataDAO = mdBaseDataDAO;
   this.mdCurveDataDAO = mdCurveDataDAO;
}

   @Override
   public void process(Exchange exchange) throws Exception {
   Message inMsg = exchange.getIn();

   @SuppressWarnings(unchecked)
   ListMdBaseData mdBaseData =
 (ArrayListMdBaseData)inMsg.getBody(ArrayList.class);

   IntervalElapsedTimer avg = new IntervalElapsedTimer();
   avg.start();
   mdBaseDataDAO.begin();

   for (MdBaseData md : mdBaseData) {
   setParentReferences(md);
   mdBaseDataDAO.save(md);
   avg.lap();
   log.debug(JPA Persist MD: {}, {},
   new Object[] {md.toString(), avg.toString()});
   }

   mdBaseDataDAO.commit();

   log.debug(JPA Persist: {}, avg.toString());
   int a = 0;
   }

   void setParentReferences(MdBaseData md) {
   for (MdCurveData cd : md.getMdCurveData()) {
   if (cd.getMdBaseData() == null)
   cd.setMdBaseData(new 
 ArrayListMdBaseData());
   if (!cd.getMdBaseData().contains(md))
   cd.getMdBaseData().add(md);
   }
   }
 }

 The DAOs, are a thin wrapper around EntityManager, like:

   @SuppressWarnings(unchecked)
   public ListT findAll() {
   return entityManager.createQuery(from  + 
 entityType.getName())
   .getResultList();
   }
   public void begin() {
   this.entityManager.getTransaction().begin();
   }

   public void commit() {
   this.entityManager.getTransaction().commit();
   this.entityManager.clear();
   }

   public void rollback() {
   this.entityManager.getTransaction().rollback();
   }

 On Thu, Jan 31, 2013 at 12:34 PM, James Carman
 ja...@carmanconsulting.com wrote:
 What does your route look like?


 On Thu, Jan 31, 2013 at 11:58 AM, Chris Wolf cwolf.a...@gmail.com 
 wrote:
 I have further determined that it's an OpenJPA issue (or user error,
 but how can that be?) ;)

 I will report back when I get to the bottom of it.  Thanks a lot,

 Chris

 On Sat, Jan 26, 2013 at 2:47 AM

Re: Does Camel JPA component implement it's own connection pooling?

2013-01-31 Thread James Carman
Do you have a gist of your test scaffold?  I'm curious now :)


On Thu, Jan 31, 2013 at 2:59 PM, Chris Wolf cwolf.a...@gmail.com wrote:
 Sure, I can look into that.

 I also narrowed down the issue while stepping through my code while
 tailing the TNS listener log - when
 EntityManager.getTransaction().commit(); is called - is when all those
 120 connections are opened.

 (Again, this is in my standalone JPA test scaffold, not including
 Camel now)  I have been communicating this issue on the OpenJPA
 list...



 On Thu, Jan 31, 2013 at 2:45 PM, James Carman
 ja...@carmanconsulting.com wrote:
 Well, it looks like you're also managing your own transactions.
 Perhaps just use Spring for the transaction management.


 On Thu, Jan 31, 2013 at 2:35 PM, Chris Wolf cwolf.a...@gmail.com wrote:
 Right, I looked into that but the Spring docs say that JpaTemplate is
 deprecated in favor of native JPA APIs.

 http://static.springsource.org/spring/docs/3.1.x/javadoc-api/org/springframework/orm/jpa/JpaTemplate.html

 I am using OpenJPA-2.1

 Thanks,

-Chris

 On Thu, Jan 31, 2013 at 2:29 PM, James Carman
 ja...@carmanconsulting.com wrote:
 Well, you're managing your entity manager yourself, right?  You could
 have a bug in there that's leaving it open?  Can you use Spring or
 some other technology to do this for you in a way where you can be
 sure everything gets cleaned up?


 On Thu, Jan 31, 2013 at 2:28 PM, Chris Wolf cwolf.a...@gmail.com wrote:
 Howdy Matthias,

 Yes, in an earlier post to this thread, I mentioned that 120
 connections were being opened (the max). So, yes, the max connections
 limit is being hit.

 I observe this by tailing the TNS listener log

 c:/app/userId/diag/tnslsnr/userId/listener/trace/listener.log

 (Oracle-11g on Windows7)


 The question is why?  Unless I have a connection leak.

-Chris


 On Thu, Jan 31, 2013 at 2:21 PM, Matthias Lüneberg
 matthias.lueneb...@googlemail.com wrote:
 Hi,

 Is it possible that the oracle database has reached its max 
 connections/processes limit?

 I found an article: 
 http://www.dadbm.com/2011/11/oracle-listener-refused-connection-ora-12519-troubleshooting/

 Maybe its a database failure. Can you have a look at this?

 HTH, Matthias

 Am 31.01.2013 um 18:48 schrieb Chris Wolf cwolf.a...@gmail.com:

 James,

 Here is what it looks like.  At first, I was using the jpa://
 endpoint, but then I needed to implement a custom processor to handle
 additional logic.  Thanks for having a look...

   -Chris

 from(file:/tmp/local/data?filter=#filterpreMove=/tmp/local/holding/${file:onlyname}.${id}move=/tmp/local/archivemoveFailed=/tmp/local/errorsreadLock=changed)
 .unmarshal(cpmdfileFormat)
 .processRef(dataStore)
 //.to(jpa:?persistenceUnit=marketdata)
 .beanRef(oneshotPoller, resumeJpaConsumer); // signal consumer
 route to begin


 Bean for dataStore:

 public class CPMDPersister implements Processor {
   private static final transient Logger log =
 LoggerFactory.getLogger(CPMDPersister.class);
   IGenericDAOMdBaseData mdBaseDataDAO;
   IGenericDAOMdCurveData mdCurveDataDAO;

   public CPMDPersister(){}

public CPMDPersister(IGenericDAOMdBaseData mdBaseDataDAO,
 IGenericDAOMdCurveData mdCurveDataDAO) {
   this.mdBaseDataDAO = mdBaseDataDAO;
   this.mdCurveDataDAO = mdCurveDataDAO;
}

   @Override
   public void process(Exchange exchange) throws Exception {
   Message inMsg = exchange.getIn();

   @SuppressWarnings(unchecked)
   ListMdBaseData mdBaseData =
 (ArrayListMdBaseData)inMsg.getBody(ArrayList.class);

   IntervalElapsedTimer avg = new IntervalElapsedTimer();
   avg.start();
   mdBaseDataDAO.begin();

   for (MdBaseData md : mdBaseData) {
   setParentReferences(md);
   mdBaseDataDAO.save(md);
   avg.lap();
   log.debug(JPA Persist MD: {}, {},
   new Object[] {md.toString(), avg.toString()});
   }

   mdBaseDataDAO.commit();

   log.debug(JPA Persist: {}, avg.toString());
   int a = 0;
   }

   void setParentReferences(MdBaseData md) {
   for (MdCurveData cd : md.getMdCurveData()) {
   if (cd.getMdBaseData() == null)
   cd.setMdBaseData(new 
 ArrayListMdBaseData());
   if (!cd.getMdBaseData().contains(md))
   cd.getMdBaseData().add(md);
   }
   }
 }

 The DAOs, are a thin wrapper around EntityManager, like:

   @SuppressWarnings(unchecked)
   public ListT findAll() {
   return entityManager.createQuery(from  + 
 entityType.getName())
   .getResultList();
   }
   public void begin() {
   this.entityManager.getTransaction().begin();
   }

   public void commit

Re: Does Camel JPA component implement it's own connection pooling?

2013-01-31 Thread James Carman
Try this:

   JpaTransactionManager transactionManager = new 
JpaTransactionManager(factory);

TransactionTemplate template = new 
TransactionTemplate(transactionManager);
template.execute(new TransactionCallbackWithoutResult()
{
@Override
protected void doInTransactionWithoutResult(TransactionStatus 
status)
{
EntityManager em = 
EntityManagerFactoryUtils.getTransactionalEntityManager(factory);
MyEntity entity = new MyEntity();
em.persist(entity);
}
});

On Jan 31, 2013, at 5:49 PM, Chris Wolf cwolf.a...@gmail.com wrote:

 James,
 
 Ok, now using TransactionTemplate, but I'm back to where I was - the
 same apparent connection leak, only now
 the code is hideous with all those nested anonymous classes and whatnot... ;)
 
 
   -Chris
 
static void saveToDB(final ListMdBaseData data) throws Exception {
   EntityManagerFactory emf = Persistence
   .createEntityManagerFactory(marketdata);
   
   final JpaTemplate jpaTempl = new JpaTemplate(emf);
   jpaTempl.afterPropertiesSet();
   
   JpaTransactionManager jpaTxMgr = new JpaTransactionManager(emf);
   jpaTxMgr.afterPropertiesSet();
   
   final TransactionTemplate txTmpl = new 
 TransactionTemplate(jpaTxMgr);
   txTmpl.afterPropertiesSet();
 
   TransactionStrategy txStrategy = new TransactionStrategy() {
   @SuppressWarnings(deprecation)
   public Object execute(final JpaCallback? callback) {
   return txTmpl.execute(new 
 TransactionCallbackObject() {
   public Object 
 doInTransaction(TransactionStatus status) {
   return jpaTempl.execute(new 
 JpaCallbackObject() {
   public Object 
 doInJpa(EntityManager entityManager)
   throws 
 PersistenceException {
   return 
 callback.doInJpa(entityManager);
   }
   });
   }
   });
   }
   };
   
   txStrategy.execute(new JpaCallbackObject() {
   @Override
   public Object doInJpa(EntityManager em) throws 
 PersistenceException {
   for (MdBaseData bd : data) {
   em.persist(bd);
   }
   return null; // writing to db, not reading...
   }   
   });
}
 
 
 On Thu, Jan 31, 2013 at 4:42 PM, James Carman
 jcar...@carmanconsulting.com wrote:
 Try using TransactionTemplate.
 
 On Jan 31, 2013, at 4:19 PM, Chris Wolf cwolf.a...@gmail.com wrote:
 
 James,
 
 As per your suggestion, I let Spring manage the transactions and the
 apparent connection leak went away and I only see one connection
 being opened per session, as expected.
 
 Unfortunately, nothing got inserted into the database.
 
 Thanks,
 
  -Chris
 
 My modified code looks like:
 
 
   static void saveToDB(ListMdBaseData data) throws Exception {
  EntityManagerFactory emf = Persistence
  .createEntityManagerFactory(marketdata);
  JpaTransactionManager jpaTxMgr = new 
 JpaTransactionManager(emf);
 
 
  EntityManager em =
  
 jpaTxMgr.getEntityManagerFactory().createEntityManager();
  TransactionStatus txStatus =
  jpaTxMgr.getTransaction(new 
 DefaultTransactionDefinition());
  try {
  //em.getTransaction().begin();
  for (MdBaseData bd : data) {
  em.persist(bd);
  }
  //em.getTransaction().commit();
  jpaTxMgr.commit(txStatus);
  } catch (Exception e) {
  jpaTxMgr.rollback(txStatus);
  e.printStackTrace();
  } finally {
  //em.close();
  }
   }
 
 On Thu, Jan 31, 2013 at 2:45 PM, James Carman
 ja...@carmanconsulting.com wrote:
 Well, it looks like you're also managing your own transactions.
 Perhaps just use Spring for the transaction management.
 
 
 On Thu, Jan 31, 2013 at 2:35 PM, Chris Wolf cwolf.a...@gmail.com wrote:
 Right, I looked into that but the Spring docs say that JpaTemplate is
 deprecated in favor of native JPA APIs.
 
 http://static.springsource.org/spring/docs/3.1

Re: JPA component throwing Attempt to cast instance [Ljava.lang.Object

2013-01-16 Thread James Carman
Are you using the same version of OpenJPA to enhance your classes that
you're using at runtime?

On Tue, Jan 15, 2013 at 5:11 PM, Chris Wolf cwolf.a...@gmail.com wrote:
 Babak,

 Thanks for the detailed reply, but if you look at my first post on
 this thread, I mentioned that that error message concerning
 enhancement is misleading.  If I configure consumeDelete=false,
 there's no error - the entities are created by JPA.
 I also mentioned I verified enhancement by observing the added fields,
 methods and interfaces via the javap (decompiler) tool.

 I didn't know about the test-enhance goal, so that was good to learn, thanks.
 (my entities are under main/java, so I just use the enhance goal)

-Chris


 On Tue, Jan 15, 2013 at 4:05 PM, Babak Vahdat
 babak.vah...@swissonline.ch wrote:


 Am 15.01.13 21:22 schrieb Chris Wolf unter cwolf.a...@gmail.com:

I upgraded to OpenJPA-2.2.1.  Still have the same issue.

 Hi

 The problem you're facing is that the byte-code of your JPA entity has not
 been enhanced, see your stack trace where it says Ensure that it has been
 enhanced. Also take a look at the source where that exception is thrown:

 org.apache.openjpa.kernel.BrokerImpl.assertPersistenceCapable(BrokerImpl.ja
 va:4667)

 When enhancement gets done properly then the byte code of your entity
 class gets instrumentalized to implement the interface
 org.apache.openjpa.enhance.PersistenceCapable (this's of course in case of
 OpenJPA).

 No matter which JPA provider you make use of (OpenJPA, Hibernate or
 Eclipselink) @ runtime you should make sure that the entity class byte
 code has been enhanced/weaved properly. This can be done either statically
 or dynamically. Recently I added a note about this on the Camel JPA
 component documentation which could be helpful for your use case. See the
 blue box at the bottom here:

 http://camel.apache.org/jpa.html

 In that box there's also a link pointing to the corresponding OpenJPA
 documentation about this. You can also look at the camel-jpa POM itself to
 see how the static enhancement is done. However in your case you would
 need to make use of the enhance goal and not test-enhance.

 Babak




Here's the route, followed by console output, followed by entities
code.  BTW, I notice that the data type of Body coming out
of the jpa endpoint is of type Object[], I think this is part of the
problem, because I put a breakpoint on line 159 in JpaConsumer,
which is:

getDeleteHandler().deleteObject(entityManager, result);

...and that  result is of type Object[] where each element is a
field value of the entity cooresponding to the
MarketData entity but it's NOT of type MarketData - hence the cast
exception when EntityManager.remove() is called.

Thanks Claus and Christian,

-Chris





from(jpa:entities.MarketData?persistenceUnit=marketdataconsumeDelete=tru
econsumer.nativeQuery=select
* from market_data where rownum  10)

.to(log:test.camel?showAll=truemultiline=truelevel=INFO)
.to(mock:foo);

1158  marketdata  INFO   [Camel (camel-1) thread #1 -
jpa://entities.MarketData] openjpa.Runtime - Starting OpenJPA 2.2.1
1236  marketdata  INFO   [Camel (camel-1) thread #1 -
jpa://entities.MarketData] openjpa.jdbc.JDBC - Using dictionary class
org.apache.openjpa.jdbc.sql.OracleDictionary.
3661 [Camel (camel-1) thread #1 - jpa://entities.MarketData] INFO
test.camel - Exchange[
, Id:ID-cwolf-55710-1358279796309-0-2
, ExchangePattern:InOnly
,
Properties:{CamelToEndpoint=log://test.camel?level=INFOmultiline=truesho
wAll=true,
CamelBatchComplete=true, CamelBatchSize=1, CamelCreatedTimestamp=Tue
Jan 15 14:56:39 EST 2013, CamelBatchIndex=0}
,
Headers:{CamelJpaTemplate=org.springframework.orm.jpa.JpaTemplate@1e99db4,
breadcrumbId=ID-cwolf-55710-1358279796309-0-1}
, BodyType:Object[]
, Body:[Ljava.lang.Object;@a1e2da
, Out: null
]
3272 [Camel (camel-1) thread #1 - jpa://entities.MarketData] WARN
org.apache.camel.component.jpa.JpaConsumer - Error processing last
message due: openjpa-2.2.1-r422266:1396819 nonfatal user error
org.apache.openjpa.persistence.ArgumentException: Attempt to cast
instance [Ljava.lang.Object;@1cfd3b2 to PersistenceCapable failed.
Ensure that it has been enhanced.
FailedObject: [Ljava.lang.Object;@1cfd3b2. Will commit all previous
successful processed message, and ignore this last failure.
javax.persistence.PersistenceException: openjpa-2.2.1-r422266:1396819
nonfatal user error org.apache.openjpa.persistence.ArgumentException:
Attempt to cast instance [Ljava.lang.Object;@1cfd3b2 to
PersistenceCapable failed.  Ensure that it has been enhanced.
FailedObject: [Ljava.lang.Object;@1cfd3b2
   at
org.apache.camel.component.jpa.JpaConsumer$1.doInJpa(JpaConsumer.java:102)
   at
org.apache.camel.component.jpa.JpaTemplateTransactionStrategy$1$1.doInJpa(
JpaTemplateTransactionStrategy.java:82)
   at 
 org.springframework.orm.jpa.JpaTemplate.execute(JpaTemplate.java:183)
   at 
 

Re: JPA component throwing Attempt to cast instance [Ljava.lang.Object

2013-01-16 Thread James Carman
Sorry, didn't see that one.  Glad to hear it's resolved.

On Wed, Jan 16, 2013 at 7:09 AM, Chris Wolf cwolf.a...@gmail.com wrote:
 James,

 Sorry, I think I broke the thread by appending *** PROBLEM SOLVED
 *** to the subject (See mail traffic from last night around 9PM).
 The issue the whole time was my not having used the
 consumer.resultClass option.

 Thanks,

 -Chris

 On Wed, Jan 16, 2013 at 6:51 AM, James Carman
 ja...@carmanconsulting.com wrote:
 Are you using the same version of OpenJPA to enhance your classes that
 you're using at runtime?

 On Tue, Jan 15, 2013 at 5:11 PM, Chris Wolf cwolf.a...@gmail.com wrote:
 Babak,

 Thanks for the detailed reply, but if you look at my first post on
 this thread, I mentioned that that error message concerning
 enhancement is misleading.  If I configure consumeDelete=false,
 there's no error - the entities are created by JPA.
 I also mentioned I verified enhancement by observing the added fields,
 methods and interfaces via the javap (decompiler) tool.

 I didn't know about the test-enhance goal, so that was good to learn, 
 thanks.
 (my entities are under main/java, so I just use the enhance goal)

-Chris


 On Tue, Jan 15, 2013 at 4:05 PM, Babak Vahdat
 babak.vah...@swissonline.ch wrote:


 Am 15.01.13 21:22 schrieb Chris Wolf unter cwolf.a...@gmail.com:

I upgraded to OpenJPA-2.2.1.  Still have the same issue.

 Hi

 The problem you're facing is that the byte-code of your JPA entity has not
 been enhanced, see your stack trace where it says Ensure that it has been
 enhanced. Also take a look at the source where that exception is thrown:

 org.apache.openjpa.kernel.BrokerImpl.assertPersistenceCapable(BrokerImpl.ja
 va:4667)

 When enhancement gets done properly then the byte code of your entity
 class gets instrumentalized to implement the interface
 org.apache.openjpa.enhance.PersistenceCapable (this's of course in case of
 OpenJPA).

 No matter which JPA provider you make use of (OpenJPA, Hibernate or
 Eclipselink) @ runtime you should make sure that the entity class byte
 code has been enhanced/weaved properly. This can be done either statically
 or dynamically. Recently I added a note about this on the Camel JPA
 component documentation which could be helpful for your use case. See the
 blue box at the bottom here:

 http://camel.apache.org/jpa.html

 In that box there's also a link pointing to the corresponding OpenJPA
 documentation about this. You can also look at the camel-jpa POM itself to
 see how the static enhancement is done. However in your case you would
 need to make use of the enhance goal and not test-enhance.

 Babak




Here's the route, followed by console output, followed by entities
code.  BTW, I notice that the data type of Body coming out
of the jpa endpoint is of type Object[], I think this is part of the
problem, because I put a breakpoint on line 159 in JpaConsumer,
which is:

getDeleteHandler().deleteObject(entityManager, result);

...and that  result is of type Object[] where each element is a
field value of the entity cooresponding to the
MarketData entity but it's NOT of type MarketData - hence the cast
exception when EntityManager.remove() is called.

Thanks Claus and Christian,

-Chris





from(jpa:entities.MarketData?persistenceUnit=marketdataconsumeDelete=tru
econsumer.nativeQuery=select
* from market_data where rownum  10)

.to(log:test.camel?showAll=truemultiline=truelevel=INFO)
.to(mock:foo);

1158  marketdata  INFO   [Camel (camel-1) thread #1 -
jpa://entities.MarketData] openjpa.Runtime - Starting OpenJPA 2.2.1
1236  marketdata  INFO   [Camel (camel-1) thread #1 -
jpa://entities.MarketData] openjpa.jdbc.JDBC - Using dictionary class
org.apache.openjpa.jdbc.sql.OracleDictionary.
3661 [Camel (camel-1) thread #1 - jpa://entities.MarketData] INFO
test.camel - Exchange[
, Id:ID-cwolf-55710-1358279796309-0-2
, ExchangePattern:InOnly
,
Properties:{CamelToEndpoint=log://test.camel?level=INFOmultiline=truesho
wAll=true,
CamelBatchComplete=true, CamelBatchSize=1, CamelCreatedTimestamp=Tue
Jan 15 14:56:39 EST 2013, CamelBatchIndex=0}
,
Headers:{CamelJpaTemplate=org.springframework.orm.jpa.JpaTemplate@1e99db4,
breadcrumbId=ID-cwolf-55710-1358279796309-0-1}
, BodyType:Object[]
, Body:[Ljava.lang.Object;@a1e2da
, Out: null
]
3272 [Camel (camel-1) thread #1 - jpa://entities.MarketData] WARN
org.apache.camel.component.jpa.JpaConsumer - Error processing last
message due: openjpa-2.2.1-r422266:1396819 nonfatal user error
org.apache.openjpa.persistence.ArgumentException: Attempt to cast
instance [Ljava.lang.Object;@1cfd3b2 to PersistenceCapable failed.
Ensure that it has been enhanced.
FailedObject: [Ljava.lang.Object;@1cfd3b2. Will commit all previous
successful processed message, and ignore this last failure.
javax.persistence.PersistenceException: openjpa-2.2.1-r422266:1396819
nonfatal user error org.apache.openjpa.persistence.ArgumentException:
Attempt to cast instance [Ljava.lang.Object;@1cfd3b2

Re: Proxying of content repository Web Services

2012-12-18 Thread James Carman
You just need a cxf endpoint to begin your route.  Then do whatever you
want to the message (or nothing) and send it to the cm system (via cxf
also).

On Monday, December 17, 2012, spatil4572 wrote:

 Hi,

 I am a newbie and need help.

 We have a client application that communicates with a content management
 system using content management systems' own web services. We would like to
 add Apache Camel between the client and content management system. We would
 like to do this in such a way that there is no change in the client or
 content management system. Of course, we would be able to configure the new
 web service endpoints etc in the client to direct the client requests to
 proxy instead of content management system. Initially, we just want to
 route
 the requests in the proxy to content management system. Later on, we plan
 on
 modifying the messages etc.

 Here are my queries related to this:
 1. Is Apache Camel right fit for this need? I think so, but just wanted to
 understand if there are any caveats.
 2. I am assuming we would not be required to implement any extensive web
 service consumer (i.e. client functionality) in Apache Camel. Otherwise we
 would be duplicating the efforts in both client and Camel. Can you please
 help me understand if this is the right assumption?
 3. Is CXF Proxy Example, the best one that is similar to my need? Is there
 any other example that I should look at?

 Regards.




 --
 View this message in context:
 http://camel.465427.n5.nabble.com/Proxying-of-content-repository-Web-Services-tp5724253.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



Re: Multicast or pipeline? Newbie question

2012-12-06 Thread James Carman
I would say you don't need anything really special here.  Something
like this should suffice:

from(jms:queue:input).beanRef(beanOne,
methodOne).beanRef(beanTwo, methodTwo);

On Thu, Dec 6, 2012 at 10:58 AM, Mike Stroming mstro...@gmail.com wrote:
 Hi all,

 Another newbie question, if you don't mind.

 I have two processes that need the same message as input.  However, the
 second process should only run based on successful output from the first
 process.  Would a multicast/pipeline make sense here or not?  I don't need
 either to get it to work, but I'm trying to follow some sort of Camel
 standard.

 Msg enters queue
 bean one
 if bean one successful
   bean two

 Thanks,
 Mike


Re: Follow on to configuring persistence with java not spring xml

2012-11-20 Thread James Carman
Yes, that's essential:

https://github.com/jwcarman/camel-transaction/blob/master/src/test/java/com/carmanconsulting/camel/AbstractRouteBuilderTest.java


On Tue, Nov 20, 2012 at 1:43 PM, Babak Vahdat
babak.vah...@swissonline.ch wrote:
 Hi

 You get null as Spring does one step more than you, that's:

   emFactory.afterPropertiesSet();

 Because LocalContainerEntityManagerFactoryBean implements InitializingBean

 Look at the last line in that method where this FactoryBean does:

   this.entityManagerFactory =
 createEntityManagerFactoryProxy(this.nativeEntityManagerFactory);

 So maybe calling this method inside your Java code right after emFactory
 instantiation could help to move one step further.

 Babak


 Jay Walters wrote
 My reading of the spring xml makes me think java such as shown below will
 configure the EntityManagerFactory

   JpaVendorAdapter jpaAdapter = new HibernateJpaVendorAdapter();
   BasicDataSource dataSource = new BasicDataSource();

 dataSource.setDriverClassName(org.apache.derby.jdbc.EmbeddedDriver);
   dataSource.setUrl(jdbc:derby:target/test/database;create=true);

   LocalContainerEntityManagerFactoryBean emFactory = new
 LocalContainerEntityManagerFactoryBean();
   emFactory.setPersistenceUnitName(bam);
   emFactory.setJpaVendorAdapter(jpaAdapter);
   emFactory.setDataSource(dataSource);

 emFactory.setPersistenceXmlLocation(/dev/camel-play/persistence.xml);
   JpaTemplate jpaTemplate = new JpaTemplate();
   jpaTemplate.setEntityManagerFactory(emFactory.getObject());

 But the last line fails as emFactory.getObject() is null.  I get no debug
 messages, no exception, just a nice fat null.

 In production I might be able to use spring to define this database bit
 since that will be static for the application, and then define
 the routes dynamically with java DSL, but I'd like to have a java example
 without spring if I can get such a thing working.

 Thanks
 Jay





 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Follow-on-to-configuring-persistence-with-java-not-spring-xml-tp5722984p5723026.html
 Sent from the Camel - Users mailing list archive at Nabble.com.


  1   2   >