Re: Unit test camel with activeMQ

2011-05-30 Thread boday
take a look at the camel-jms unit tests. they should get you started with setting up AMQ and asserting message flow, etc... here is a good one to start with... https://svn.apache.org/repos/asf/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsRouteTest.java hbell

Re: Problems triggering a camel route in OSGi

2011-05-30 Thread Willem Jiang
Hi, It's good to see you finally find the solution. You maybe the first one who want to start a camel context within iPOJO in this mailing list. Do you fancy to write a blog about it? We can add article link for it. On 5/31/11 4:05 AM, Bengt Rodehav wrote: I solved the problem. I had misund

Re: Problems triggering a camel route in OSGi

2011-05-30 Thread Bengt Rodehav
I solved the problem. I had misunderstood the iPOJO annotations and exposed my service as follows: @Provides(specifications = { IService.class }, strategy = "SERVICE") The problem is that I used the "SERVICE" strategy when I should have used "SINGLETON" - which is also the default. When using "S

Re: Problems triggering a camel route in OSGi

2011-05-30 Thread Bengt Rodehav
Freeman, Yes, I've logged around the createContext() call. I make this call in the start() method and I can see that the mCamelContext variable has a valid value. However, when the trigger() method is called (via the published OSGi service) the mCamelContext is null. I looked at your URL's . I'm

Re: Problems triggering a camel route in OSGi

2011-05-30 Thread Bengt Rodehav
Hello Willem, Below is the stack trace. Line 251 of ExportTransService.java corresponds to the following line in the trigger() method: *ProducerTemplate producer = mCamelContext.createProducerTemplate();* /Bengt 2011-05-30 14:39:20,502 | ERROR | 366-85 - /trsws/ | DefaultErrorHandler

Re: Problems triggering a camel route in OSGi

2011-05-30 Thread Willem Jiang
On 5/30/11 8:22 PM, Bengt Rodehav wrote: Whenever I try to call the trigger() method from somewhere else, the mCamelContext member is null and I get a NPE when trying to create the producer template. Why is that? Can you show use the stack trace of the NPE? -- Willem -

Re: Problems triggering a camel route in OSGi

2011-05-30 Thread Freeman Fang
Hi, So far I'm not so sure it's a classloader issue. My gut feeling is that somehow mCamelContext = factory.createContext(); not get initialized correctly before your webservice invoke trigger method. Could you add print around mCamelContext = factory.createContext(); to see if it really get i

Re: Problems triggering a camel route in OSGi

2011-05-30 Thread Bengt Rodehav
I added a system.out to see what "this" is in the two methods start() and trigger() respectively. It turns out that "this" is different in those two methods which I guess means that iPOJO has created two instances of my class and in one of them I initialised the mCamelContext but in the other I did

Re: Problems triggering a camel route in OSGi

2011-05-30 Thread Bengt Rodehav
Thanks for your reply Freeman. I'll try to explain although I found even the explaining is pretty hard... My iPOJO object publishes an OSGi service which has a trigger() method that is implemented as I wrote in my first post. This OSGi service is then used by another iPOJO object that has the ser

Re: AW: Symmetric routes

2011-05-30 Thread Claus Ibsen
On Mon, May 30, 2011 at 3:09 PM, Glattfelder Beat wrote: > Steve, > > I absolutely agree on your findings, I have been thinking about this as > well and figured that since you have to set up message / event driven > processing anyway, the additional complexity in correlating some messages > to ena

Re: Problems triggering a camel route in OSGi

2011-05-30 Thread Freeman Fang
Hi, Could you elaborate how you invoke trigger method from webservice call? Do you mean your customer bundle which contain camel router also exposed as webservice, and in this webservice impl class you invoke trigger method? Or your camel router bundle also published as a OSGi service, fro

AW: AW: Symmetric routes

2011-05-30 Thread Glattfelder Beat
Steve, I absolutely agree on your findings, I have been thinking about this as well and figured that since you have to set up message / event driven processing anyway, the additional complexity in correlating some messages to enable a request reply paradigm would not be justified. What I actua

Problems triggering a camel route in OSGi

