Re: Using camel-cdi on Wildfly-10.1

2017-05-05 Thread John D. Ament
Hi Drazen,

Can you modify your camel module.xml to also add these same references to
deltaspike?

John

On Fri, May 5, 2017 at 8:03 AM Drazen Kozic <kozic.dra...@gmail.com> wrote:

> Hello John,
>
> I did what you said. My
> src/main/webapp/META-INF/jboss-deployment-structure.xml is as follow:
>
> 
> 
> 
>  services="import" meta-inf="import" />
>  services="import" meta-inf="import" />
>
> 
>
>  services="import" meta-inf="import" />
>  export="true" services="import" meta-inf="import" />
>  export="true" services="import" meta-inf="import" />
>
> 
> 
> 
>
> With this setup, no success.
>
>
> Best regards
>
> Drazen Kozic
>
>
> On Fri, May 5, 2017 at 1:32 PM, John D. Ament <johndam...@apache.org>
> wrote:
> > Drazen,
> >
> > Camel CDI uses DeltaSpike Container Control to start and stop a CDI
> > container in conjunction with having an out of the box Main class.  It
> > makes no other use of DeltaSpike.
> >
> > Camel CDI + DeltaSpike work well together, I use them today.  I'm also
> the
> > one who wrote the module.xml's you're looking at right now.
> >
> > I'd rather see this discussed on the DS User list, but can answer the
> > question here as well.
> >
> > Make sure in your jboss-deployment-structure.xml you're referencing the
> > deltaspike modules, include services="import" and meta-inf="import".
> >
> > John
> >
> > On Fri, May 5, 2017 at 7:27 AM Drazen Kozic <kozic.dra...@gmail.com>
> wrote:
> >
> >> Usually, in case od module missconfiguration, CNFE is thrown. Here in
> >> my case, it seems that it is context related issue not classpath
> >> related issue.
> >>
> >> In the documentation of camel-cdi,  DeltaSpike is mentioned here:
> >> http://camel.apache.org/cdi.html. My conclussion is that camel-cdi
> >> should work well in conjuction with DeltaSpike. What is missing is
> >> some instruction how to setup them together on WildFly :-).
> >>
> >> Because both DeltaSpike and camel-cdi are CDI/Weld extensions I cand
> >> say where to search for cause of error. As I mentioned before:
> >> - when DeltaSpike Data Module based service is not called, everything
> >> works fine
> >> - even with DeltaSpike Data Module based service tests are passing
> >> (@RunWith(CamelCdiRunner.class))
> >>
> >>
> >>
> >> Best regards
> >>
> >> Drazen Kozic
> >>
> >>
> >> On Fri, May 5, 2017 at 12:16 PM, Antonin Stefanutti
> >> <anto...@stefanutti.fr> wrote:
> >> > Ah indeed, it looks like DeltaSpike Data module impl JAR is included
> in:
> >> >
> >> >  >> > services="export" />
> >> >
> >> >
> >>
> https://github.com/apache/deltaspike/blob/a82f6ad27486756cc6d80d3a2db1695b779e36be/deltaspike/dist/full/src/main/distribution/modules-module.xml#L25-L26
> >> >
> >> > That being said, it is likely to be an issue at how DeltaSpike
> >> integrates with WildFly module system rather than a Camel issue. SO I
> would
> >> you post a question on the WildFly forum or contact DeltaSpike user
> group.
> >> >
> >> > Let us know what you think.
> >> >
> >> > Antonin
> >> >
> >> >> On 5 May 2017, at 11:35, Drazen Kozic <kozic.dra...@gmail.com>
> wrote:
> >> >>
> >> >> Hello Antonin,
> >> >> Thanks for the help. My assumption also was related to DeltaSpike
> >> >> module configuration. Especially having in mind that tests are
> passing
> >> >> OK.
> >> >> I have downloaded distribution-full-1.7.2.zip of the DeltaSpike.
> >> >> Inside it there are module.xml files for Wildfly. I didn't change
> >> >> anything.
> >> >>
> >> >> Regards
> >> >>
> >> >>
> >> >> Best regards
> >> >>
> >> >> Drazen Kozic
> >> >>
> >> >>
> >> >> On Fri, May 5, 2017 at 10:34 AM, Antonin Stefanutti
> >> >> <anto...@stefanutti.fr> wrote:
> >> >>> Hi Drazen,
> >> >>>
> >> >>> It looks like the
>

Re: Using camel-cdi on Wildfly-10.1

2017-05-05 Thread John D. Ament
Drazen,

Camel CDI uses DeltaSpike Container Control to start and stop a CDI
container in conjunction with having an out of the box Main class.  It
makes no other use of DeltaSpike.

Camel CDI + DeltaSpike work well together, I use them today.  I'm also the
one who wrote the module.xml's you're looking at right now.

I'd rather see this discussed on the DS User list, but can answer the
question here as well.

Make sure in your jboss-deployment-structure.xml you're referencing the
deltaspike modules, include services="import" and meta-inf="import".

John

On Fri, May 5, 2017 at 7:27 AM Drazen Kozic  wrote:

> Usually, in case od module missconfiguration, CNFE is thrown. Here in
> my case, it seems that it is context related issue not classpath
> related issue.
>
> In the documentation of camel-cdi,  DeltaSpike is mentioned here:
> http://camel.apache.org/cdi.html. My conclussion is that camel-cdi
> should work well in conjuction with DeltaSpike. What is missing is
> some instruction how to setup them together on WildFly :-).
>
> Because both DeltaSpike and camel-cdi are CDI/Weld extensions I cand
> say where to search for cause of error. As I mentioned before:
> - when DeltaSpike Data Module based service is not called, everything
> works fine
> - even with DeltaSpike Data Module based service tests are passing
> (@RunWith(CamelCdiRunner.class))
>
>
>
> Best regards
>
> Drazen Kozic
>
>
> On Fri, May 5, 2017 at 12:16 PM, Antonin Stefanutti
>  wrote:
> > Ah indeed, it looks like DeltaSpike Data module impl JAR is included in:
> >
> >  > services="export" />
> >
> >
> https://github.com/apache/deltaspike/blob/a82f6ad27486756cc6d80d3a2db1695b779e36be/deltaspike/dist/full/src/main/distribution/modules-module.xml#L25-L26
> >
> > That being said, it is likely to be an issue at how DeltaSpike
> integrates with WildFly module system rather than a Camel issue. SO I would
> you post a question on the WildFly forum or contact DeltaSpike user group.
> >
> > Let us know what you think.
> >
> > Antonin
> >
> >> On 5 May 2017, at 11:35, Drazen Kozic  wrote:
> >>
> >> Hello Antonin,
> >> Thanks for the help. My assumption also was related to DeltaSpike
> >> module configuration. Especially having in mind that tests are passing
> >> OK.
> >> I have downloaded distribution-full-1.7.2.zip of the DeltaSpike.
> >> Inside it there are module.xml files for Wildfly. I didn't change
> >> anything.
> >>
> >> Regards
> >>
> >>
> >> Best regards
> >>
> >> Drazen Kozic
> >>
> >>
> >> On Fri, May 5, 2017 at 10:34 AM, Antonin Stefanutti
> >>  wrote:
> >>> Hi Drazen,
> >>>
> >>> It looks like the org.apache.deltaspike.data.impl.handler.QueryHandler
> class is not visible from the Camel module you’ve deployed. So it’s rather
> an issue of using Deltaspike data module within the WildFly module system.
> So you may need to add the deltaspike-data-module JARs to your module or
> properly create a module for Deltaspike data module.
> >>>
> >>> Antonin
> >>>
>  On 5 May 2017, at 08:05, Drazen Kozic  wrote:
> 
>  Hello,
> 
>  I want to use Camel 2.18.3 on WildFly-10.1.0.Final. My desired setup
>  is as follow:
>  - to use camel-cdi features
>  - to deploy camel and all third party dependencies as WildFly modules
>  - to deploy my application as war on WildFly with all internal
>  dependencies as jars in web-inf/lib
>  - I do not want to use WilfFly Camel Subsystem from
>  https://github.com/wildfly-extras/wildfly-camel
> 
>  I have deployed camel as module by looking at WildFly Camel Subsystem
>  (wildfly-camel-patch-4.6.0). I took all content starting from
>  modules/system/layers/fuse/org/apache/camel and put it into my Wildfly
>  installation into modules/system/layers/base/org/apache/camel.
> 
>  I have created some routes and processors. Everything went fine untill
>  moment when I modified my processor to trigger one of my services
>  which are using Deltaspike data module functionality. I got this log
>  output:
> 
>  17:27:52,280 INFO
>  [com.mvneco.tebio.batch.common.BatchCamelContextProducer] (MSC service
>  thread 1-5) CamelContext configured: batch-camel-context
>  17:27:52,297 INFO  [com.mvneco.tebio.batch.simple.MySimpleProcessor]
>  (MSC service thread 1-5) Processor constructed: MySimpleProcessor
>  17:27:52,335 INFO  [com.mvneco.tebio.batch.simple.MySimpleRoute] (MSC
>  service thread 1-5) Route configured: MySimpleRoute
>  17:27:52,341 INFO  [org.apache.camel.cdi.CdiCamelExtension] (MSC
>  service thread 1-5) Camel CDI is starting Camel context
>  [batch-camel-context]
>  17:27:52,342 INFO  [org.apache.camel.impl.DefaultCamelContext] (MSC
>  service thread 1-5) Apache Camel 2.18.3 (CamelContext:
>  batch-camel-context) is starting
>  17:27:52,344 INFO
>  

Re: quartz2 component on wildfly 10.1

2016-11-10 Thread John D. Ament
Hi,

Another thing to look at, are you using a common quartz instance that has
job persistence enabled (e.g. a database job store instead of RAMJobStore)?

John

On Thu, Nov 10, 2016 at 7:10 AM Claus Ibsen  wrote:

> Hi
>
> You can maybe use CDI @Produces bean that has a method that produces
> the component
>
> @Produces
> public QuartzComponent myQuartzComponent(CamelContext camelContext) {
> // code here to setup the component
> }
>
> That is more normal way of doing stuff like that with CDI.
>
> However can you show us a bit more where you create that quartz
> component and add to CamelContext? Do you do that from a RouteBuilder
> in the configure method or where?
>
> We had a recent issue with OSGi blueprint where some users did that
> and the component resolver couldnt find the component. Maybe similar
> fix is needed for wildfly-camel / camel-cdi etc.
>
> https://issues.apache.org/jira/browse/CAMEL-10394
>
> On Thu, Nov 10, 2016 at 12:27 PM, freakwave10 
> wrote:
> > Sure:
> >
> > Wildfly 10.1
> > Apache Camel Subsystem: 4.3.0
> >
> > I have no routes defined in the standalone-full.xml of wildfly, so the
> only
> > entry is:
> >
> > 
> >
> > My application is deployed in an ear file using CDI/deltaspike/Quartz2/
> 
> >
> > So I have a quartz scheduler up and running.
> > At the end I want to define my own scheduler configuration just for
> camel.
> > But here I was completely unsuccessful of telling the camel-quartz
> component
> > to use a different quartz.properties.
> >
> > Thanks for your help,
> >
> > Wolfgang
> >
> >
> >
> > --
> > View this message in context:
> http://camel.465427.n5.nabble.com/quartz2-component-on-wildfly-10-1-tp5789975p578.html
> > Sent from the Camel - Users mailing list archive at Nabble.com.
>
>
>
> --
> Claus Ibsen
> -
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2
>


Re: Any good examples of Bean Validation?

2016-08-13 Thread John D. Ament
Brad,

Its not clear from your email whether your confusion is how to use bean
validation or how it integrates with camel.

the integrating with camel part is pretty straight forward.  Assuming that
the input to the segment of the route is a properly annotated bean, then
those bean attributes will be validated. and an exception thrown indicating
validation failed.  What it sounds like your looking for is a way to
validate the bean based on the context you're in.  That works with groups.
You may want to have a group for context 1 and another group for context
2.  Each validation can be applied to a group, with the default being to
use the default group.

John

On Fri, Aug 12, 2016 at 11:31 AM Brad Johnson 
wrote:

> http://camel.apache.org/bean-validation.html
>
>
> The documentation is pretty thin there.  A good code fragment might be
> worth 10,000 words in this case.
>
> While I'm using beanio to unmarshal records into beans I think I'd prefer
> to leave it out of the validation.  There are a couple of reasons for
> that.  The annotations for bean validation might be used in a lot of
> different situations including writing out to a database or file system in
> addition to reading in.  Second the validation mechanics permit optional
> validation rules depending on the situation.
>
> So I'd prefer to just unmarshal and then separately validate.
>
> Probably the most important reason for using the annotations though is that
> it makes it easier for business folks to use for specification of canonical
> data models for the organization.  And that's also where the optional
> annotations for validation become important.  An invoice ID in context 1
> might have to be an integer of X length while in context 2 null might be
> OK.  So this eases that.
>
>
> But I don't have a good working example.
>
> Brad
>


Re: Last minute notice: Camel wedinar and Conference regitration

2016-06-06 Thread John D. Ament
Hi Bilgin,

Typos aside, do you know if tomorrow's wedinar is going to be recorded?  I
have a conflict at that time, but would be highly interested in watching
afterwards.

John

On Mon, Jun 6, 2016 at 11:13 AM Bilgin Ibryam  wrote:

