Re: Camel JUnit Extensions + EasyMock

2012-07-02 Thread Henryk Konsek
Hi all, > Typically I would use EasyMock for this. Is there any problems in using > EasyMock with the Camel JUnit extensions? Does Camel provide another > approach for this problem? Of course you can add mocked bean into registry. It will work like a charm with EasyMock, Mockito and so forth. Si

File consumer event based (not polling)

2012-07-02 Thread raphael
Hi, I'd like to have a File consumer endpoint, but not scheduled on a polling mechanism. It would be triggered through a event driven consumer (JMS message for instance). Basically, I just want to be able to decide when my file consumer must read files in the directory. I've looked in the EventDri

Re: File consumer event based (not polling)

2012-07-02 Thread Pontus Ullgren
Hello, I see two options for this (there are probably more). You can use content enricher (see the bottom of http://camel.apache.org/content-enricher.html ). from("direct:start") .pollEnrich("file:inbox) .to("direct:result"); If I remember correctly the potential problem here is that the pol

Re: Camel JUnit Extensions + EasyMock

2012-07-02 Thread James Carman
There are times when your route needs to call a service of some sort. This is when I use mock objects. On Jul 2, 2012 5:06 AM, "Henryk Konsek" wrote: > Hi all, > > > Typically I would use EasyMock for this. Is there any problems in using > > EasyMock with the Camel JUnit extensions? Does Camel p

Re: File consumer event based (not polling)

2012-07-02 Thread Claus Ibsen
Hi Yeah you can associate a route with a route policy http://camel.apache.org/routepolicy.html And then trigger/control when the file route should be running. On Mon, Jul 2, 2012 at 1:06 PM, Pontus Ullgren wrote: > Hello, > > I see two options for this (there are probably more). > > You can u

Re: File consumer event based (not polling)

2012-07-02 Thread raphael
Hi, Actually, this doesn't fit exactly my needs. I just want to read the filename that I receive in my JMS message... I've seen all the discussions about the PollEnrich API .. So, just wandering how I can achieve this, according that I cannot pass any args to pollEnrich. Thanks. Raph. -- View

Re: File consumer event based (not polling)

2012-07-02 Thread Claus Ibsen
On Mon, Jul 2, 2012 at 2:10 PM, raphael wrote: > Hi, > > Actually, this doesn't fit exactly my needs. > > I just want to read the filename that I receive in my JMS message... > I've seen all the discussions about the PollEnrich API .. > Just set the message body to a java.io.File to read the file

Re: File consumer event based (not polling)

2012-07-02 Thread raphael
OK, it's working by transforming the body in File(filename). But in that scenario, I lost all the features of the file component, right ? (like move option for example). -- View this message in context: http://camel.465427.n5.nabble.com/File-consumer-event-based-not-polling-tp5715349p5715355.htm

Re: File consumer event based (not polling)

2012-07-02 Thread Claus Ibsen
On Mon, Jul 2, 2012 at 4:17 PM, raphael wrote: > OK, it's working by transforming the body in File(filename). > > But in that scenario, I lost all the features of the file component, right ? > (like move option for example). > Yes you do, you can delete/move the file yourself. Or you would need t

Re: File consumer event based (not polling)

2012-07-02 Thread thomas barker
I have done this before, it may take me a bit to find the code. I think you accomplish it by doing the following: 1. Override the from(String) method in RouteBuilder 2. Use getContext().getEndpoint(uri) to get the endpoint, if the endpoint is not a scheduledpollingendpoint then do super.from(ur

Re: File consumer event based (not polling)

2012-07-02 Thread raphael
Of course, i'm pretty sure there are a lot of way to do it ... Issue is I don't want to crack to much the Camel framework... and just want to rely on standard API. Thanks. -- View this message in context: http://camel.465427.n5.nabble.com/File-consumer-event-based-not-polling-tp5715349p5715358.

Re: File consumer event based (not polling)

2012-07-02 Thread thomas barker
The way I proposed does not take much effort, especially if you are using groovy (a little more if you are using Java). The solution is deep enough into the api that some maintenance might be required to make sure it works with ongoing camel upgrades. If you really dont want to go deeper than Rou

Testing a Route which de-queues message from Topic in CLIENT_ACKNOWLEDGE mode

2012-07-02 Thread gilboy
Hi I have a route where I consume a message from a JMS topic and do some processing of the message. I have the JMS Ack mode set to: CLIENT_ACKNOWLEDGE mode If the route successfully completes the message is dequeued. I want to verify that this takes place, i.e. message gets dequeued. Does the c

Using advicewith to add interceptors to an existing route

2012-07-02 Thread gilboy
Hi When I use the intercept feature below, is it legal to use wildchar's in the endpoint? Thanks Joe @Test public void testSimulateErrorUsingInterceptors() throws Exception { RouteDefinition route = context.getRouteDefinitions().get(0); route.adviceWith(context, new RouteBuilder(

Re: Using advicewith to add interceptors to an existing route

2012-07-02 Thread Christian Müller
Can you try 'jms:*' instead of '*jms:*' (if you use the protocol 'jms'). I think we only support wildcards at the end... Best, Christian On Mon, Jul 2, 2012 at 6:21 PM, gilboy wrote: > Hi > > When I use the intercept feature below, is it legal to use wildchar's in > the > endpoint? > > Thanks >

Re: Using advicewith to add interceptors to an existing route

2012-07-02 Thread Claus Ibsen
On Mon, Jul 2, 2012 at 6:21 PM, gilboy wrote: > Hi > > When I use the intercept feature below, is it legal to use wildchar's in the > endpoint? > Yes read the docs http://camel.apache.org/intercept > Thanks > Joe > > @Test > public void testSimulateErrorUsingInterceptors() throws Exception { >

High CPU use

2012-07-02 Thread pvenini
Hi, I'm in the process of deploying a Camel solution to it's destination server. It has 6 routes and is essentially a Fix to HTTP converter (it uses the FIX and Jetty components). What surprises me is the high CPU use (about 50% continuous on a dual core, dual processor Xeon server) when the router

Re: Testing a Route which de-queues message from Topic in CLIENT_ACKNOWLEDGE mode

2012-07-02 Thread Pontus Ullgren
Hello, You should be able to do this by running a embedded broker in you integration unit tests. After the test has completed you can verify that there are no remaining messages on the JMS queue. For more info see http://activemq.apache.org/how-to-unit-test-jms-code.html and there is also a nice

Re: High CPU use

2012-07-02 Thread Richard Kettelerij
It's funny you bring this up today. Are you sure it is not the infamous Linux leap time bug that's popping up all over the world since last weekend? See http://destefano.wordpress.com/2012/07/02/java-linux-leap-second-bug/ (also google 'linux leap time bug'). Essentially it's a bug in the Linux ke

Re: High CPU use

2012-07-02 Thread Sam (Stephen Samuel)
This morning we were having the same issue. 150% load on a camel based routing system that nearly garners only 5% load. I also thought it might have been time based. The give away for me was seeing a lot of IRQ interrupts being raised which is often a sign of an out of control timer. A full restar

Camel 2.10.0 and Bindy/CSV

2012-07-02 Thread Reynald
Hi all, I'm starting to use Camel and I'm trying to use Bindy to read a CSV File. I'm getting the error: java.lang.IllegalArgumentException: The separator has not been defined in the annotation @CsvRecord or not instantiated during initModel. must be specified at org.apache.camel.util.Obj

Re: Camel 2.10.0 and Bindy/CSV

2012-07-02 Thread Reynald
I tested this code on 2.9.2 and it does not work either. -- View this message in context: http://camel.465427.n5.nabble.com/Camel-2-10-0-and-Bindy-CSV-tp5715387p5715389.html Sent from the Camel - Users mailing list archive at Nabble.com.

Camel Velocity Template throwing error

2012-07-02 Thread paramjyotsingh
I am trying to use velocity template to generate Email for error notification with configuration as below: But I somehow it is failing and I am not able to get complete stacktrace of exception. I am getting a INFO message in log org.apache.camel.component.velocity.VelocityEn

Re: Camel Velocity Template throwing error

2012-07-02 Thread Claus Ibsen
Hi What version of Camel and Velocity are you using? And what else have you configured in velocity.properties? And do you see this issue during high concurrency (eg processing many messages concurrently) Did it work before? Do you run Camel inside a container such as Tomcat / ServiceMix / Karaf et