2011-05-30 Thread Bengt Rodehav
I have a very strange problem that is probably related to classloading. I use Camel 2.7.1 in Karaf 2.2.0 together with iPOJO. I create my camel context like this: @Validate public void start() { CamelContextFactory factory = new CamelContextFactory(); factory.setBundleContext(getBundl

Re: Unit test camel with activeMQ

2011-05-30 Thread Claus Ibsen
On Mon, May 30, 2011 at 12:04 PM, Willem Jiang wrote: > Hi, > > It depends on if you want to start the JMS broker. > In most case, you don't need to start the JMS broker if you just want to > test the route method. Yeah the camel-activemq component can automatic embed a local broker. Thats very c

Re: error in interceptor: InputStreamCache cannot be cast to org.w3c.dom.Node

2011-05-30 Thread Claus Ibsen
vance. > Javier Arias. > > [Fatal Error] :-1:-1: Premature end of file. > [Fatal Error] :-1:-1: Premature end of file. > [Fatal Error] :-1:-1: Premature end of file. > [Fatal Error] :-1:-1: Premature end of file. > [Fatal Error] :-1:-1: Premature end of file. > 20

error in interceptor: InputStreamCache cannot be cast to org.w3c.dom.Node

2011-05-30 Thread Javier Arias Losada
. [Fatal Error] :-1:-1: Premature end of file. [Fatal Error] :-1:-1: Premature end of file. [Fatal Error] :-1:-1: Premature end of file. [Fatal Error] :-1:-1: Premature end of file. 20110530-12:58:52.213 | ERROR | DefaultMessageListenerContainer-1 | he.camel.processor.Logger 248 | Failed delivery for

Re: AW: Symmetric routes

2011-05-30 Thread Stephen Bate
Glattfelder, I think that in some cases it would make sense to support the InOut MEP for FIX. Certain pairs of FIX message types are logically a request-reply pair. Order execution is not in that category because of the multiple asynchrnous replies, but a FIX OrderStatusRequest could potentially b

AW: Symmetric routes

2011-05-30 Thread Glattfelder Beat
Hi, one important thing to take into consideration is the asynchronous nature of FIX messaging. I am not sure how an InOut exchange would enable that. A typical interaction would be as such: > order request < order ack < partial execution ... < completed execution So th

Re: Unit test camel with activeMQ

2011-05-30 Thread Willem Jiang
Hi, It depends on if you want to start the JMS broker. In most case, you don't need to start the JMS broker if you just want to test the route method. So you can replace the activemq to direct or seda endpoint. There are some useful discussion in the Chapter6 of Camel in Action. On 5/30/11 5:

Re: Issue unmarshalling Fixed Length message date

2011-05-30 Thread Claus Ibsen
On Sun, May 29, 2011 at 11:46 PM, Christian Müller wrote: > The problem was the wrong pos parameter in the @DataField annotation. We > cannot use pos=1, pos=2, pos=3 and so on, if the fields are longer than only > one character. > Weird. Can you highlight this, eg the problem? I would expect the

Re: @XPath for an Integer

2011-05-30 Thread David Karlsen
NaN goes for any Number object. 2011/5/26 Claus Ibsen > On Thu, May 26, 2011 at 5:44 PM, boday > wrote: > > agreed...I'll update the patch. While we are at it, are there any other > > cases that should be addressed? > > > > I wonder if BigDecimal has any similar NaN stuff? > > > > > > bvahdat

AW: Unit test camel with activeMQ

2011-05-30 Thread Christian Schneider
First thing. You can very nicely test such routes. Camel provides some nice test classes and also the great mock:endpoint. It would be a bit lengthy to describe how to do it in the mail. I think you best look into the tests of the jms component. They test very similar things. https://svn.apache

Unit test camel with activeMQ

2011-05-30 Thread hbellat
Hello, I used Junit for java program but I need some examples to understand how it works in camel with activeMQ I wrote a simple camel.xml as follow : http://camel.apache.org/schema/spring";>

Camel AWS component

2011-05-30 Thread abashev
Guys, I don't know is it will be useful for anybody but I did a little update for camel AWS component here https://github.com/abashev/camel-aws/commits/master Changes: - Components for SNS and SQS are working with 2.7.1 version - Add integration with Simple Email service (CAMEL-3591) - Add proce

RE: How to remove interceptors?

2011-05-30 Thread Marcos Díez Fernández
Thanks both, very helpful answers! BR, Marcos. View this message in context: http://camel.465427.n5.nabble.com/How-to-remove-interceptors-tp4431339p4432115.html Sent from the Camel - Users mailing list archive at Nabble.com.