> You can see how excited I'm from the double typo in the subject :)
>
> On 6 June 2016 at 16:06, Bilgin Ibryam  wrote:
> > Hi Camel riders,
> >
> > Nowadas most of the announcements go over twitter, but I wanted to
> > give a heads up about two interesting Camel events that users here
> > might find useful.
> >
> > 1. Tomorrow (7th of June) there is a webinar about Apache Camel [1].
> > I'll be presenting "Design patterns for successful Camel riding" which
> > is based on my recent Camel book. The link for the registration below.
> >
> > 2. Barcelona Java users group is organising a 3 day event next week.
> > If you look at the schedule [2] you will notice that it is kinda small
> > European Camel One Conference. There are many speakers from this list:
> >
> > Charles Moulliard
> > Christian Posta
> > Jean Baptiste Onofre
> > Claus Ibsen
> > Christian Schneider
> > Jakub Korab
> > James Strachan
> > Bilgin Ibryam (that's me)
> >
> > Registration is open for another 2 days (until 8th of June)
> >
> >
> > [1]
> http://app.engage.redhat.com/e/es.aspx?s=1795=875728=9c404d53a515451fa43a000b46af0d64
> >
> > [2] http://www.jbcnconf.com/2016/schedule.html
> >
> > Cheers,
> >
> > --
> > Bilgin Ibryam
> > Camel Committer at ASF & Integration Architect at Red Hat
> > Blog: http://ofbizian.com | Twitter: @bibryam
> >
> > Camel Design Patterns https://leanpub.com/camel-design-patterns
> > Instant Apache Camel Message Routing http://www.amazon.com/dp/1783283475
>
>
>
> --
> Bilgin Ibryam
> Camel Committer at ASF & Integration Architect at Red Hat
> Blog: http://ofbizian.com | Twitter: @bibryam
>
> Camel Design Patterns https://leanpub.com/camel-design-patterns
> Instant Apache Camel Message Routing http://www.amazon.com/dp/1783283475
>


Re: warning while calling Bean ref in camel route

2016-04-28 Thread John D. Ament
You should quote the string when passing it in, e.g.



Then it will be passed in as the second argument as a string.

On Thu, Apr 28, 2016 at 11:48 AM ravi21588  wrote:

> Hi All,
>
> Iam getting below warn when i call the bean ref in camel route
>
>
> 17:44:18,385 WARN  [org.apache.camel.util.ObjectHelper]
> (http-/127.0.0.1:8080-18) Cannot find class: A1_Sync_Con_RQRequestReceived
>
> 
> method="logAuditMessage(${body},A1_Sync_Con_RQ Request Received :)" />
>
>
> Java class:
>
> package com.example.switchyard.a1.sync.consumer.rq;
>
> import javax.enterprise.context.ApplicationScoped;
> import javax.inject.Named;
>
> import org.apache.log4j.Level;
>
> import com.agcs.bih.message.model.v2.BihMessage;
> import com.agcs.bih.message.v2.BIHLogger;
> import com.agcs.bih.message.v2.BihMessageHandler;
>
> @Named("Audit")
> @ApplicationScoped
> public class Audit {
>
> public void logAuditMessage(BihMessage body,String message)
> {
> String Header = BihMessageHandler.prepareBihHeader(body);
> BIHLogger logger=new BIHLogger();
> logger.logBIHAuditMessage(message +
> Header,Level.INFO,"C:\\Logfiles\\Audit.log");
> }
>
> }
>
>
> Can you please tell me what might be issue.
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/warning-while-calling-Bean-ref-in-camel-route-tp5781911.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: CDI.current() with 2.17.0

2016-04-26 Thread John D. Ament
So here's a simple project.  Its working fine when I run it, so if you can
point out whats different about your setup.

https://github.com/johnament/camel-cdi-annotated

John

On Tue, Apr 26, 2016 at 6:34 PM John D. Ament <johndam...@apache.org> wrote:

> Could you provide a bit more context about how you're calling
> CDI.current?  Like maybe the full class or an example class?
>
> I'll try to put together an example to show it working, may be something
> to work through.  I suspect that the bean-discovery-mode=annotated is the
> problem, if you're calling within a static method in SE mode that may not
> resolve properly.
>
> John
>
>
> On Tue, Apr 26, 2016 at 9:21 AM kalber <karlheinz.al...@swslt.com> wrote:
>
>> yes,
>>
>> 
>> http://xmlns.jcp.org/xml/ns/javaee;
>>xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
>>xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
>>
>> http://xmlns.jcp.org/xml/ns/javaee/beans_1_2.xsd;
>>version="1.2" bean-discovery-mode="annotated">
>> 
>>
>>
>>
>> -
>> kh
>> --
>> View this message in context:
>> http://camel.465427.n5.nabble.com/CDI-current-with-2-17-0-tp5781717p5781724.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>


Re: CDI.current() with 2.17.0

2016-04-26 Thread John D. Ament
Could you provide a bit more context about how you're calling CDI.current?
Like maybe the full class or an example class?

I'll try to put together an example to show it working, may be something to
work through.  I suspect that the bean-discovery-mode=annotated is the
problem, if you're calling within a static method in SE mode that may not
resolve properly.

John

On Tue, Apr 26, 2016 at 9:21 AM kalber  wrote:

> yes,
>
> 
> http://xmlns.jcp.org/xml/ns/javaee;
>xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
>xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
>
> http://xmlns.jcp.org/xml/ns/javaee/beans_1_2.xsd;
>version="1.2" bean-discovery-mode="annotated">
> 
>
>
>
> -
> kh
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/CDI-current-with-2-17-0-tp5781717p5781724.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Not seeing query params on REST DSL

2016-04-26 Thread John D. Ament
Technically speaking, you can do this by retrieving the original request
from the exchange's in field and calling the appropriate methods to get the
original query params.

The field can be found here:
https://github.com/apache/camel/blob/master/components/camel-restlet/src/main/java/org/apache/camel/component/restlet/RestletConstants.java#L28

- John

On Tue, Apr 26, 2016 at 7:50 AM Steve Huston <shus...@riverace.com> wrote:

> Ok, so what I'm trying to do won't work at this time?
>
> I've been going through camel-restlet docs trying to get at what Claus was
> surely referring to as a solution ;-)
>
> > -Original Message-----
> > From: John D. Ament [mailto:johndam...@apache.org]
> > Sent: Tuesday, April 26, 2016 7:02 AM
> > To: users@camel.apache.org
> > Subject: Re: Not seeing query params on REST DSL
> >
> > IMHO what Steve's describing is a pretty useful feature.  I created a
> JIRA
> > - https://issues.apache.org/jira/browse/CAMEL-9914
> >
> > I'll try to get to it pretty soon.
> >
> > John
> >
> > On Mon, Apr 25, 2016 at 2:28 PM Claus Ibsen <claus.ib...@gmail.com>
> > wrote:
> >
> > > That is for the api documentation.
> > >
> > > Its the camel-restlet component that does the actual mapping from
> > > restlet to camel exchange/message.
> > >
> > > On Mon, Apr 25, 2016 at 7:59 PM, Steve Huston <shus...@riverace.com>
> > > wrote:
> > > > Ok, what registers the query param if this doesn't?
> > > >
> > > > restConfiguration().component("restlet").port(9000);
> > > > rest("/asset")
> > > >
> > >
> > .put("/{addr}/pong").param().name("id").type(RestParamType.query).endP
> > > aram()
> > > >.to("log:steve?showAll=true")
> > > >.to("mock:result");
> > > >
> > > >> -Original Message-
> > > >> From: John D. Ament [mailto:johndam...@apache.org]
> > > >> Sent: Monday, April 25, 2016 1:52 PM
> > > >> To: users@camel.apache.org
> > > >> Subject: Re: Not seeing query params on REST DSL
> > > >>
> > > >> Apologies as I missed this.
> > > >>
> > > >> As far as I know, you need to explicitly register your query params.
> > > They are
> > > >> not automatically propagated.
> > > >>
> > > >> John
> > > >>
> > > >> On Mon, Apr 25, 2016 at 1:33 PM Steve Huston
> > <shus...@riverace.com>
> > > >> wrote:
> > > >>
> > > >> > On the risk of aggravating people (sorry) popping this up to
> > > >> > today's content... any help is most welcome.
> > > >> >
> > > >> > Thanks!
> > > >> > -Steve
> > > >> >
> > > >> > > -Original Message-
> > > >> > > From: Steve Huston
> > > >> > > Sent: Wednesday, April 20, 2016 8:57 PM
> > > >> > > To: users@camel.apache.org
> > > >> > > Subject: Re: Not seeing query params on REST DSL
> > > >> > >
> > > >> > > I am using Camel 2.16.3 and restlet.
> > > >> > >
> > > >> > > -Steve
> > > >> > >
> > > >> > > > On Apr 20, 2016, at 7:27 PM, John D. Ament
> > > >> <johndam...@apache.org>
> > > >> > > wrote:
> > > >> > > >
> > > >> > > > Steve
> > > >> > > >
> > > >> > > > Could you share your dependencies as well?  Which rest
> > > >> > > > runtime are you using?
> > > >> > > > On Apr 20, 2016 17:12, "Steve Huston" <shus...@riverace.com>
> > > wrote:
> > > >> > > >
> > > >> > > >> I am using the REST DSL in a Camel SCR unit test. I have a
> > > >> > > >> route (being
> > > >> > > >> tested) that will initiate a http request at this URL:
> > > >> > > >>
> > > >> > > >>@Test
> > > >> > > >>public void testRoutes() throws Exception {
> > > >> > > >>context.addRoutes(new RouteBuilder() {
> > > &g

Re: CDI.current() with 2.17.0

2016-04-26 Thread John D. Ament
That should work without a hitch (CDI.current()).

Do you have a beans.xml file in the right location in your camel context?

John

On Tue, Apr 26, 2016 at 8:18 AM kalber  wrote:

> Hi,
>
> i must create 'FileIdempotentRepository' as managed named beans
> programmaticly.
>
>
> For this i tried to use CDI.current().getBeanManager().createBean, but
> CDI.current is null.
>
>
> This are dependencies i set:
>
> org.apache.deltaspike.cdictrl
> deltaspike-cdictrl-weld
> 1.6.0
> 
> 
> org.jboss.weld.se
> weld-se
> 2.3.3.Final
> 
>
> It's possible to use javax.enterprise.inject.spi.CDI ?
>
>
>
>
> -
> kh
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/CDI-current-with-2-17-0-tp5781717.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Not seeing query params on REST DSL

2016-04-26 Thread John D. Ament
IMHO what Steve's describing is a pretty useful feature.  I created a JIRA
- https://issues.apache.org/jira/browse/CAMEL-9914

I'll try to get to it pretty soon.

John

On Mon, Apr 25, 2016 at 2:28 PM Claus Ibsen <claus.ib...@gmail.com> wrote:

> That is for the api documentation.
>
> Its the camel-restlet component that does the actual mapping from
> restlet to camel exchange/message.
>
> On Mon, Apr 25, 2016 at 7:59 PM, Steve Huston <shus...@riverace.com>
> wrote:
> > Ok, what registers the query param if this doesn't?
> >
> > restConfiguration().component("restlet").port(9000);
> > rest("/asset")
> >
> .put("/{addr}/pong").param().name("id").type(RestParamType.query).endParam()
> >.to("log:steve?showAll=true")
> >.to("mock:result");
> >
> >> -Original Message-
> >> From: John D. Ament [mailto:johndam...@apache.org]
> >> Sent: Monday, April 25, 2016 1:52 PM
> >> To: users@camel.apache.org
> >> Subject: Re: Not seeing query params on REST DSL
> >>
> >> Apologies as I missed this.
> >>
> >> As far as I know, you need to explicitly register your query params.
> They are
> >> not automatically propagated.
> >>
> >> John
> >>
> >> On Mon, Apr 25, 2016 at 1:33 PM Steve Huston <shus...@riverace.com>
> >> wrote:
> >>
> >> > On the risk of aggravating people (sorry) popping this up to today's
> >> > content... any help is most welcome.
> >> >
> >> > Thanks!
> >> > -Steve
> >> >
> >> > > -Original Message-
> >> > > From: Steve Huston
> >> > > Sent: Wednesday, April 20, 2016 8:57 PM
> >> > > To: users@camel.apache.org
> >> > > Subject: Re: Not seeing query params on REST DSL
> >> > >
> >> > > I am using Camel 2.16.3 and restlet.
> >> > >
> >> > > -Steve
> >> > >
> >> > > > On Apr 20, 2016, at 7:27 PM, John D. Ament
> >> <johndam...@apache.org>
> >> > > wrote:
> >> > > >
> >> > > > Steve
> >> > > >
> >> > > > Could you share your dependencies as well?  Which rest runtime are
> >> > > > you using?
> >> > > > On Apr 20, 2016 17:12, "Steve Huston" <shus...@riverace.com>
> wrote:
> >> > > >
> >> > > >> I am using the REST DSL in a Camel SCR unit test. I have a route
> >> > > >> (being
> >> > > >> tested) that will initiate a http request at this URL:
> >> > > >>
> >> > > >>@Test
> >> > > >>public void testRoutes() throws Exception {
> >> > > >>context.addRoutes(new RouteBuilder() {
> >> > > >>@Override
> >> > > >>public void configure() throws Exception {
> >> > > >>
> >> > > >> restConfiguration().component("restlet").port(9000);
> >> > > >>rest("/asset")
> >> > > >>.put("/{addr}/pong")
> >> > > >> .param().name("id").type(RestParamType.query).endParam()
> >> > > >>.to("log:steve?showAll=true")
> >> > > >>.to("mock:result");
> >> > > >>}
> >> > > >>});
> >> > > >>
> >> > > >>MockEndpoint resultEndpoint =
> >> > > >> context.getEndpoint("mock:result",
> >> > > >> MockEndpoint.class);
> >> > > >>resultEndpoint.expectedMessageCount(1);
> >> > > >>
> >> > > >>
> >> resultEndpoint.message(0).header("addr").isEqualTo("my_test_value");
> >> > > >>
> >> > > >> resultEndpoint.message(0).header("id").isEqualTo("abcd1234");
> >> > > >>
> >> > > >>
> >> > > >> At run time, the request does arrive as a PUT to
> >> > > >> http://127.0.0.1:9000/asset/my_test_value/pong?id=abcd1234
> >> > > >>
> >> > > >> However, I am only getting the "addr" path parameter in the
> header.
> >> > > >> The query param "id" is missing.
> >> > > >> Am I doing something wrong on the definition? I pieced together
> >> > > >> the way to do it from disparate tidbits on the net.
> >> > > >>
> >> > > >> Thanks,
> >> > > >> -Steve
> >> > > >>
> >> >
> >> >
>
>
>
> --
> Claus Ibsen
> -
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2
>


Re: Not seeing query params on REST DSL

2016-04-25 Thread John D. Ament
Apologies as I missed this.

As far as I know, you need to explicitly register your query params.  They
are not automatically propagated.

John

On Mon, Apr 25, 2016 at 1:33 PM Steve Huston <shus...@riverace.com> wrote:

> On the risk of aggravating people (sorry) popping this up to today's
> content... any help is most welcome.
>
> Thanks!
> -Steve
>
> > -Original Message-
> > From: Steve Huston
> > Sent: Wednesday, April 20, 2016 8:57 PM
> > To: users@camel.apache.org
> > Subject: Re: Not seeing query params on REST DSL
> >
> > I am using Camel 2.16.3 and restlet.
> >
> > -Steve
> >
> > > On Apr 20, 2016, at 7:27 PM, John D. Ament <johndam...@apache.org>
> > wrote:
> > >
> > > Steve
> > >
> > > Could you share your dependencies as well?  Which rest runtime are you
> > > using?
> > > On Apr 20, 2016 17:12, "Steve Huston" <shus...@riverace.com> wrote:
> > >
> > >> I am using the REST DSL in a Camel SCR unit test. I have a route
> > >> (being
> > >> tested) that will initiate a http request at this URL:
> > >>
> > >>@Test
> > >>public void testRoutes() throws Exception {
> > >>context.addRoutes(new RouteBuilder() {
> > >>@Override
> > >>public void configure() throws Exception {
> > >>
> > >> restConfiguration().component("restlet").port(9000);
> > >>rest("/asset")
> > >>.put("/{addr}/pong")
> > >> .param().name("id").type(RestParamType.query).endParam()
> > >>.to("log:steve?showAll=true")
> > >>.to("mock:result");
> > >>}
> > >>});
> > >>
> > >>MockEndpoint resultEndpoint =
> > >> context.getEndpoint("mock:result",
> > >> MockEndpoint.class);
> > >>resultEndpoint.expectedMessageCount(1);
> > >>
> > >> resultEndpoint.message(0).header("addr").isEqualTo("my_test_value");
> > >>resultEndpoint.message(0).header("id").isEqualTo("abcd1234");
> > >>
> > >>
> > >> At run time, the request does arrive as a PUT to
> > >> http://127.0.0.1:9000/asset/my_test_value/pong?id=abcd1234
> > >>
> > >> However, I am only getting the "addr" path parameter in the header.
> > >> The query param "id" is missing.
> > >> Am I doing something wrong on the definition? I pieced together the
> > >> way to do it from disparate tidbits on the net.
> > >>
> > >> Thanks,
> > >> -Steve
> > >>
>
>


Default binding mode for REST

2016-04-25 Thread John D. Ament
I'm not sure if this is a bug or typo or what :-)

I have a simple rest DSL configuration:

restConfiguration()
.component("jetty")
.port(9097)
.bindingMode(RestBindingMode.auto);

If I take out the binding mode, everything is interpretted as an
InputStream.  According to the documentation, this is the expected
behavior: http://camel.apache.org/rest-dsl.html

But then I look at the code, and it appears that the expected default is
auto.  Auto would make a lot more sense.

@XmlAttribute @Metadata(defaultValue = "auto")
private RestBindingMode bindingMode;

So which should be correct in this case?

John


Re: Not seeing query params on REST DSL

2016-04-20 Thread John D. Ament
Steve

Could you share your dependencies as well?  Which rest runtime are you
using?
On Apr 20, 2016 17:12, "Steve Huston"  wrote:

> I am using the REST DSL in a Camel SCR unit test. I have a route (being
> tested) that will initiate a http request at this URL:
>
> @Test
> public void testRoutes() throws Exception {
> context.addRoutes(new RouteBuilder() {
> @Override
> public void configure() throws Exception {
>
> restConfiguration().component("restlet").port(9000);
> rest("/asset")
> .put("/{addr}/pong")
> .param().name("id").type(RestParamType.query).endParam()
> .to("log:steve?showAll=true")
> .to("mock:result");
> }
> });
>
> MockEndpoint resultEndpoint = context.getEndpoint("mock:result",
> MockEndpoint.class);
> resultEndpoint.expectedMessageCount(1);
>
> resultEndpoint.message(0).header("addr").isEqualTo("my_test_value");
> resultEndpoint.message(0).header("id").isEqualTo("abcd1234");
>
>
> At run time, the request does arrive as a PUT to
> http://127.0.0.1:9000/asset/my_test_value/pong?id=abcd1234
>
> However, I am only getting the "addr" path parameter in the header. The
> query param "id" is missing.
> Am I doing something wrong on the definition? I pieced together the way to
> do it from disparate tidbits on the net.
>
> Thanks,
> -Steve
>


Re: database is locked

2016-04-13 Thread John D. Ament
The problem is that both sqlite and h2 are single user databases.  I
suspect whats happening is that the EMF is being created multiple times and
trying to consume multiple connections.  I'll try to see if I can come up
with an example on how to configure this for h2, but I don't have sqlite
local.

John

On Wed, Apr 13, 2016 at 8:22 AM Anton <kurren...@gmail.com> wrote:

> On Wed, Apr 13, 2016 at 12:44 PM, John D. Ament <johndam...@apache.org>
> wrote:
>
> > Just wondering, does this happen the first time the route gets hit or
> > subsequent times?
> >
> Yes, it appears to happen the first time.
>
> >
> > Have you tried providing an explicit EntityManagerFactory bean to the
> > endpoint?
> >
> I havent tried this. But it the error message seems clear, that it is due
> to file being locked.
>


Re: Clarification on how Converters work with CDI

2016-04-13 Thread John D. Ament
The JPA component doesn't do any type conversion (based on code
inspection).  It assumes the object coming in is the right type.  Good
catch on adding the converter to the body.

John

On Wed, Apr 13, 2016 at 7:18 AM Antonin Stefanutti 
wrote:

> Yes, I haven’t checked the code though I guess the JPA component isn’t
> doing the conversion automatically.
>
> Maybe that could be an enhancement to the JPA component.
>
> Antonin
>
> > On 13 Apr 2016, at 13:15, Anton  wrote:
> >
> > When I add the following it works
> > On Wed, Apr 13, 2016 at 1:04 PM, Antonin Stefanutti <
> anto...@stefanutti.fr>
> > wrote:
> >
> >> .convertBodyTo(SupportRequest.class)
> >>
> >
> > And it doesnt when this is not included.
>
>


Re: Clarification on how Converters work with CDI

2016-04-13 Thread John D. Ament
Hi Anton,

Just wondering, what does your deployment look like? Weld? OWB? Versions?
Does your beans.xml use default discovery mode? Is it empty?  Are you using
all?

If you're not sure f these, could you try adding a scope, e.g.
@ApplicationScoped to the converter and try again?

John

On Wed, Apr 13, 2016 at 6:47 AM Anton  wrote:

> Hello
>
> Im trying to use a camel type converter with Camel CDI.
>
> My converter looks like the following:
>
> @Converter
> @SuppressWarnings("all")
> public class TicketConverter {
>
>   @Converter
>   public SupportRequest convertToSupportRequest(final Ticket ticket) {
> SupportRequest sr = new SupportRequest();
> String _subject = ticket.getSubject();
> sr.setName(_subject);
> return sr;
>   }
> }
>
> Then I have the following route:
> public void configure() {
>
> from(ticketEndpoint) // returns a Ticket
> .to("jpa:my.domain.SupportRequest=camel"); // attempt
> to persist SupportRequest
> }
>
> Implicitly Transforming from Ticket to SupportRequest does not seem to
> occur. In the JPA endpoint, it still tries to persist a Ticket object.
>
> How do I tell camel to transform from Ticket to SupportRequest?
>
> Thanks
>


Re: database is locked

2016-04-13 Thread John D. Ament
Hi Anton,

Just wondering, does this happen the first time the route gets hit or
subsequent times?

Have you tried providing an explicit EntityManagerFactory bean to the
endpoint?

John

On Wed, Apr 13, 2016 at 6:24 AM Anton  wrote:

> Hi
>
> I tried changing this from sqlite to h2, and now I get a similar error:
> Caused by: java.lang.IllegalStateException: The file is locked:
> nio:/home/anton/twdb.mv.db [1.4.191/7]
> at org.h2.mvstore.DataUtils.newIllegalStateException(DataUtils.java:773)
> at org.h2.mvstore.FileStore.open(FileStore.java:172)
> at org.h2.mvstore.MVStore.(MVStore.java:342)
> at org.h2.mvstore.MVStore$Builder.open(MVStore.java:2888)
> at org.h2.mvstore.db.MVTableEngine$Store.open(MVTableEngine.java:154)
> ... 125 more
>
> at
>
> org.jboss.weld.bootstrap.events.AbstractDeploymentContainerEvent.fire(AbstractDeploymentContainerEvent.java:37)
> at
>
> org.jboss.weld.bootstrap.events.AfterDeploymentValidationImpl.fire(AfterDeploymentValidationImpl.java:28)
> at org.jboss.weld.bootstrap.WeldStartup.validateBeans(WeldStartup.java:449)
> at
> org.jboss.weld.bootstrap.WeldBootstrap.validateBeans(WeldBootstrap.java:90)
> at org.jboss.weld.environment.se.Weld.initialize(Weld.java:558)
> at
>
> org.apache.deltaspike.cdise.weld.WeldContainerControl.boot(WeldContainerControl.java:68)
> at org.apache.camel.cdi.Main.doStart(Main.java:95)
> at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
> at org.apache.camel.main.MainSupport.run(MainSupport.java:138)
> at org.apache.camel.main.MainSupport.run(MainSupport.java:390)
> at org.apache.camel.cdi.Main.main(Main.java:57)
>
>
> Anyone know why camel is doing this?
>
> On Tue, Apr 12, 2016 at 7:18 PM, Anton  wrote:
>
> > Hello
> >
> > I am trying to use Camel JPA to store entities into a sqlite database.
> >
> >
> > My route looks like this:
> >
> >
> > public void configure() {
> >
> >
> from(zendeskEndpoint).to("jpa:org.zendesk.client.v2.model.Ticket=camel");
> > }
> >
> > However, I am getting the following error:
> >
> > [l-1) thread #0 - zendesk://foo] ZendeskConsumerWARN
> >  Error processing exchange. Exchange[ID-Charles-38935-1460481217959-0-2].
> > Caused by: [javax.persistence.PersistenceException -
> > org.hibernate.exception.GenericJDBCException: error performing isolated
> > work]
> > javax.persistence.PersistenceException:
> > org.hibernate.exception.GenericJDBCException: error performing isolated
> work
> > at
> >
> org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1692)
> > at
> >
> org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1602)
> > at
> >
> org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1608)
> > at
> >
> org.hibernate.jpa.spi.AbstractEntityManagerImpl.merge(AbstractEntityManagerImpl.java:1171)
> > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > at
> >
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> > at
> >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> > at java.lang.reflect.Method.invoke(Method.java:498)
> > at
> >
> org.springframework.orm.jpa.ExtendedEntityManagerCreator$ExtendedEntityManagerInvocationHandler.invoke(ExtendedEntityManagerCreator.java:344)
> > at com.sun.proxy.$Proxy71.merge(Unknown Source)
> > at
> org.apache.camel.component.jpa.JpaProducer$1.save(JpaProducer.java:116)
> > at
> >
> org.apache.camel.component.jpa.JpaProducer$1.doInTransaction(JpaProducer.java:89)
> > at
> >
> org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133)
> > at
> org.apache.camel.component.jpa.JpaProducer.process(JpaProducer.java:62)
> > at
> >
> org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)
> > at
> org.apache.camel.processor.SendProcessor.process(SendProcessor.java:145)
> > at
> >
> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:77)
> > at
> >
> org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:468)
> > at
> >
> org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:190)
> > at
> >
> org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:190)
> > at
> >
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:109)
> > at
> >
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:87)
> > at
> > io.tradeworks.camel.zendesk.ZendeskConsumer.poll(ZendeskConsumer.java:44)
> > at
> >
> org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:175)
> > at
> >
> org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:102)
> > at
> 

AMQP & Artemis

2016-04-11 Thread John D. Ament
Hi,

I was trying to setup the AMQP component to talk to an Artemis server
(1.2.0).  I know that artemis has some support for automatic destination
creation.  I'm not seeing this behavior, is there some special setting I
need to set?

Setup of JMS message listener invoker failed for destination 'incoming' -
trying to recover. Cause: AMQ219010: source address does not exist
[condition = amqp:internal-error]


John


Re: [CAMEL-CDI] What's is the CDI scope for the RouteBuilder?

2016-03-24 Thread John D. Ament
Charlee,

One thing to point out.  If you find that you're adding a lot of routes
based on the same format, you may want to use dynamic URIs instead.

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

John

On Thu, Mar 24, 2016 at 9:26 PM Charlee Chitsuk <charlee...@gmail.com>
wrote:

> Hi Antonin and John,
>
> As you have mentioned, both of RouteBuilder readability and using the Camel
> CDI capability for looking up them automatically is valuable. I've to think
> twice if it is worth to re-factor or not.
>
> Thank you very much for your advise.
>
> --
>Best Regards,
>
>Charlee Ch.
>
> 2016-03-24 19:59 GMT+07:00 Antonin Stefanutti <anto...@stefanutti.fr>:
>
> >
> > > On 24 Mar 2016, at 12:47, Charlee Chitsuk <charlee...@gmail.com>
> wrote:
> > >
> > > My project is based on CDI and Camel-CDI. I've tried to reduce the some
> > of
> > > "similar" RouteBuilder concrete classes by making it to receive the
> > > different parameter, e.g source and destination. I'm not sure if
> > > registering manually is a suitable way or not.
> >
> > In the 'nominal' use cases, you would let the Camel CDI extension do the
> > auto-configuration of your Camel context. However, you can still do some
> > more configuration ‘manually'.
> >
> > In your case, I understand you’ve tried to factorise some route
> > definitions into some sort of templates.
> >
> > For example:
> >
> > if you have two routes:
> > from("direct:in1").routeId("route1").to("direct:out1");
> > from("direct:in2").routeId(“route2").to("direct:out2");
> >
> > You’ve tried to parameterised it to have a single reusable route.
> >
> > IMO, the Camel DSL is so compact that the duplication is so little that
> > it’s not always worth the factorisation effort. And often the readability
> > is better as you don’t have to understand the parametrisation when
> reading
> > the code.
> >
> > Still if you think that is a better approach for you use case, indeed,
> you
> > can declare a RouteBuilder bean @Dependent, having it parameterised
> > depending for example on the InjectionPoint metadata and add these
> > parameterised instances to the Camel context manually.
> >
> > Antonin
> >
> > > --
> > >   Best Regards,
> > >
> > >   Charlee Ch
> > >
> > > 2016-03-24 18:30 GMT+07:00 John D. Ament <johndam...@apache.org>:
> > >
> > >> On Thu, Mar 24, 2016 at 7:29 AM Charlee Chitsuk <charlee...@gmail.com
> >
> > >> wrote:
> > >>
> > >>> Hi Antonin,
> > >>>
> > >>> Thank you very much. This answer my question.
> > >>>
> > >>> Please correct me if I'm wrong. Since it is a @Dependent, I can
> > register
> > >>> the new instance (with different route-id and parameters) to the
> > context
> > >> as
> > >>> much as possible. Cloud you please help to advise further?
> > >>>
> > >>
> > >> Well if you're doing manual registration, then you're not using the
> > Camel
> > >> CDI capability of looking up your route builders automatically.
> > >>
> > >>
> > >>>
> > >>> --
> > >>>   Best Regards,
> > >>>
> > >>>   Charlee Ch.
> > >>>
> > >>> 2016-03-24 15:20 GMT+07:00 Antonin Stefanutti <anto...@stefanutti.fr
> >:
> > >>>
> > >>>> Hi Charlee,
> > >>>>
> > >>>> There is actually no constraint on the scope to declare for the
> > >>>> RouteBuilder beans that are discovered by Camel CDI.
> > >>>>
> > >>>> Camel CDI just gets one instance for each of them at start time and
> > >> adds
> > >>>> this to the Camel context. So that will equally work whether a
> > >>> RouteBuilder
> > >>>> is @Dependent or @AppplicationScoped generally.
> > >>>>
> > >>>> So that’s up to the developer to decide what’s the best scope
> > depending
> > >>> on
> > >>>> its need. Obviously, if the RouteBuilder instance needs to be shared
> > >>>> somehow, then it needs to be @ApplicationScoped.
> > >>>>
> > >>>> I’ll mention that to the documentation if that answers your
> question.
> > >>>>
> > >>>> Antonin
> > >>>>
> > >>>>> On 24 Mar 2016, at 06:49, Charlee Chitsuk <charlee...@gmail.com>
> > >>> wrote:
> > >>>>>
> > >>>>> Hi,
> > >>>>>
> > >>>>>  Regarding to the Camel CDI [1] which mentions that it provides
> > >>>>> the Auto-detecting Camel routes. I would like to know what the CDI
> > >>> scope
> > >>>> of
> > >>>>> that RouteBuilder is. Is it @ApplicationScoped?
> > >>>>>
> > >>>>>
> > >>>>> [1] http://camel.apache.org/cdi.html
> > >>>>>
> > >>>>> --
> > >>>>>  Best Regards,
> > >>>>>
> > >>>>>  Charlee Ch.
> > >>>>
> > >>>>
> > >>>
> > >>
> >
> >
>


Re: [CAMEL-CDI] What's is the CDI scope for the RouteBuilder?

2016-03-24 Thread John D. Ament
On Thu, Mar 24, 2016 at 7:29 AM Charlee Chitsuk 
wrote:

> Hi Antonin,
>
> Thank you very much. This answer my question.
>
> Please correct me if I'm wrong. Since it is a @Dependent, I can register
> the new instance (with different route-id and parameters) to the context as
> much as possible. Cloud you please help to advise further?
>

Well if you're doing manual registration, then you're not using the Camel
CDI capability of looking up your route builders automatically.


>
> --
>Best Regards,
>
>Charlee Ch.
>
> 2016-03-24 15:20 GMT+07:00 Antonin Stefanutti :
>
> > Hi Charlee,
> >
> > There is actually no constraint on the scope to declare for the
> > RouteBuilder beans that are discovered by Camel CDI.
> >
> > Camel CDI just gets one instance for each of them at start time and adds
> > this to the Camel context. So that will equally work whether a
> RouteBuilder
> > is @Dependent or @AppplicationScoped generally.
> >
> > So that’s up to the developer to decide what’s the best scope depending
> on
> > its need. Obviously, if the RouteBuilder instance needs to be shared
> > somehow, then it needs to be @ApplicationScoped.
> >
> > I’ll mention that to the documentation if that answers your question.
> >
> > Antonin
> >
> > > On 24 Mar 2016, at 06:49, Charlee Chitsuk 
> wrote:
> > >
> > > Hi,
> > >
> > >   Regarding to the Camel CDI [1] which mentions that it provides
> > > the Auto-detecting Camel routes. I would like to know what the CDI
> scope
> > of
> > > that RouteBuilder is. Is it @ApplicationScoped?
> > >
> > >
> > > [1] http://camel.apache.org/cdi.html
> > >
> > > --
> > >   Best Regards,
> > >
> > >   Charlee Ch.
> >
> >
>


Approaches for distribution of messages in a queue

2016-02-29 Thread John D. Ament
Hi,

I was wondering about opinions from others on approaches.

My requirement at a very high level, is to provide a REST API for pulling
messages from a queue in bulk, and at a later point (usually within a
minute or two) acknowledging that message.  REST is a preferred approach
since the data can be transferred over HTTP and we can provide our own API
contract (independent of backing queue).

The only area where we're struggling is in the message acknowledgement.
We're in a distributed environment, many of these REST services are
running.  The request to pull in messages may be performed on one node, but
the acknowledgement happens on a different node.  I was wondering if there
were any patterns that might demonstrate this behavior.  I don't
particularly see any clustering within camel, so not sure if there's a
distribution approach to leverage.

John


Re: Why can't I use swagger java with spark rest?

2016-02-27 Thread John D. Ament
Ok, I figured out whats going on.  I'm using gradle to build and didn't
have it configured for local repo, only maven central and apache
snapshots.  The latest 2.17 camel snapshot is from November.  Locally a
full build fails for me on this:

[WARNING] Error initializing:
org.codehaus.plexus.velocity.DefaultVelocityComponent@6b180b20

java.lang.NoClassDefFoundError: org/apache/velocity/util/ClassUtils

at
org.apache.velocity.runtime.RuntimeInstance.initializeResourceManager(RuntimeInstance.java:572)

at
org.apache.velocity.runtime.RuntimeInstance.init(RuntimeInstance.java:241)

at org.apache.velocity.app.VelocityEngine.init(VelocityEngine.java:116)

at
org.codehaus.plexus.velocity.DefaultVelocityComponent.initialize(DefaultVelocityComponent.java:95)

at
org.eclipse.sisu.plexus.PlexusLifecycleManager.initialize(PlexusLifecycleManager.java:303)

at
org.eclipse.sisu.plexus.PlexusLifecycleManager.activate(PlexusLifecycleManager.java:207)

at
org.eclipse.sisu.bean.BeanScheduler$Pending.activate(BeanScheduler.java:156)

at
org.eclipse.sisu.bean.BeanScheduler$Activator.onProvision(BeanScheduler.java:185)

at
com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:126)

at
com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:68)

at
com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:63)

at
com.google.inject.internal.InternalFactoryToInitializableAdapter.get(InternalFactoryToInitializableAdapter.java:45)

at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:1016)

at
com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092)

at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1012)

at org.eclipse.sisu.inject.Guice4$1.get(Guice4.java:162)

at org.eclipse.sisu.inject.LazyBeanEntry.getValue(LazyBeanEntry.java:81)

at org.eclipse.sisu.plexus.LazyPlexusBean.getValue(LazyPlexusBean.java:51)

at
org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:263)

at
org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:255)

at
org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfiguredMojo(DefaultMavenPluginManager.java:517)

at
org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:121)

at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)

at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)

at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)

at
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)

at
org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call(MultiThreadedBuilder.java:185)

at
org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call(MultiThreadedBuilder.java:181)

at java.util.concurrent.FutureTask.run(FutureTask.java:266)

at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)

at java.util.concurrent.FutureTask.run(FutureTask.java:266)

at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

at java.lang.Thread.run(Thread.java:745)

Caused by: java.lang.ClassNotFoundException:
org.apache.velocity.util.ClassUtils

at
org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)

at
org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:271)

at
org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:247)

at
org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:239)

... 34 more


Which strikes me as a maven bug/error.  I'm using Maven 3.3.9.  But even
then, it looks like CI has been failing for a long time.  Doing a forceful
rebuild locally and pointing to my local fixes the issue w/ undertow.


John

On Sat, Feb 27, 2016 at 11:03 AM John D. Ament <johndam...@apache.org>
wrote:

> Yeah hmmm, the project I'm playing with is using gradle.  My setup and the
> undertow setup seem to match perfectly, so not sure what the difference
> is.  Will continue to debug.
>
> John
>
> On Sat, Feb 27, 2016 at 10:35 AM Claus Ibsen <claus.ib...@gmail.com>
> wrote:
>
>> I changed the camel-example-swagger-cdi to use undertow, so we use
>> different ones in our example.
>> It works fine.
>>
>> You can play with this example and use the other components. Mind some
>> are only available in Camel 2.17.
>>
>> On Sat, Feb 27, 2016 at 2:46 PM, John D. Ament <john.d.am...@gmail.com>
>> wrote:
>> > Its probably worth also listing out which components support swagger
>> here:
>>

Re: Why can't I use swagger java with spark rest?

2016-02-27 Thread John D. Ament
Yeah hmmm, the project I'm playing with is using gradle.  My setup and the
undertow setup seem to match perfectly, so not sure what the difference
is.  Will continue to debug.

John

On Sat, Feb 27, 2016 at 10:35 AM Claus Ibsen <claus.ib...@gmail.com> wrote:

> I changed the camel-example-swagger-cdi to use undertow, so we use
> different ones in our example.
> It works fine.
>
> You can play with this example and use the other components. Mind some
> are only available in Camel 2.17.
>
> On Sat, Feb 27, 2016 at 2:46 PM, John D. Ament <john.d.am...@gmail.com>
> wrote:
> > Its probably worth also listing out which components support swagger
> here:
> > http://camel.apache.org/rest-dsl.html
> >
> > Some observations I had:
> >
> > - Undertow doesn't throw the error, but the swagger.json file isn't
> > available.
> > - Jetty throws this exception as well
> > - Restlet gives a NoClassDefFoundError, but I suspect its a bad
> dependency
> > in the chain somewhere.
> >
> > I haven't tried servlet yet, since I'm targeting a containerless
> deployment
> > (wasn't sure if it worked with Tomcat embedded).
> >
> > John
> >
> > On Sat, Feb 27, 2016 at 7:50 AM Claus Ibsen <claus.ib...@gmail.com>
> wrote:
> >
> >> Hi
> >>
> >> I have logged a ticket and work on implement this.
> >> https://issues.apache.org/jira/browse/CAMEL-9652
> >>
> >> On Sat, Feb 27, 2016 at 7:27 AM, Claus Ibsen <claus.ib...@gmail.com>
> >> wrote:
> >> > Hi
> >> >
> >> > I dont think we have implemented it for it, you are welcome to log a
> JIRA
> >> > http://camel.apache.org/support.html
> >> >
> >> > On Sat, Feb 27, 2016 at 2:12 AM, John D. Ament <johndam...@apache.org
> >
> >> wrote:
> >> >> I'm really interested in using Camel's REST DSL and Swagger to
> provide
> >> >> documentation on my API routes.  I was hoping to use spark as well,
> but
> >> I
> >> >> can't seem to get it to run.  I receive this error
> >> >>
> >> >> java.lang.IllegalArgumentException: Component spark-rest is not a
> >> >> RestApiConsumerFactory
> >> >> at
> >> >>
> >>
> org.apache.camel.component.rest.RestApiEndpoint.createConsumer(RestApiEndpoint.java:223)
> >> >> at
> >> >>
> >>
> org.apache.camel.impl.EventDrivenConsumerRoute.addServices(EventDrivenConsumerRoute.java:68)
> >> >> at
> >> >>
> >>
> org.apache.camel.impl.DefaultRoute.onStartingServices(DefaultRoute.java:98)
> >> >> at org.apache.camel.impl.RouteService.warmUp(RouteService.java:158)
> >> >> at
> >> >>
> >>
> org.apache.camel.impl.DefaultCamelContext.doWarmUpRoutes(DefaultCamelContext.java:3453)
> >> >> at
> >> >>
> >>
> org.apache.camel.impl.DefaultCamelContext.safelyStartRouteServices(DefaultCamelContext.java:3383)
> >> >> at
> >> >>
> >>
> org.apache.camel.impl.DefaultCamelContext.doStartOrResumeRoutes(DefaultCamelContext.java:3160)
> >> >> at
> >> >>
> >>
> org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:3016)
> >> >> at
> >> >>
> >>
> org.apache.camel.impl.DefaultCamelContext.access$000(DefaultCamelContext.java:175)
> >> >> at
> >> >>
> >>
> org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:2812)
> >> >> at
> >> >>
> >>
> org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:2808)
> >> >> at
> >> >>
> >>
> org.apache.camel.impl.DefaultCamelContext.doWithDefinedClassLoader(DefaultCamelContext.java:2831)
> >> >> at
> >> >>
> >>
> org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:2808)
> >> >> at
> org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
> >> >>
> >> >> My thought is that this implies that there's something not supported
> >> >> between the two.  Is that accurate?
> >> >>
> >> >> John
> >> >
> >> >
> >> >
> >> > --
> >> > Claus Ibsen
> >> > -
> >> > http://davsclaus.com @davsclaus
> >> > Camel in Action 2: https://www.manning.com/ibsen2
> >>
> >>
> >>
> >> --
> >> Claus Ibsen
> >> -
> >> http://davsclaus.com @davsclaus
> >> Camel in Action 2: https://www.manning.com/ibsen2
> >>
>
>
>
> --
> Claus Ibsen
> -
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2
>


Re: Why can't I use swagger java with spark rest?

2016-02-27 Thread John D. Ament
Its probably worth also listing out which components support swagger here:
http://camel.apache.org/rest-dsl.html

Some observations I had:

- Undertow doesn't throw the error, but the swagger.json file isn't
available.
- Jetty throws this exception as well
- Restlet gives a NoClassDefFoundError, but I suspect its a bad dependency
in the chain somewhere.

I haven't tried servlet yet, since I'm targeting a containerless deployment
(wasn't sure if it worked with Tomcat embedded).

John

On Sat, Feb 27, 2016 at 7:50 AM Claus Ibsen <claus.ib...@gmail.com> wrote:

> Hi
>
> I have logged a ticket and work on implement this.
> https://issues.apache.org/jira/browse/CAMEL-9652
>
> On Sat, Feb 27, 2016 at 7:27 AM, Claus Ibsen <claus.ib...@gmail.com>
> wrote:
> > Hi
> >
> > I dont think we have implemented it for it, you are welcome to log a JIRA
> > http://camel.apache.org/support.html
> >
> > On Sat, Feb 27, 2016 at 2:12 AM, John D. Ament <johndam...@apache.org>
> wrote:
> >> I'm really interested in using Camel's REST DSL and Swagger to provide
> >> documentation on my API routes.  I was hoping to use spark as well, but
> I
> >> can't seem to get it to run.  I receive this error
> >>
> >> java.lang.IllegalArgumentException: Component spark-rest is not a
> >> RestApiConsumerFactory
> >> at
> >>
> org.apache.camel.component.rest.RestApiEndpoint.createConsumer(RestApiEndpoint.java:223)
> >> at
> >>
> org.apache.camel.impl.EventDrivenConsumerRoute.addServices(EventDrivenConsumerRoute.java:68)
> >> at
> >>
> org.apache.camel.impl.DefaultRoute.onStartingServices(DefaultRoute.java:98)
> >> at org.apache.camel.impl.RouteService.warmUp(RouteService.java:158)
> >> at
> >>
> org.apache.camel.impl.DefaultCamelContext.doWarmUpRoutes(DefaultCamelContext.java:3453)
> >> at
> >>
> org.apache.camel.impl.DefaultCamelContext.safelyStartRouteServices(DefaultCamelContext.java:3383)
> >> at
> >>
> org.apache.camel.impl.DefaultCamelContext.doStartOrResumeRoutes(DefaultCamelContext.java:3160)
> >> at
> >>
> org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:3016)
> >> at
> >>
> org.apache.camel.impl.DefaultCamelContext.access$000(DefaultCamelContext.java:175)
> >> at
> >>
> org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:2812)
> >> at
> >>
> org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:2808)
> >> at
> >>
> org.apache.camel.impl.DefaultCamelContext.doWithDefinedClassLoader(DefaultCamelContext.java:2831)
> >> at
> >>
> org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:2808)
> >> at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
> >>
> >> My thought is that this implies that there's something not supported
> >> between the two.  Is that accurate?
> >>
> >> John
> >
> >
> >
> > --
> > Claus Ibsen
> > -
> > http://davsclaus.com @davsclaus
> > Camel in Action 2: https://www.manning.com/ibsen2
>
>
>
> --
> Claus Ibsen
> -
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2
>


Re: Why can't I use swagger java with spark rest?

2016-02-27 Thread John D. Ament
Its probably worth also listing out which components support swagger here:
http://camel.apache.org/rest-dsl.html

Some observations I had:

- Undertow doesn't throw the error, but the swagger.json file isn't
available.
- Jetty throws this exception as well
- Restlet gives a NoClassDefFoundError, but I suspect its a bad dependency
in the chain somewhere.

I haven't tried servlet yet, since I'm targeting a containerless deployment
(wasn't sure if it worked with Tomcat embedded).

John

On Sat, Feb 27, 2016 at 7:50 AM Claus Ibsen <claus.ib...@gmail.com> wrote:

> Hi
>
> I have logged a ticket and work on implement this.
> https://issues.apache.org/jira/browse/CAMEL-9652
>
> On Sat, Feb 27, 2016 at 7:27 AM, Claus Ibsen <claus.ib...@gmail.com>
> wrote:
> > Hi
> >
> > I dont think we have implemented it for it, you are welcome to log a JIRA
> > http://camel.apache.org/support.html
> >
> > On Sat, Feb 27, 2016 at 2:12 AM, John D. Ament <johndam...@apache.org>
> wrote:
> >> I'm really interested in using Camel's REST DSL and Swagger to provide
> >> documentation on my API routes.  I was hoping to use spark as well, but
> I
> >> can't seem to get it to run.  I receive this error
> >>
> >> java.lang.IllegalArgumentException: Component spark-rest is not a
> >> RestApiConsumerFactory
> >> at
> >>
> org.apache.camel.component.rest.RestApiEndpoint.createConsumer(RestApiEndpoint.java:223)
> >> at
> >>
> org.apache.camel.impl.EventDrivenConsumerRoute.addServices(EventDrivenConsumerRoute.java:68)
> >> at
> >>
> org.apache.camel.impl.DefaultRoute.onStartingServices(DefaultRoute.java:98)
> >> at org.apache.camel.impl.RouteService.warmUp(RouteService.java:158)
> >> at
> >>
> org.apache.camel.impl.DefaultCamelContext.doWarmUpRoutes(DefaultCamelContext.java:3453)
> >> at
> >>
> org.apache.camel.impl.DefaultCamelContext.safelyStartRouteServices(DefaultCamelContext.java:3383)
> >> at
> >>
> org.apache.camel.impl.DefaultCamelContext.doStartOrResumeRoutes(DefaultCamelContext.java:3160)
> >> at
> >>
> org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:3016)
> >> at
> >>
> org.apache.camel.impl.DefaultCamelContext.access$000(DefaultCamelContext.java:175)
> >> at
> >>
> org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:2812)
> >> at
> >>
> org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:2808)
> >> at
> >>
> org.apache.camel.impl.DefaultCamelContext.doWithDefinedClassLoader(DefaultCamelContext.java:2831)
> >> at
> >>
> org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:2808)
> >> at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
> >>
> >> My thought is that this implies that there's something not supported
> >> between the two.  Is that accurate?
> >>
> >> John
> >
> >
> >
> > --
> > Claus Ibsen
> > -
> > http://davsclaus.com @davsclaus
> > Camel in Action 2: https://www.manning.com/ibsen2
>
>
>
> --
> Claus Ibsen
> -
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2
>


Why can't I use swagger java with spark rest?

2016-02-26 Thread John D. Ament
I'm really interested in using Camel's REST DSL and Swagger to provide
documentation on my API routes.  I was hoping to use spark as well, but I
can't seem to get it to run.  I receive this error

java.lang.IllegalArgumentException: Component spark-rest is not a
RestApiConsumerFactory
at
org.apache.camel.component.rest.RestApiEndpoint.createConsumer(RestApiEndpoint.java:223)
at
org.apache.camel.impl.EventDrivenConsumerRoute.addServices(EventDrivenConsumerRoute.java:68)
at
org.apache.camel.impl.DefaultRoute.onStartingServices(DefaultRoute.java:98)
at org.apache.camel.impl.RouteService.warmUp(RouteService.java:158)
at
org.apache.camel.impl.DefaultCamelContext.doWarmUpRoutes(DefaultCamelContext.java:3453)
at
org.apache.camel.impl.DefaultCamelContext.safelyStartRouteServices(DefaultCamelContext.java:3383)
at
org.apache.camel.impl.DefaultCamelContext.doStartOrResumeRoutes(DefaultCamelContext.java:3160)
at
org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:3016)
at
org.apache.camel.impl.DefaultCamelContext.access$000(DefaultCamelContext.java:175)
at
org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:2812)
at
org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:2808)
at
org.apache.camel.impl.DefaultCamelContext.doWithDefinedClassLoader(DefaultCamelContext.java:2831)
at
org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:2808)
at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)

My thought is that this implies that there's something not supported
between the two.  Is that accurate?

John


Re: IronMQ support?

2016-02-26 Thread John D. Ament
Hi Preben,

That would be awesome.  I created this ticket as well ->
https://issues.apache.org/jira/browse/CAMEL-9648

I did take a look at your code (since it pops up when you search for camel
ironmq in the google :-) and the code looks fine from a donation standpoint
(from a very high level ASF standpoint, its likely that theres a checkstyle
issue in there).  I saw you had a question about BSD license, which ASF
products can declare dependencies on so no issues there.  The only problem
would come in with source code directly adapted from a BSD licensed code
base in a non-trivial way (for example, if they say "this is how you
instantiate the Iron MQ client" and you do that, its not a violation of the
BSD license).

John

On Fri, Feb 26, 2016 at 2:54 AM Preben.Asmussen  wrote:

> Hi
>
> The code should be ready. I was just waiting to see if there would be any
> need for such a component.
> I will try to do a PR in the coming days, so the component can get a proper
> home.
>
> Best,
> Preben
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/IronMQ-support-tp5778300p5778309.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


IronMQ support?

2016-02-25 Thread John D. Ament
All,

I was wondering what the status of Iron MQ support was?

I saw this thread from mid last year about a possible donation, but it
doesn't seem like it ever came to fruition?

http://mail-archives.apache.org/mod_mbox/camel-dev/201505.mbox/%3c1431160610135-5766898.p...@n5.nabble.com%3E

Looking briefly at the code in the repo and the dependencies, I don't see
any issues from a licensing stand point, so just wondering what happened?

John


Right component for ActiveMQ Artemis

2016-02-24 Thread John D. Ament
All,

I was wondering, whats the right component to use if I'm connecting to an
ActiveMQ Artemis server?  Artemis supports the standard AMQP protocol, can
I just use activemq component to connect?

John


Sequencing of messages

2016-02-24 Thread John D. Ament
Hey guys

I've got an odd ball question, just to see if anyones tried it.  Suppose
that I'm writing messages to SQS, where there is no guaranteed ordering.
One of the patterns proposed is to follow a resequencer -
http://camel.apache.org/resequencer.html to enforce message sequence number
ordering.  I see two problems with this.

1. Single point of failure.  If the node that is writing the number goes
down, the sequence numbers are lost.  Are there any distributed options for
camel to apply sequence numbers from a cluster of producers?

2. I need to fetch all of the messages.  In order to verify gaps, I need
all messages to be readily available.  This could be quite large on bigger
queues.  It seems that streaming would be an option, but would almost
require my first point.

Any thoughts?

Thanks!

John


Re: CDI Injection support

2016-02-23 Thread John D. Ament
Hi Antonin,

Looks like you pushed up already what I was working on (when I found this
issue): https://issues.apache.org/jira/browse/CAMEL-9630
I'll move that over to you.

Thanks!

John

On Tue, Feb 23, 2016 at 9:00 AM Antonin Stefanutti <anto...@stefanutti.fr>
wrote:

> Hi John,
>
> For #1, I’ve just pushed [1] to improve the support for programmatic
> lookup of Camel resources.
>
> For #2, I’ve opened issue OWB-1122 [2] in OpenWebBeans JIRA.
>
> At that occasion, I've refactored a bit the qualifier literals for
> @ContextName and @Uri in order to match the style of those that will be
> provided in CDI 2.0 [3].
>
> [1]:
> https://github.com/apache/camel/commit/93631c85f4250b3843a7ada987c99aeed909a11d
> [2]: https://issues.apache.org/jira/browse/OWB-1122
> [3]: https://issues.jboss.org/browse/CDI-485
>
> Do not hesitate if you any have other points.
>
> Thanks,
> Antonin
>
> > On 22 Feb 2016, at 17:44, Antonin Stefanutti <anto...@stefanutti.fr>
> wrote:
> >
> > It returns the qualifiers for the Instance injection point declaration,
> not the ones added with select programmatically! I’ve tested it with OWB
> version 1.6.2.
> >
> > Weld returns the complete set of qualifiers as opposed to OWB.
> >
> >> On 22 Feb 2016, at 17:36, John D. Ament <johndam...@apache.org> wrote:
> >>
> >> Hi Antonin!
> >>
> >> For #2, that's weird.  What do you see in the output?
> >>
> >> John
> >> On Feb 22, 2016 11:24, "Antonin Stefanutti" <anto...@stefanutti.fr>
> wrote:
> >>
> >>> Hi John,
> >>>
> >>> Good to hear from you here! Thanks for the thorough testing, that’s a
> good
> >>> catch.
> >>>
> >>> So I’ve looked into it and apparently the problem is two folds:
> >>> - The implementations do not assume the @Any qualifier by default for
> >>> programmatic lookup as they do for static injection.
> >>> - OpenWebBeans does not return the correct set of refined qualifiers
> when
> >>> calling InjectionPoint.getQualifiers in producer methods for Instance
> with
> >>> selected qualifiers.
> >>>
> >>> I have a fix for the former. I’ll polish it a bit and commit it ASAP.
> For
> >>> the later, I’ll report an issue in OWB JIRA and reactivate the test
> case
> >>> once it gets fixed.
> >>>
> >>> Antonin
> >>>
> >>>> On 22 Feb 2016, at 13:40, John D. Ament <johndam...@apache.org>
> wrote:
> >>>>
> >>>> Hi all,
> >>>>
> >>>> I was looking at the changes that went into Camel 2.17 with CDI
> injection
> >>>> support.  It seems that injection support doesn't work consistently
> when
> >>>> done not using an annotated member.
> >>>>
> >>>> I tried a few different ways:
> >>>>
> >>>> @Inject
> >>>> @Any
> >>>> private Instance endpointInstance;
> >>>>
> >>>> ...
> >>>>
> >>>> endpointInstance.select(MockEndpoint.class, new
> >>>> UriLiteral("mock:outgoing")).get()
> >>>>
> >>>> Which consistently gives back (in Weld 1.1.x, 2.x, OWB 1.2.x and OWB
> >>> 1.6.x)
> >>>> an error that no beans are defined, even though I have that endpoint
> >>>> defined.
> >>>>
> >>>> Now, if I try the CDI 1.1 way of using the utility class to look up
> the
> >>>> instance, it works fine in Weld 2.x but not OWB 1.6.x.  As far as I
> know,
> >>>> this setup should work in both, and since I know I use pattern in
> other
> >>>> apps I don't think its a case of a bug in the impl.  I was wondering
> if
> >>> any
> >>>> camel gurus could comment on it?
> >>>>
> >>>>
> >>>
> https://github.com/johnament/camel/commit/05dd5f6f8cda541fedfc68c6f199e014defe3f09
> >>>>
> >>>> John
> >>>
> >>>
> >
>
>


Re: Camel Header

2016-02-23 Thread John D. Ament
No, I mean the the storage mechanism behind it.  Exchanges (and their
messages) are in memory models.  When a message is delivered to an
endpoint, the endpoint figures out what to do with it.  That delivery is
essentially your storage mechanism.  You might be delivering data to a
mysql table, or a mongodb collection.  You'll need to map the message into
those structures.

John

On Mon, Feb 22, 2016 at 10:56 PM Demon Hunter <
claire.chanm...@newgens.com.sg> wrote:

> u mean data type i wanna store in camel header?it's string type.
>
> For example, The message I want to store in one header is about 9KB data
> which i want to store in camel header.
>
> header name :MyCamelHeader
> value : that 9kb message.
>
> Thanks
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-Header-tp5778080p5778083.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Camel Header

2016-02-22 Thread John D. Ament
The storage of headers is completely up to whatever component you're using
to store the data.  What type of component are you using?

John

On Mon, Feb 22, 2016 at 10:39 PM Demon Hunter <
claire.chanm...@newgens.com.sg> wrote:

> Hi,
>
> I would like to know how large data camel header can store? because i'm
> facing difficult to store large data to store camel header.
>
> any pointer should be appreciated.
>
> Thanks
> Crusader
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-Header-tp5778080.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: CDI Injection support

2016-02-22 Thread John D. Ament
Hi Antonin!

For #2, that's weird.  What do you see in the output?

John
On Feb 22, 2016 11:24, "Antonin Stefanutti" <anto...@stefanutti.fr> wrote:

> Hi John,
>
> Good to hear from you here! Thanks for the thorough testing, that’s a good
> catch.
>
> So I’ve looked into it and apparently the problem is two folds:
> - The implementations do not assume the @Any qualifier by default for
> programmatic lookup as they do for static injection.
> - OpenWebBeans does not return the correct set of refined qualifiers when
> calling InjectionPoint.getQualifiers in producer methods for Instance with
> selected qualifiers.
>
> I have a fix for the former. I’ll polish it a bit and commit it ASAP. For
> the later, I’ll report an issue in OWB JIRA and reactivate the test case
> once it gets fixed.
>
> Antonin
>
> > On 22 Feb 2016, at 13:40, John D. Ament <johndam...@apache.org> wrote:
> >
> > Hi all,
> >
> > I was looking at the changes that went into Camel 2.17 with CDI injection
> > support.  It seems that injection support doesn't work consistently when
> > done not using an annotated member.
> >
> > I tried a few different ways:
> >
> > @Inject
> > @Any
> > private Instance endpointInstance;
> >
> > ...
> >
> > endpointInstance.select(MockEndpoint.class, new
> > UriLiteral("mock:outgoing")).get()
> >
> > Which consistently gives back (in Weld 1.1.x, 2.x, OWB 1.2.x and OWB
> 1.6.x)
> > an error that no beans are defined, even though I have that endpoint
> > defined.
> >
> > Now, if I try the CDI 1.1 way of using the utility class to look up the
> > instance, it works fine in Weld 2.x but not OWB 1.6.x.  As far as I know,
> > this setup should work in both, and since I know I use pattern in other
> > apps I don't think its a case of a bug in the impl.  I was wondering if
> any
> > camel gurus could comment on it?
> >
> >
> https://github.com/johnament/camel/commit/05dd5f6f8cda541fedfc68c6f199e014defe3f09
> >
> > John
>
>


CDI Injection support

2016-02-22 Thread John D. Ament
Hi all,

I was looking at the changes that went into Camel 2.17 with CDI injection
support.  It seems that injection support doesn't work consistently when
done not using an annotated member.

I tried a few different ways:

@Inject
@Any
private Instance endpointInstance;

...

endpointInstance.select(MockEndpoint.class, new
UriLiteral("mock:outgoing")).get()

Which consistently gives back (in Weld 1.1.x, 2.x, OWB 1.2.x and OWB 1.6.x)
an error that no beans are defined, even though I have that endpoint
defined.

Now, if I try the CDI 1.1 way of using the utility class to look up the
instance, it works fine in Weld 2.x but not OWB 1.6.x.  As far as I know,
this setup should work in both, and since I know I use pattern in other
apps I don't think its a case of a bug in the impl.  I was wondering if any
camel gurus could comment on it?

https://github.com/johnament/camel/commit/05dd5f6f8cda541fedfc68c6f199e014defe3f09

John


Re: Camel - Quartz2

2016-02-18 Thread John D. Ament
Did you receive an error when you did this?  What container are you
deploying to?

On Thu, Feb 18, 2016 at 12:54 PM dpravin  wrote:

> I am using Quartz2 component for scheduling a route in blueprint. I want to
> to inject a datasource to Quartz bean. I tried with following two different
> options, however it did not worked.
>
>  class="org.apache.camel.component.quartz2.QuartzComponent">
> 
>
>
>  value="jdbc/postgresqlds"/>
>
> 
> 
> 
>
> Appreciate if some thoughts/inputs to resolve this.
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-Quartz2-tp5777870.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


AWS Kinesis Support

2016-02-11 Thread John D. Ament
Hey guys

Just wanted to get a couple of points of clarification.  I'm interested in
using Camel + Kinesis.  According to this page
http://camel.apache.org/aws-kinesis.html it says that Kinesis was supported
as of Camel 2.7.  I doubt this to be true.

In addition, I was wondering if there was any plan to support writing to
Kinesis?  I couldn't find anything, including the creation of the Kinesis
component, in JIRA.

John


Proper way to override DefaultShutdownStrategy

2014-05-01 Thread John D. Ament
Hi all,

I was looking for a way to have a shutdown callback.  I overrode the
doShutdown method of DefaultShutdownStrategy, thinking it would be called
for shutdown of the camel context.  Turns out that it's being called as a
part of the shutdown for each route as well.

Is there a more appropriate way to shutdown, but only when the context is
being shutdown, rather than the routes?

I'm using Camel 2.10.6.

John


Re: camel for short programs

2013-12-15 Thread John D. Ament
Romain,

What do you mean?

On Sat, Dec 14, 2013 at 4:00 PM, Romain Manni-Bucau
rmannibu...@gmail.com wrote:
 Hmm, so if I understand you camel will not solve it. I find it sad cause
 camel pipeline and the numerous components are 2 tempting things for
 batches but the fact to be able to process what is here when starting and
 dont wait another messge is no more is present is mandatory to be usable.

 I know it is hackable but I dont think it is clean if not in camel itself.
 Context should get an option propagated to consumer for it imo.
 Le 14 déc. 2013 16:32, kraythe . kray...@gmail.com a écrit :

 Indeed. Though you could use it to start up and shut down, nothing stopping
 you. I would not opt for that choice if I had some sort of deployment
 system where I could keep the routes running.

 *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
 http://www.linkedin.com/pub/robert-simmons/40/852/a39*


 On Sat, Dec 14, 2013 at 9:09 AM, John D. Ament john.d.am...@gmail.com
 wrote:

  Why not use a polling consumer?
 
  On Sat, Dec 14, 2013 at 6:25 AM, Romain Manni-Bucau
  rmannibu...@gmail.com wrote:
   Hi
  
   any opinion on how to make consumers consume all what is possible when
   program is running then shutdown the route once processed?
  
   It is basically needed for BatchEE camel extension (
  
 
 https://git-wip-us.apache.org/repos/asf?p=incubator-batchee.git;a=blob;f=extensions/camel/src/main/java/org/apache/batchee/camel/CamelItemReader.java;h=bf4d289a8fea4a18f783353c3cb25d1aa9050018;hb=HEAD
   ) + I wondered it for some batches I wrote some months ago without
   camel because the infra needed for it was too heavy (route policy +
   few other things) compared to the gain.
  
   ATM batchee relies on timeout but surely not the best way to do.
  
   Romain Manni-Bucau
   Twitter: @rmannibucau
   Blog: http://rmannibucau.wordpress.com/
   LinkedIn: http://fr.linkedin.com/in/rmannibucau
   Github: https://github.com/rmannibucau
 



Re: camel for short programs

2013-12-14 Thread John D. Ament
Why not use a polling consumer?

On Sat, Dec 14, 2013 at 6:25 AM, Romain Manni-Bucau
rmannibu...@gmail.com wrote:
 Hi

 any opinion on how to make consumers consume all what is possible when
 program is running then shutdown the route once processed?

 It is basically needed for BatchEE camel extension (
 https://git-wip-us.apache.org/repos/asf?p=incubator-batchee.git;a=blob;f=extensions/camel/src/main/java/org/apache/batchee/camel/CamelItemReader.java;h=bf4d289a8fea4a18f783353c3cb25d1aa9050018;hb=HEAD
 ) + I wondered it for some batches I wrote some months ago without
 camel because the infra needed for it was too heavy (route policy +
 few other things) compared to the gain.

 ATM batchee relies on timeout but surely not the best way to do.

 Romain Manni-Bucau
 Twitter: @rmannibucau
 Blog: http://rmannibucau.wordpress.com/
 LinkedIn: http://fr.linkedin.com/in/rmannibucau
 Github: https://github.com/rmannibucau


Re: camel-ejb in JBoss AS7

2013-11-26 Thread John D. Ament
Sounds like a classloader issue.  How are you packaging camel into your app?

On Tue, Nov 26, 2013 at 12:15 PM, simholte simholt...@yahoo.com wrote:
 I'm trying to use the Camel EJB component to make a call to an EJB but I'm
 having problems calling the bean with anything other then a String.

 My Camel version is 2.12.1

 When I expose an EJB like:
 @Stateless
 public class ProcessorService {
 public String process(String argument) {
 return My String Plus Yours  + argument;
 }

 I can call it with the route:
  route
  from uri=direct:start/
 to
 uri=ejb:java:app/service/ProcessorService!com.morphotrust.poc.camel.ProcessorService
 ?method=process(${body})/
 /route

 And everything works.  Side question, the only way I could make it work is
 by using the full JNDI address in my URI.  Is there a better/best practice
 way to register the beans look up information?


 But when I try and call the EJB with a object I get a
 NoTypeConversionException.  I'm pretty sure the body of the in message is a
 Domain object.  For example if I add a method to the above EJB:

 public String processAcme(Domain domain) {
 return domain.toString();
 }

 And the error I get when calling the method in the route is:

 CamelExecutionException: Exception occurred during execution on the
 exchange: Exchange[Message: Domain [persons=[Person [name=your name, dob=Tue
 Nov 26 09:28:05 CST 2013, age=11

  org.apache.camel.NoTypeConversionAvailableException: No type converter
 available to convert from type: com.acme.domain.Domain to the required type:
 com.acme.domain.Domain with value Domain [persons=[Person [name=your name,
 dob=Tue Nov 26 09:28:05 CST 2013, age=11]]]

 I'm new to Camel so hopefully I'm just missing something obvious.  Any help
 would be great!









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


Default value for a timer?

2013-11-04 Thread John D. Ament
I'm using Camel 2.10.7.  We just noticed in our code we have a timer with
no values set.  How often will this timer fire?

John


Writing a Component - passing in arguments

2013-10-20 Thread John D. Ament
Let's say that I'm looking to write a component.  I want my component
to understand the Object... params that are passed in to it, such that
instead of camel processing:

toF(foo://%s,something)

I want the something to be passed to my component instead.

Is this possible?


Re: bug : dns component

2013-10-06 Thread John D. Ament
Kuro,

Would you consider it optional in that you don't specify it in the endpoint?

On Sun, Oct 6, 2013 at 12:40 PM, kuro 962...@gmail.com wrote:
 Hi.

 From the camel wiki,  dns.server option is Optional.

 I will try to create a JIRA ticket.



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


Re: bug : dns component

2013-10-06 Thread John D. Ament
Right, so just to be clear, to treat it as optional it should be like this:

MapString, Object headers = exchange.getIn().getHeaders();
//headers.put(dns.server, null);
//headers.put(dns.server, ResolverConfig.getCurrentConfig().server());
headers.put(dns.class, );
headers.put(dns.name, www.example.com);
headers.put(dns.type, TXT);

On Sun, Oct 6, 2013 at 6:50 PM, kuro 962...@gmail.com wrote:
 Yes !




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


Re: camel-cdi status?

2013-09-16 Thread John D. Ament
I've actually been curious about this as well.  Some of the things
Ive thought about that would be cool:

- Firing CDI events for exchanges, and making processors simply
observer methods.
- Using proper CDI scopes (rather than being bound to the spring contexts)

On Mon, Sep 16, 2013 at 11:12 AM, Harald Wellmann
hwellmann...@gmail.com wrote:
 Going by its documentation camel-cdi looks rather incomplete and
 broken to me. Is this component a prototype or ready for production?

 There does not seem to be any documentation other than
 http://camel.apache.org/cdi.html

 which contains many broken links to Java classes or Javadoc pages.

 Injecting a CdiCamelContext and configuring and starting it in a
 @Singleton @Startup @PostConstruct method does not make sense to me,
 given that the CdiCamelContext already starts itself in its own
 @PostConstruct method.

 Is there a way to configure a context before starting it?

 How do you work with more than one Camel context in one CDI application?

 Best regards,
 Harald


Re: getting java.io.NotSerializableException when soap request recived in POJO format is routed to active mq

2013-09-10 Thread John D. Ament
Does DTPowerConsumption implement java.io.Serializable?  It needs to.

On Tue, Sep 10, 2013 at 10:52 AM, vsmahesh aneesh_...@yahoo.co.in wrote:
 Hi  i am getting the following erro when i try to route to activemq from cxf
 endpoint which  is getting soap request in POJO format.When i route to queue
 i am getting not serializable error.The error is

 java.lang.RuntimeException:
 outotec.pi.mes.id59.powerconsumption.DTPowerConsumption
 at
 org.apache.activemq.command.ActiveMQObjectMessage.storeContent(ActiveMQObjectMessage.java:112)[125:org.apache.activemq.activemq-core:5.7.0.fuse-71-047]
 at
 org.apache.activemq.command.ActiveMQObjectMessage.setObject(ActiveMQObjectMessage.java:163)[125:org.apache.activemq.activemq-core:5.7.0.fuse-71-047]
 at
 org.apache.camel.component.jms.JmsBinding.createJmsMessageForType(JmsBinding.java:558)[154:org.apache.camel.camel-jms:2.10.0.fuse-71-047]
 at
 org.apache.camel.component.jms.JmsBinding.createJmsMessage(JmsBinding.java:470)[154:org.apache.camel.camel-jms:2.10.0.fuse-71-047]
 at
 org.apache.camel.component.jms.JmsBinding.makeJmsMessage(JmsBinding.java:287)[154:org.apache.camel.camel-jms:2.10.0.fuse-71-047]
 at
 org.apache.camel.component.jms.JmsProducer$2.createMessage(JmsProducer.java:270)[154:org.apache.camel.camel-jms:2.10.0.fuse-71-047]
 at
 org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate.doSendToDestination(JmsConfiguration.java:216)[154:org.apache.camel.camel-jms:2.10.0.fuse-71-047]
 at
 org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate.access$100(JmsConfiguration.java:159)[154:org.apache.camel.camel-jms:2.10.0.fuse-71-047]
 at
 org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate$1.doInJms(JmsConfiguration.java:173)[154:org.apache.camel.camel-jms:2.10.0.fuse-71-047]
 at
 org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:466)[153:org.springframework.jms:3.0.7.RELEASE]
 at
 org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate.send(JmsConfiguration.java:170)[154:org.apache.camel.camel-jms:2.10.0.fuse-71-047]
 at
 org.apache.camel.component.jms.JmsProducer.doSend(JmsProducer.java:402)[154:org.apache.camel.camel-jms:2.10.0.fuse-71-047]
 at
 org.apache.camel.component.jms.JmsProducer.processInOnly(JmsProducer.java:356)[154:org.apache.camel.camel-jms:2.10.0.fuse-71-047]
 at
 org.apache.camel.component.jms.JmsProducer.process(JmsProducer.java:132)[154:org.apache.camel.camel-jms:2.10.0.fuse-71-047]
 at
 org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[147:org.apache.camel.camel-core:2.10.0.fuse-71-047]
 at
 org.apache.camel.processor.SendProcessor$2.doInAsyncProducer(SendProcessor.java:122)[147:org.apache.camel.camel-core:2.10.0.fuse-71-047]
 at
 org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:298)[147:org.apache.camel.camel-core:2.10.0.fuse-71-047]
 at
 org.apache.camel.processor.SendProcessor.process(SendProcessor.java:117)[147:org.apache.camel.camel-core:2.10.0.fuse-71-047]
 at
 org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[147:org.apache.camel.camel-core:2.10.0.fuse-71-047]
 at
 org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)[147:org.apache.camel.camel-core:2.10.0.fuse-71-047]
 at
 org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[147:org.apache.camel.camel-core:2.10.0.fuse-71-047]
 at
 org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:73)[147:org.apache.camel.camel-core:2.10.0.fuse-71-047]
 at
 org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[147:org.apache.camel.camel-core:2.10.0.fuse-71-047]
 at
 org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)[147:org.apache.camel.camel-core:2.10.0.fuse-71-047]
 at
 org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[147:org.apache.camel.camel-core:2.10.0.fuse-71-047]



 *Caused by: java.io.NotSerializableException:
 outotec.pi.mes.id59.powerconsumption.DTPowerConsumption*
 at java.io.ObjectOutputStream.writeObject0(Unknown Source)[:1.6.0_45]
 at java.io.ObjectOutputStream.writeObject(Unknown Source)[:1.6.0_45]
 at java.util.ArrayList.writeObject(Unknown Source)[:1.6.0_45]
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native 
 Method)[:1.6.0_45]
 at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown 
 Source)[:1.6.0_45]
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
 Source)[:1.6.0_45]
 at java.lang.reflect.Method.invoke(Unknown Source)[:1.6.0_45]
 at java.io.ObjectStreamClass.invokeWriteObject(Unknown 
 Source)[:1.6.0_45]
 at 

Re: Time to deliver a message?

2013-09-02 Thread John D. Ament
Yeah, one theory I have is that the webservice we have to call in the
middle is taking longer than expected.  I also found an issue (on my
side) where certain routes weren't getting set up right.

I'm going to leave debug on for a while on my machine, see what the
logs produce and go from there.  Will write back if something looks
off.

John

On Mon, Sep 2, 2013 at 4:09 PM, Christian Müller
christian.muel...@gmail.com wrote:
 I'm afraid we need a (simple) unit test which shows this issue to
 investigate on it.
 We also using ActiveMQ in our PROD environment and don't see this issue.
 May be it's related to your use of the producer template or an issue in
 your custom code...
 Can you share your original route (if you are not able to provide a simple
 unit test) and your custom beans/processors?

 Best,
 Christian
 -

 Software Integration Specialist

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

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


 On Thu, Aug 22, 2013 at 12:13 PM, John D. Ament john.d.am...@gmail.comwrote:

 Oh, right now we're in dev mode only.  It's noticeable after a few
 minutes of operating.  The time will fluctuate.  In some cases, I see
 it almost immediately processed and in others I've seen it wait up to
 10 minutes to process a message (if it takes longer than this we've
 been giving up and trying again).
 Yes, we're using embedded activemq as our broker.
 Most of what we have is operating like a message translator, an in
 bound webservice request gets turned into a POJO and queued (manually,
 via a producer template).  From that point on we simply have bean
 translators (enrichers and filters only) converting the object from
 one type to another until finally it's sent over to the final
 destination in the right format.
 I'm not sure where there would be a memory leak, since we're just
 doing some POJO manipulation and web service invocations.  No, I don't
 have a simple test case that reproduces this yet; though I'll see if
 it happens in other scenarios.

 On Thu, Aug 22, 2013 at 5:55 AM, Christian Müller
 christian.muel...@gmail.com wrote:
  Details like:
  - Which message broker do you use? Which version?
- If you use ActiveMQ, do you use an embedded or external broker?
  - How does your route look like (Which message exchange pattern do you
 use?
  Which payload do you use?)
  - What exactly do you mean with over the time? Minutes, hours, days,
  weeks, ...
  - How long does it take at the beginning and how long dos it takes after
 x
  minutes/hours/days/weeks?
  - Do you have a test case which reproduce the issue?
  - Did you checked whether there is a memory leak?
 
  Best,
  Christian
  -
 
  Software Integration Specialist
 
  Apache Camel committer: https://camel.apache.org/team
  V.P. Apache Camel: https://www.apache.org/foundation/
  Apache Member: https://www.apache.org/foundation/members.html
 
  https://www.linkedin.com/pub/christian-mueller/11/551/642
 
 
  On Wed, Aug 21, 2013 at 3:18 PM, John D. Ament john.d.am...@gmail.com
 wrote:
 
  I guess one other important thing to point out is that this is camel
  2.10.6 on service mix 4.5.3.
 
  On Wed, Aug 21, 2013 at 9:17 AM, John D. Ament john.d.am...@gmail.com
  wrote:
   Not sure what more details I could provide.
  
   Basically, I have a polling consumer on a queue.  I see that polling
   consumer polling all the time.  DOesn't see a message, even though the
   message was sent (based on log messages) several minutes back.  Then
   finally after a little bit more the message gets plucked.
  
   On Wed, Aug 21, 2013 at 6:06 AM, Christian Müller
   christian.muel...@gmail.com wrote:
   No, this is not expected. Can you provide more details?
  
   Best,
   Christian
   Am 21.08.2013 05:55 schrieb John D. Ament john.d.am...@gmail.com
 :
  
   Hi,
  
   Assuming that I'm using activemq queues as my components, how
 quickly
   should a message be delivered?
  
   In a number of routes, I'm moving data from one queue to another
   queue, and over time the amount of time that it takes for a message
 to
   go from A to B to C is steadily increasing.  Is this expected?
  
   Thanks,
  
   John
  
 



Re: Waiting for Namespace Handlers, even though they're available.

2013-08-30 Thread John D. Ament
Try this

In your blueprint.xml, the xsi:schemaLocation add

http://camel.apache.org/schema/blueprint
http://camel.apache.org/schema/blueprint/camel-blueprint-2.10.4.xsd

and then in the body,

camelContext xmlns=http://camel.apache.org/schema/blueprint;

On Fri, Aug 30, 2013 at 2:32 PM, Tom Ellis telli...@gmail.com wrote:
 I asked this on the JBoss Fuse forums, but I hope that maybe one of
 you have come against this:

 Can anyone tell me why my bundle is entering into GracePeriod here:



 camel-blueprint exposes the camel blueprint namespace:



 JBossFuse:karaf@root list | grep 135
 [ 135] [Active ] [Created ] [   ] [   50] camel-blueprint
 (2.10.0.redhat-60024)
 JBossFuse:karaf@root ls 135


 camel-blueprint (135) provides:
 ---
 objectClass = org.apache.aries.blueprint.NamespaceHandler
 osgi.service.blueprint.namespace = http://camel.apache.org/schema/blueprint
 service.id = 353



 But my bundle is in a GracePeriod waiting for it:



 14:07:14,721 | INFO  | NAPSHOT-thread-1 | BlueprintContainerImpl
 | 22 - org.apache.aries.blueprint.core - 1.0.1.redhat-60024 |
 Bundle com.mycompany.mybundle is waiting for namespace handlers
 [http://camel.apache.org/schema/blueprint]
 14:07:14,721 | DEBUG | NAPSHOT-thread-1 | BlueprintEventDispatcher
 | 22 - org.apache.aries.blueprint.core - 1.0.1.redhat-60024 |
 Sending blueprint container event BlueprintEvent[type=GRACE_PERIOD,
 dependencies=[((objectClass=org.apache.aries.blueprint.NamespaceHandler)(osgi.service.blueprint.namespace=http://camel.apache.org/schema/blueprint))]]
 for bundle com.mycompany.mybundle



 Definition of the namespace in my bundle's blueprint:



 camelContext id=myRoute trace=false
 xmlns=http://camel.apache.org/schema/blueprint;
 xsi:schemaLocation=http://camel.apache.org/schema/blueprint
 http://camel.apache.org/schema/blueprint/camel-blueprint-2.10.0.xsd;
 routeBuilder ref=myRouteBuilder /
 /camelContext


Re: Time to deliver a message?

2013-08-22 Thread John D. Ament
Oh, right now we're in dev mode only.  It's noticeable after a few
minutes of operating.  The time will fluctuate.  In some cases, I see
it almost immediately processed and in others I've seen it wait up to
10 minutes to process a message (if it takes longer than this we've
been giving up and trying again).
Yes, we're using embedded activemq as our broker.
Most of what we have is operating like a message translator, an in
bound webservice request gets turned into a POJO and queued (manually,
via a producer template).  From that point on we simply have bean
translators (enrichers and filters only) converting the object from
one type to another until finally it's sent over to the final
destination in the right format.
I'm not sure where there would be a memory leak, since we're just
doing some POJO manipulation and web service invocations.  No, I don't
have a simple test case that reproduces this yet; though I'll see if
it happens in other scenarios.

On Thu, Aug 22, 2013 at 5:55 AM, Christian Müller
christian.muel...@gmail.com wrote:
 Details like:
 - Which message broker do you use? Which version?
   - If you use ActiveMQ, do you use an embedded or external broker?
 - How does your route look like (Which message exchange pattern do you use?
 Which payload do you use?)
 - What exactly do you mean with over the time? Minutes, hours, days,
 weeks, ...
 - How long does it take at the beginning and how long dos it takes after x
 minutes/hours/days/weeks?
 - Do you have a test case which reproduce the issue?
 - Did you checked whether there is a memory leak?

 Best,
 Christian
 -

 Software Integration Specialist

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

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


 On Wed, Aug 21, 2013 at 3:18 PM, John D. Ament john.d.am...@gmail.comwrote:

 I guess one other important thing to point out is that this is camel
 2.10.6 on service mix 4.5.3.

 On Wed, Aug 21, 2013 at 9:17 AM, John D. Ament john.d.am...@gmail.com
 wrote:
  Not sure what more details I could provide.
 
  Basically, I have a polling consumer on a queue.  I see that polling
  consumer polling all the time.  DOesn't see a message, even though the
  message was sent (based on log messages) several minutes back.  Then
  finally after a little bit more the message gets plucked.
 
  On Wed, Aug 21, 2013 at 6:06 AM, Christian Müller
  christian.muel...@gmail.com wrote:
  No, this is not expected. Can you provide more details?
 
  Best,
  Christian
  Am 21.08.2013 05:55 schrieb John D. Ament john.d.am...@gmail.com:
 
  Hi,
 
  Assuming that I'm using activemq queues as my components, how quickly
  should a message be delivered?
 
  In a number of routes, I'm moving data from one queue to another
  queue, and over time the amount of time that it takes for a message to
  go from A to B to C is steadily increasing.  Is this expected?
 
  Thanks,
 
  John
 



Re: Time to deliver a message?

2013-08-21 Thread John D. Ament
Not sure what more details I could provide.

Basically, I have a polling consumer on a queue.  I see that polling
consumer polling all the time.  DOesn't see a message, even though the
message was sent (based on log messages) several minutes back.  Then
finally after a little bit more the message gets plucked.

On Wed, Aug 21, 2013 at 6:06 AM, Christian Müller
christian.muel...@gmail.com wrote:
 No, this is not expected. Can you provide more details?

 Best,
 Christian
 Am 21.08.2013 05:55 schrieb John D. Ament john.d.am...@gmail.com:

 Hi,

 Assuming that I'm using activemq queues as my components, how quickly
 should a message be delivered?

 In a number of routes, I'm moving data from one queue to another
 queue, and over time the amount of time that it takes for a message to
 go from A to B to C is steadily increasing.  Is this expected?

 Thanks,

 John



Re: Time to deliver a message?

2013-08-21 Thread John D. Ament
I guess one other important thing to point out is that this is camel
2.10.6 on service mix 4.5.3.

On Wed, Aug 21, 2013 at 9:17 AM, John D. Ament john.d.am...@gmail.com wrote:
 Not sure what more details I could provide.

 Basically, I have a polling consumer on a queue.  I see that polling
 consumer polling all the time.  DOesn't see a message, even though the
 message was sent (based on log messages) several minutes back.  Then
 finally after a little bit more the message gets plucked.

 On Wed, Aug 21, 2013 at 6:06 AM, Christian Müller
 christian.muel...@gmail.com wrote:
 No, this is not expected. Can you provide more details?

 Best,
 Christian
 Am 21.08.2013 05:55 schrieb John D. Ament john.d.am...@gmail.com:

 Hi,

 Assuming that I'm using activemq queues as my components, how quickly
 should a message be delivered?

 In a number of routes, I'm moving data from one queue to another
 queue, and over time the amount of time that it takes for a message to
 go from A to B to C is steadily increasing.  Is this expected?

 Thanks,

 John



Time to deliver a message?

2013-08-20 Thread John D. Ament
Hi,

Assuming that I'm using activemq queues as my components, how quickly
should a message be delivered?

In a number of routes, I'm moving data from one queue to another
queue, and over time the amount of time that it takes for a message to
go from A to B to C is steadily increasing.  Is this expected?

Thanks,

John


Re: Creating then starting a JMS consumer around another component

2013-08-07 Thread John D. Ament
Hi,

Why isn't 2,1,3 possible?
Why not setup your consumer before you start up your camel context?

On Wed, Aug 7, 2013 at 7:22 PM, markgize mark.gizejew...@pimco.com wrote:
 We are interested in Camel but have a specific startup sequence that we need
 to follow:

 1) Open a JMS topic consumer for our updates, but, do not get any of the
 messages.
 2) Query our database and build a state of the world
 3) Start to get the update messages from the consumer we opened

 We cannot adopt 2, 1, 3, as during the time we are done with our query but
 are still constructing the state of the world, we might miss an update.  1,
 3, 2, is also a problem as an update could present an object which our state
 of the world subsequently tries to build, resulting in a duplicate.  We
 could endeavor to handle this duplicate, but it is powerful to load the bulk
 of our data in the state of the world phase and demand absolutely no
 exceptions.

 What we have currently implemented can also result in duplicates.  The state
 of the world might contain an object which an update then subsequently
 provides, but in this case we merely reject just one update, as opposed to
 having an issue with the much more significant state of the world operation.

 How can we achieve 1, 2, 3 using Camel?  The difficulty that I see is that
 our consumer must be receiving messages, however, it must not consume them
 until the state of the world completes.

 Thanks for your time.



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Creating-then-starting-a-JMS-consumer-around-another-component-tp5736955.html
 Sent from the Camel - Users mailing list archive at Nabble.com.


Re: The producer sent only one message but the comsumer received multiple messages with same content.

2013-08-06 Thread John D. Ament
Since you have activemq, can you try it with the activemq component
rather than the JMS component?


Can you share more of your example, the problem is that it doesn't compile.

I put together a simple example as well that demos this, but doesn't
reproduce your error.  I'm wondering if somehow you're setting up more
processors within your loop.

final String RS_BASIC_ENDPOINT =
cxfrs://http://0.0.0.0:9581/rest/?resourceClasses=com.mycompany.rest.LoadUpResource;;
final JmsEndpoint endPoint=
ctx.getEndpoint(activemq:topic:topic1,JmsEndpoint.class);
final ProducerTemplate producer = ctx.createProducerTemplate();
from(RS_BASIC_ENDPOINT).process(new Processor(){
@Override
public void process(final Exchange exchange) throws Exception {
for(int i=0;i10;i++) {
Exchange outExchange = endPoint.createExchange();
outExchange.setPattern(ExchangePattern.InOnly);
outExchange.getIn().setBody(i);
producer.send(endPoint, outExchange);
}
}
});


from(activemq:topic:topic1).process(new Processor(){
@Override
public void process(final Exchange exchange) throws Exception {
logger.info(footopicProcessor +exchange.getIn().getBody());
}
});

On Tue, Aug 6, 2013 at 9:35 AM, Nhan Nguyen ntnha...@gmail.com wrote:
 I'm using Camel 2.11.0:

 dependency
 groupIdorg.apache.camel/groupId
 artifactIdcamel-core/artifactId
 version2.11.0/version
 /dependency
 dependency
 groupIdorg.apache.camel/groupId
 artifactIdcamel-jms/artifactId
 version2.11.0/version
 /dependency
 dependency
 groupIdorg.apache.camel/groupId
 artifactIdcamel-spring/artifactId
 version2.11.0/version
 /dependency
 dependency
 groupIdorg.apache.activemq/groupId
 artifactIdactivemq-camel/artifactId
 version5.7.0/version
 /dependency

 Thanks,
 Nhan



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/The-producer-sent-only-one-message-but-the-comsumer-received-multiple-messages-with-same-content-tp5736733p5736850.html
 Sent from the Camel - Users mailing list archive at Nabble.com.


Correct way to read a CXF Message in MESSAGE format

2013-07-31 Thread John D. Ament
Hi all

I'm dynamically binding a CXF endpoint to a processor instance, using a
route like this:

from(simpleEndpointURI +
?dataFormat=MESSAGEwsdlURL=wsdl/Import.wsdlloggingFeatureEnabled=true).process(new
ImportProcessor());

I setup a simple way of reading this body using an InputStream, but this
seems wrong.  I'm trying to get the soap headers and the soap body of the
message.  I'm using MESSAGE dataFormat because I can't seem to get the
mustunderstand to process correctly without it.

From the docs:

MESSAGEMESSAGE is the raw message that is received from the transport
layer. It is not suppose to touch or change Stream, some of the CXF
interceptor will be removed if you are using this kind of DataFormat so you
can't see any soap headers after the camel-cxf consumer and JAX-WS handler
is not supported.



Which is fine for me, all I need is some data simply from the body.  But is
it possible to access the headers? I see everything fine in the
InputStream, but it would make more sense if this were available somehow in
a POJO/Java format.  Is there a way I can use another dataFormat but get it
to generate the MustUnderstand properly?

Thanks,

John


Re: Use MessageFilter to process files that are 30 or more days old

2013-07-29 Thread John D. Ament
Karim,

Did you try date.minusDays(30).getMillis()?
Typically long formats for dates/times are in milliseconds.


On Mon, Jul 29, 2013 at 4:45 PM, Karim Garza karimga...@gmail.com wrote:

 Hi,

 I am trying to use the MessageFilter to process files that are 30 days or
 older. I came up with this code to do the work, but it appears that
 the CamelFileLastModified header is a long and I do not know how to use to
 compare it with a date.

 public void configure() throws Exception {
 DateTime date = new DateTime();
  from(file:{{file.inbox}}?delete=true)
 .filter(header(CamelFileLastModified).isLessThan(date.minusDays(30)))
  .process(new FileProcessor());
 }

 I would appreciate any help you can provide,

 Karim



camel-cdi and non containers

2013-07-28 Thread John D. Ament
Hi all

I'm interested in using camel-cdi support, but not within an EE container;
instead I want to run it with Karaf and Service Mix.  The docs at [1] seem
to indicate that we need to use a bootstrap class to setup the container,
however it seems like with service mix, service mix would need to do this.
 Am I correct in understanding that in order to then run camel-cdi in
service mix we would need to change how service mix started up?

Thanks,

John

[1]: http://camel.apache.org/cdi.html


Re: camel-cdi and non containers

2013-07-28 Thread John D. Ament
Hi Romain

I think that's plain camel-cdi.  The question is more around using
camel-cdi in service mix (probably using pax cdi and either Weld or OWB).


On Sun, Jul 28, 2013 at 3:06 PM, Romain Manni-Bucau
rmannibu...@gmail.comwrote:

 Hi

 If it didnt change since i looked it relies on DS so you just need to
 ensure cdi impl bundle started before
 Le 28 juil. 2013 21:01, John D. Ament john.d.am...@gmail.com a écrit :

  Hi all
 
  I'm interested in using camel-cdi support, but not within an EE
 container;
  instead I want to run it with Karaf and Service Mix.  The docs at [1]
 seem
  to indicate that we need to use a bootstrap class to setup the container,
  however it seems like with service mix, service mix would need to do
 this.
   Am I correct in understanding that in order to then run camel-cdi in
  service mix we would need to change how service mix started up?
 
  Thanks,
 
  John
 
  [1]: http://camel.apache.org/cdi.html
 



Re: camel-cdi and non containers

2013-07-28 Thread John D. Ament
Well, that's the thing (which I'm a bit confused on).  The closest thing I
have is servicemix as a container.  So it's not clear where I would put the
bootstrap class since I don't instantiate the camel context (servicemix
does).


On Sun, Jul 28, 2013 at 3:38 PM, Romain Manni-Bucau
rmannibu...@gmail.comwrote:

 hi

 i used it (before any release so it maybe changed) with owb in KarafEE so
 just pick the container you want ;)

 *Romain Manni-Bucau*
 *Twitter: @rmannibucau https://twitter.com/rmannibucau*
 *Blog: **http://rmannibucau.wordpress.com/*
 http://rmannibucau.wordpress.com/
 *LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
 *Github: https://github.com/rmannibucau*



 2013/7/28 John D. Ament john.d.am...@gmail.com

  Hi Romain
 
  I think that's plain camel-cdi.  The question is more around using
  camel-cdi in service mix (probably using pax cdi and either Weld or OWB).
 
 
  On Sun, Jul 28, 2013 at 3:06 PM, Romain Manni-Bucau
  rmannibu...@gmail.comwrote:
 
   Hi
  
   If it didnt change since i looked it relies on DS so you just need to
   ensure cdi impl bundle started before
   Le 28 juil. 2013 21:01, John D. Ament john.d.am...@gmail.com a
  écrit :
  
Hi all
   
I'm interested in using camel-cdi support, but not within an EE
   container;
instead I want to run it with Karaf and Service Mix.  The docs at [1]
   seem
to indicate that we need to use a bootstrap class to setup the
  container,
however it seems like with service mix, service mix would need to do
   this.
 Am I correct in understanding that in order to then run camel-cdi in
service mix we would need to change how service mix started up?
   
Thanks,
   
John
   
[1]: http://camel.apache.org/cdi.html
   
  
 



Re: Recipient List Multitenant ESBs

2013-07-27 Thread John D. Ament
Hmm yes I had seen that, with ${body..}, if I'm sending my own object as
the message, does that become body and then I can use a parameter on it to
represent the value?  (Really all that does is remove a call to
String.format)

Is there an easy way to dynamically bind to endpoints?  This is the part
that I'm thinking of using a polling consumer.

Thanks,

John


On Sat, Jul 27, 2013 at 4:16 AM, Claus Ibsen claus.ib...@gmail.com wrote:

 Hi

 Yes Apache ActiveMQ can create queues on the fly (does this by default)

 And you can use the receipient list in Camel for dynamic to, see:
 http://camel.apache.org/how-do-i-use-dynamic-uri-in-to.html

 And there is some other EIPs for dynamic like routing slip, dynamic
 router, content based router, etc.
 http://camel.apache.org/eip


 On Fri, Jul 26, 2013 at 6:41 PM, John D. Ament john.d.am...@gmail.com
 wrote:
  Hi all
 
  I have a somewhat interesting use case.  I want to create an ESB that has
  some level of multitenancy in mind.  What I'm thinking is that I'll have
 a
  single end point that acts as the entry, in this case a SOAP based web
  service.  I'm going to take the data from this webservice and put it on
 to
  a queue that is defined dynamically, and allow a camel route to process
  data from this queue, convert it once and twice.
 
  The problem I'm seeing is around the definition of these queues.  Is it
  possible that a queue, or even route activemq://foo1 be created
  dynamically at runtime without doing anything else? It's almost like a
  route prototype with some kind of variable substitution.  I think part of
  my solution should use http://camel.apache.org/recipient-list.htmlsince I
  need to essentially send data in a certain order to different endpoints.
 
  Any thoughts on this approach?
 
  John



 --
 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



Recipient List Multitenant ESBs

2013-07-26 Thread John D. Ament
Hi all

I have a somewhat interesting use case.  I want to create an ESB that has
some level of multitenancy in mind.  What I'm thinking is that I'll have a
single end point that acts as the entry, in this case a SOAP based web
service.  I'm going to take the data from this webservice and put it on to
a queue that is defined dynamically, and allow a camel route to process
data from this queue, convert it once and twice.

The problem I'm seeing is around the definition of these queues.  Is it
possible that a queue, or even route activemq://foo1 be created
dynamically at runtime without doing anything else? It's almost like a
route prototype with some kind of variable substitution.  I think part of
my solution should use http://camel.apache.org/recipient-list.html since I
need to essentially send data in a certain order to different endpoints.

Any thoughts on this approach?

John