Re: CXF - camel CXF

2009-12-01 Thread Charles Moulliard
Hi Willem,

To come back to REST implementation between Camel - CXF, can you tell me why
we cannot do the same thing (RESTfull services) that we can do for CXF web
service ?

Here is the camel route that I use in my camel osgi tutorial (part2)

camel:route
camel:from uri=cxf:bean:reportIncident /
camel:setHeader headerName=origin
camel:constantwebservice/camel:constant
/camel:setHeader
camel:convertBodyTo
type=org.apache.camel.example.reportincident.InputReportIncident /
camel:to uri=bean:webservice /
camel:inOnly uri=queuingservice:queue:in /
camel:transform
camel:method bean=feedback method=setOk /
/camel:transform

/camel:route

Charles Moulliard
Senior Enterprise Architect
Apache Camel Committer

*
blog : http://cmoulliard.blogspot.com
twitter : http://twitter.com/cmoulliard
Linkedlin : http://www.linkedin.com/in/charlesmoulliard

Apache Camel Group :
http://www.linkedin.com/groups?home=gid=2447439trk=anet_ug_hm


On Tue, Dec 1, 2009 at 3:41 AM, Willem Jiang willem.ji...@gmail.com wrote:

 Hi Charles,

 It really dependents on your use case.

 Here is an user case, if have bunch of back end (jaxrs:server) services,
 and you want to do a content based routing, you can user setup a camel
 cxfrsServer and let the client access this server. Then camel route will
  take care rest of things :)


 Willem

 Charles Moulliard wrote:

 If it makes no sense to use rsServer and rsClient both together in a camel
 route, what is the advantage to use a camel cxfrsServer endpoint over the
 jaxrs:server endpoint ?

 Regards,

 Charles Moulliard
 Senior Enterprise Architect
 Apache Camel Committer

 *
 blog : http://cmoulliard.blogspot.com
 twitter : http://twitter.com/cmoulliard
 Linkedlin : http://www.linkedin.com/in/charlesmoulliard

 Apache Camel Group :
 http://www.linkedin.com/groups?home=gid=2447439trk=anet_ug_hm


 On Mon, Nov 30, 2009 at 4:26 PM, Willem Jiang willem.ji...@gmail.com
 wrote:

  Oh, this test case just show how camel-cxfrs consumer and camel-cxfrs
 producer work together.

 It is not easy to write a bunch of tests to verify a camel-cxfrs consumer
 can response different request in a short time, so why not we create  a
 camel-cxfrs route in Camel to test the consumer and producer at the same
 time.

 Willem


 Charles Moulliard wrote:

  If you recommend to call directly the service from the POJO where we
 have
 added REST annotation, what is the purpose of this route presented as an
 example in camel-cxf test if the cxf:rsServer:bean:server endpoint can
 directly answer to a GET/PUT,POST, ... call ?

 route
 cxf:rsServer:bean:server/
 cxf:rsClient:bean:client/
 /route

 Regards,

 Charles Moulliard
 Senior Enterprise Architect
 Apache Camel Committer

 *
 blog : http://cmoulliard.blogspot.com
 twitter : http://twitter.com/cmoulliard
 Linkedlin : http://www.linkedin.com/in/charlesmoulliard

 Apache Camel Group :
 http://www.linkedin.com/groups?home=gid=2447439trk=anet_ug_hm


 On Mon, Nov 30, 2009 at 3:53 PM, Willem Jiang willem.ji...@gmail.com

 wrote:

  Hi Charles,

 You don't need to use the camel cxfrs route all the time, if you have
 to
  retrieve the DB for the REST request.

 You just need to define a POJO with annotation, and use OR mapping
 framework to implement retrieve or update the data for your service.
 You
 don't need to let camel be involved ;)

 Willem



 Charles Moulliard wrote:

  Hi,

 If camel is used in combination with CXF to handle REST services, How
 must
 be designed the POJOs managing the REST services ?

 eg. camel spring config

  cxf:rsServer id=rsServer address=/camel-rest-example/




 serviceClass=org.apache.camel.example.reportincident.restful.ReportIncidentService
 /

  cxf:rsClient id=rsClient address=http://localhost:8181/cxf/http/
 
 /

  camel:camelContext trace=true
  xmlns=http://camel.apache.org/schema/osgi;

  camel:route
  camel:from uri=cxfrs:bean:rsServer / // REST HTTP Service
 receiving the call from REST client and providing reply
  camel:bean ref=service method=getCustomer /
  camel:to uri=activemq:queue:IN/
  /camel:route

 camel:route
  camel:from uri=activemq:queue:IN /
  camel:to uri=cxfrs:bean:rsClient / // HTTP (internal
 client)
 who will generate HTTP reply using CXF - jaxrs:server component to
 cxfrs:bean:rsServer endpoint
  /camel:route

 Do we have to create two POJOs (one for the request and the other for
 the
 reply ?
 If this is the case, how the method must be defined to provide the
 REST
 info
 (request, parameters, ...) to the camel endpoint (= camel bean) who
 will
 be
 in charge to retrieve by example info from DB ? idem but for the
 method
 who
 will be send back the reply to the client calling the REST service ?

 ex : Request

  @GET
  

Re: CXF - camel CXF

2009-12-01 Thread Willem Jiang

It should work, but you need to some additional work.

As cxfrs producer uses the HttpClient API by default, it is different 
with the camel-cxf's client API, so you need to find some way to deal 
with the REST response object issue which you shows in CAMEL-2239.


In camel-example-cxf , we have an example[1] to show how to provides a 
service which support soap request and REST at same time.


[1]https://svn.apache.org/repos/asf/camel/trunk/examples/camel-example-cxf/src/main/java/org/apache/camel/example/cxf/jaxrs/CamelRouterBuilder.java

Willem

Charles Moulliard wrote:

Hi Willem,

To come back to REST implementation between Camel - CXF, can you tell me why
we cannot do the same thing (RESTfull services) that we can do for CXF web
service ?

Here is the camel route that I use in my camel osgi tutorial (part2)

camel:route
camel:from uri=cxf:bean:reportIncident /
camel:setHeader headerName=origin
camel:constantwebservice/camel:constant
/camel:setHeader
camel:convertBodyTo
type=org.apache.camel.example.reportincident.InputReportIncident /
camel:to uri=bean:webservice /
camel:inOnly uri=queuingservice:queue:in /
camel:transform
camel:method bean=feedback method=setOk /
/camel:transform

/camel:route

Charles Moulliard
Senior Enterprise Architect
Apache Camel Committer

*
blog : http://cmoulliard.blogspot.com
twitter : http://twitter.com/cmoulliard
Linkedlin : http://www.linkedin.com/in/charlesmoulliard

Apache Camel Group :
http://www.linkedin.com/groups?home=gid=2447439trk=anet_ug_hm


On Tue, Dec 1, 2009 at 3:41 AM, Willem Jiang willem.ji...@gmail.com wrote:


Hi Charles,

It really dependents on your use case.

Here is an user case, if have bunch of back end (jaxrs:server) services,
and you want to do a content based routing, you can user setup a camel
cxfrsServer and let the client access this server. Then camel route will
 take care rest of things :)


Willem

Charles Moulliard wrote:


If it makes no sense to use rsServer and rsClient both together in a camel
route, what is the advantage to use a camel cxfrsServer endpoint over the
jaxrs:server endpoint ?

Regards,

Charles Moulliard
Senior Enterprise Architect
Apache Camel Committer

*
blog : http://cmoulliard.blogspot.com
twitter : http://twitter.com/cmoulliard
Linkedlin : http://www.linkedin.com/in/charlesmoulliard

Apache Camel Group :
http://www.linkedin.com/groups?home=gid=2447439trk=anet_ug_hm


On Mon, Nov 30, 2009 at 4:26 PM, Willem Jiang willem.ji...@gmail.com

wrote:

 Oh, this test case just show how camel-cxfrs consumer and camel-cxfrs

producer work together.

It is not easy to write a bunch of tests to verify a camel-cxfrs consumer
can response different request in a short time, so why not we create  a
camel-cxfrs route in Camel to test the consumer and producer at the same
time.

Willem


Charles Moulliard wrote:

 If you recommend to call directly the service from the POJO where we

have
added REST annotation, what is the purpose of this route presented as an
example in camel-cxf test if the cxf:rsServer:bean:server endpoint can
directly answer to a GET/PUT,POST, ... call ?

route
cxf:rsServer:bean:server/
cxf:rsClient:bean:client/
/route

Regards,

Charles Moulliard
Senior Enterprise Architect
Apache Camel Committer

*
blog : http://cmoulliard.blogspot.com
twitter : http://twitter.com/cmoulliard
Linkedlin : http://www.linkedin.com/in/charlesmoulliard

Apache Camel Group :
http://www.linkedin.com/groups?home=gid=2447439trk=anet_ug_hm


On Mon, Nov 30, 2009 at 3:53 PM, Willem Jiang willem.ji...@gmail.com


wrote:


 Hi Charles,


You don't need to use the camel cxfrs route all the time, if you have
to
 retrieve the DB for the REST request.

You just need to define a POJO with annotation, and use OR mapping
framework to implement retrieve or update the data for your service.
You
don't need to let camel be involved ;)

Willem



Charles Moulliard wrote:

 Hi,


If camel is used in combination with CXF to handle REST services, How
must
be designed the POJOs managing the REST services ?

eg. camel spring config

 cxf:rsServer id=rsServer address=/camel-rest-example/




serviceClass=org.apache.camel.example.reportincident.restful.ReportIncidentService
/

 cxf:rsClient id=rsClient address=http://localhost:8181/cxf/http/

/

 camel:camelContext trace=true
 xmlns=http://camel.apache.org/schema/osgi;

 camel:route
 camel:from uri=cxfrs:bean:rsServer / // REST HTTP Service
receiving the call from REST client and providing reply
 camel:bean ref=service method=getCustomer /
 camel:to uri=activemq:queue:IN/
 /camel:route

camel:route
 camel:from uri=activemq:queue:IN /
 camel:to uri=cxfrs:bean:rsClient / // HTTP (internal
client)
who will generate HTTP reply using 

Re: performance issues with JMS transacted route...

2009-12-01 Thread Claus Ibsen
Hi

You need to post more details about your JMS and TX setup.
Which TX manager are you using? Do you use XA or not.
And the JMS broker I assume its AMQ but if not what is it?

BTW: The xpath thingy should be faster in 2.1 as we have removed a
hotspot which let it perform much better under concurrent load.


On Mon, Nov 30, 2009 at 7:40 PM, boday bo...@vektrel.com wrote:

 I have the following JMS transacted route...

 from(activemq:start?maxConcurrentConsumers=50transacted=true)
 .process(new ValidateMessage())
 .process(new SaveToDatabase())
 .to(activemq:finishedQueue);

 I assumed there would be a bit of overhead with using transactions, but my
 route goes from ~250 message/second to ~50 messages/second when I add the
 ?transacted=true to it (no other changes).

 I've seen similar performance hits when I added xpath (content based
 routing, etc) to my route (so I worked around it).  My processor
 SaveToDatabase does connect to a database (spring JDBC stored procedure
 call), but is not transactional itself.

 Overall, my goal is to simply make my route guarantee messaging (server
 crashes, restarts, etc) and maintain its high throughput.  Any other ideas?

 Has anyone else seen this type of drop in throughput with transacted
 messages?  I'm hoping it has something to do with the Tx manager
 configuration or something.  I'm using the default tx.xml file that shipped
 with Servicemix 3.3.1/Camel 2.0...

 note: this is a followup to another thread
 (http://old.nabble.com/guaranteed-message-processing-question...-to26202573.html#a26270332)

 thanks...

 -
 Ben - Senior Consultant

 --
 View this message in context: 
 http://old.nabble.com/performance-issues-with-JMS-transacted-route...-tp26579725p26579725.html
 Sent from the Camel - Users mailing list archive at Nabble.com.





-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus


Re: performance issues with JMS transacted route...

2009-12-01 Thread Claus Ibsen
Hi

Also which version of spring are you using? spring-jms is not really
performing well until late 2.5.x versions.

There is a bit snippet about caching and spring issues at
http://camel.apache.org/jms.html

And if using AMQ it has a ton of tuning parameters.
prefretch buffer need to be adjusted to fit your max 50 threads
settings etc. So it should be like 50 x 1000 or something.

Anyway you shouldnt see a drop in performance when turning transaction
on/off - unless using XA which is dead slow.


On Tue, Dec 1, 2009 at 11:39 AM, Claus Ibsen claus.ib...@gmail.com wrote:
 Hi

 You need to post more details about your JMS and TX setup.
 Which TX manager are you using? Do you use XA or not.
 And the JMS broker I assume its AMQ but if not what is it?

 BTW: The xpath thingy should be faster in 2.1 as we have removed a
 hotspot which let it perform much better under concurrent load.


 On Mon, Nov 30, 2009 at 7:40 PM, boday bo...@vektrel.com wrote:

 I have the following JMS transacted route...

 from(activemq:start?maxConcurrentConsumers=50transacted=true)
 .process(new ValidateMessage())
 .process(new SaveToDatabase())
 .to(activemq:finishedQueue);

 I assumed there would be a bit of overhead with using transactions, but my
 route goes from ~250 message/second to ~50 messages/second when I add the
 ?transacted=true to it (no other changes).

 I've seen similar performance hits when I added xpath (content based
 routing, etc) to my route (so I worked around it).  My processor
 SaveToDatabase does connect to a database (spring JDBC stored procedure
 call), but is not transactional itself.

 Overall, my goal is to simply make my route guarantee messaging (server
 crashes, restarts, etc) and maintain its high throughput.  Any other ideas?

 Has anyone else seen this type of drop in throughput with transacted
 messages?  I'm hoping it has something to do with the Tx manager
 configuration or something.  I'm using the default tx.xml file that shipped
 with Servicemix 3.3.1/Camel 2.0...

 note: this is a followup to another thread
 (http://old.nabble.com/guaranteed-message-processing-question...-to26202573.html#a26270332)

 thanks...

 -
 Ben - Senior Consultant

 --
 View this message in context: 
 http://old.nabble.com/performance-issues-with-JMS-transacted-route...-tp26579725p26579725.html
 Sent from the Camel - Users mailing list archive at Nabble.com.





 --
 Claus Ibsen
 Apache Camel Committer

 Author of Camel in Action: http://www.manning.com/ibsen/
 Open Source Integration: http://fusesource.com
 Blog: http://davsclaus.blogspot.com/
 Twitter: http://twitter.com/davsclaus




-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus


Re: No camel-clock? How does one test?

2009-12-01 Thread James Strachan
2009/12/1 Barry Kaplan grou...@memelet.com:
 Looking thru 2.1, there really aren't too many places where System.* time
 methods are used. Would Camel be interesting in patch that provides a clock
 abstraction (with just the two System.* time methods) where the default
 implementation would be System.*?

Sounds good to me! :)

 If so, what would be the camel way of providing access to the CamelClock to
 components? Via a static? Via Service (assuming that only components that
 extend Service would need the clock)? Or...?

I guess it could be injected via Ioc? Or available on the CamelContext I guess?

-- 
James
---
http://macstrac.blogspot.com/

Open Source Integration
http://fusesource.com/


Re: Camel: Graphical development tool for complex processors.

2009-12-01 Thread Claus Ibsen
On Tue, Dec 1, 2009 at 4:06 PM, titexe tit...@yahoo.fr wrote:

 Hello,

 it'is possible to know, if exist any graphical tool for developing complex
 processor ?


See the FUSE Integration Designer
http://fusesource.com/products/fuse-integration-designer/

Version 1.3 will support Camel 2.x out of the box with live debugging
capabilities.
So you can set a breakpoint on a EIP and step through the route.



 What you recommend for me to use?

 there's someone using Talend to develop these processors?

 Thank you in advance

 Best regards
 --
 View this message in context: 
 http://old.nabble.com/Camel%3A-Graphical-development-tool-for-complex-processors.-tp26593325p26593325.html
 Sent from the Camel - Users mailing list archive at Nabble.com.





-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus


Re: Using Guice with Camel

2009-12-01 Thread mumbly

So I managed to get rid of the error message. I'm not sure if it is possible
to make the error message more informative. For example, in a very similar
situation, I had an error message when I had a route builder with jms, when
I didn't have camel-jms loaded and I got:

1) Failed to resolve endpoint: jms://test.MyQueue due to: No component found
with scheme: jms
  while locating org.apache.camel.guice.GuiceCamelContext
  while locating org.apache.camel.CamelContext

Anyway, just a minor point.

I do have a couple of general questions in trying to understand things.

So is .beanRef() a Guice specific method or is it used for Spring, also? Or
is it simply built for using JNDI and it is just the fact that Guice acts as
a JNDI store backed by Guice beans?

And what is the thinking behind Guice JNDI? Is it just there to allow for a
simple way for retrieving beans that have been initialized by Guice without
carrying around the injector? I see that it is used to inject values that
have been defined in jndi.properties, but is it more generally usable to get
any and all Guice enhanced beans as long as they have been annotated? Do I
need to do anything other than annotate the bean? Will it serve to fully
build up the bean graph of all components associated with the bean annotated
with JMS?

--Tim


willem.jiang wrote:
 
 Hi,
 
   camel-guice has a jndi context which hold the reference of the JMS 
 component and the someBean. So you need to create that context in your 
 GuceServletConfig.
 
 You can find use code in the MyActivitor[1] about how to create that 
 context.
 
 [1] 
 https://svn.apache.org/repos/asf/camel/trunk/examples/camel-example-guice-jms/src/main/java/org/apache/camel/example/guice/jms/MyActivator.java
 
 Willem
 mumbly wrote:
 Thanks for all the help so far. You're example worked great.
 
 I'm running into an error when integrating the camel routes into a webapp
 where I use the guice servlet for initialization. I have the same set of
 changes you included in your diff, but the startup happens from a
 listener
 defined in web.xml and looking like:
 
 public class GuiceServletConfig extends GuiceServletContextListener {
 protected Injector getInjector() {
 Module camel = new MyModule();
 return Guice.createInjector(camel);
 }
 
 there is some other code in there, but I've tried it with this simple
 version. When I run, the error I get is:
 
 com.google.inject.CreationException: Guice creation errors:
 
   while locating org.apache.camel.guice.GuiceCamelContext
   while locating org.apache.camel.CamelContext
 
 1 error
  at
 com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:354)
  at
 com.google.inject.InjectorBuilder.injectDynamically(InjectorBuilder.java:179)
  at com.google.inject.InjectorBuilder.build(InjectorBuilder.java:113)
  at com.google.inject.Guice.createInjector(Guice.java:92)
  .
 
 Any thoughts on this? I've confirmed that both the camel-guice and
 camel-core jars are in the WEB-INF/lib.
 
 --Tim
  
 
 
 

-- 
View this message in context: 
http://old.nabble.com/Using-Guice-with-Camel-tp26517323p26594078.html
Sent from the Camel - Users mailing list archive at Nabble.com.



Re: performance issues with JMS transacted route...

2009-12-01 Thread boday

thanks Claus, that is exactly what I wanted to hear...

here is my setup...any advice would be appreciated...

JDK 1.6, ServiceMix 3.3.1, Camel 2.0 (patched the
/hotdeploy/servicemix-camel.zip)
AMQ 5.2 (persistent, small 1k messages, 250+ msg/second, no XA Tx)
Jenks AMQ pool 2.1, Spring 2.5.6

http://old.nabble.com/file/p26594255/tx.xml tx.xml 
http://old.nabble.com/file/p26594255/activemq.xml activemq.xml 
http://old.nabble.com/file/p26594255/servicemix.xml servicemix.xml 

// setup the ActiveMQ component
ActiveMQConnectionFactory queueConnectionFactory = new
ActiveMQConnectionFactory(tcp://localhost:61616);
PooledConnectionFactory pcf = new
PooledConnectionFactory(queueConnectionFactory);
pcf.setMaxConnections(50);

ActiveMQComponent amq =
ActiveMQComponent.activeMQComponent(tcp://localhost:61616);
amq.setConnectionFactory(pcf);
amq.setMaxMessagesPerTask(-1);
amq.setMaxConcurrentConsumers(50);
amq.setCacheLevelName(CACHE_CONSUMER);
amq.setAcknowledgementModeName(AUTO_ACKNOWLEDGE);
getContext().addComponent(activemq, amq);

My route does the following...

@Produce(uri = activemq:inbound)
ProducerTemplate inboundProducer;

@Consume(uri = jetty:http://0.0.0.0:9001/inboundMessage/;)
@InOnly
public void onMessage(String message)
{
String addressID = getAttributeValueFromXML(message,addr);

//set the JMSXGroupID appropriately to enable AMQ MessageGroups
(guaranteed ordering)
inboundProducer.sendBodyAndHeader(message, JMSXGroupID, addressID);
}

from(activemq:inbound?transacted=truemaxConcurrentConsumers=50)
.process(new ValidateMessage())
.process(new SaveToDatabase())
.to(activemq:topic:outbound); 

Questions...

how do I set the prefetch buffer?
what Tx manager should I be using and how do I set it up?
should I be using newer versions of any components?

thanks again...




-
Ben - Senior Consultant

-- 
View this message in context: 
http://old.nabble.com/performance-issues-with-JMS-transacted-route...-tp26579725p26594255.html
Sent from the Camel - Users mailing list archive at Nabble.com.



NullPointerException in FileComponent

2009-12-01 Thread erh

I'm getting errors like this in my application:

[2009-12-01 05:53:21,813][WARN][Thread: 2
org.apache.camel.component.file.filecompon...@62681b][camel.impl.scheduledpollconsumer(ScheduledPollConsumer)-run(68)]:
An exception occured while polling:
Endpoint[file:data/input?consumer.recursive=falselock=trueconsumer.exclusiveReadLock=truenoop=true]:
null
java.lang.NullPointerException

Unfortunately, there is no stack trace, and by the time I noticed there was
a problem my logs had rolled over so I don't know what my app was doing when
this started.  I know this isn't much to go on, but does anyone have any
suggestions for what might cause this?

I am using Camel 1.6.2-SNAPSHOT, build #194.  My endpoint looks like:
endpoint id=input_dir_endpoint
uri=file:data/input?consumer.recursive=falseamp;lock=trueamp;consumer.exclusive
ReadLock=trueamp;noop=true /
...
route
   from ref=input_dir_endpoint/
   to uri=bean:filemonitor?method=process/
/route

Thanks,
eric
-- 
View this message in context: 
http://old.nabble.com/NullPointerException-in-FileComponent-tp26594231p26594231.html
Sent from the Camel - Users mailing list archive at Nabble.com.



Re: camel - consumer don't get message from activemq queue

2009-12-01 Thread marcin80

Hi, 

Thanks for your response Ashwin.
It works:)

Cheers,
Marcin
-- 
View this message in context: 
http://old.nabble.com/camel---consumer-don%27t-get-message-from-activemq-queue-tp26576953p26594234.html
Sent from the Camel - Users mailing list archive at Nabble.com.



Re: How to break from routing slip in camel on exception?

2009-12-01 Thread Jon Anstey
Just took a look into this and found that setting the Exception on the
Exchange doesn't really break you out of the routing slip as you want. I'm
gonna fix that up on the trunk. But, throwing an Exception from a recipient
does stop the routing slip. See this test case for an example
http://svn.apache.org/repos/asf/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/routingslip/RoutingSlipWithExceptionTest.java

On Tue, Dec 1, 2009 at 1:34 PM, murugess msan...@gmail.com wrote:


 We are using camel binding component, with camel version 1.6.1.0, on
 servicemix for our project. We are leveraging dynamic routing slip in camel
 to process our request and are facing issues related to exception handling.
 We have already defined global errorHandler which handles any exception
 that
 occurs in any of the route. Now, whenever an exception occurs in any of the
 endpoints within routing slip, exception handler is called as expected but
 then once the exceptionHandler route is finished, control comes back to the
 routingslip and rest of the endpoints get executed. No matter what we set
 on
 exception route ( such as handled=false), all the endpoints in routing slip
 eventually gets called. Here is the code snippet from RoutingSlip :


  for (String nextRecipient : recipients) {
EndpointExchange endpoint = resolveEndpoint(exchange,
 nextRecipient);
ProducerExchange producer =
 producerCache.getProducer(endpoint);
Exchange ex = current.newInstance();

updateRoutingSlip(current);
copyOutToIn(ex, current);

producer.process(ex);

current = ex;
}



We don't see any provision to break from the above loop. Right now, the
 work around we have adopted is to set EXCEPTION_HANDLED_PROPERTY on the
 exchange so that the pipeline class does not delegate the request to the
 actual endpoint. But there is still an overhead of pipeline being called
 for
 all the endpoints configured within the routing slip.

Any suggestions are welcome.
 --
 View this message in context:
 http://old.nabble.com/How-to-break-from-routing-slip-in-camel-on-exception--tp26594251p26594251.html
 Sent from the Camel - Users mailing list archive at Nabble.com.




-- 
Cheers,
Jon

Camel in Action: http://manning.com/ibsen
Blog: http://janstey.blogspot.com


Re: No camel-clock? How does one test?

2009-12-01 Thread Barry Kaplan


James.Strachan wrote:
 
 I guess it could be injected via Ioc? Or available on the CamelContext I
 guess?
 

But there is no camel wide IOC in place, is there? I look if the
CamelContext is available in the places where the CamelClock is need. (Now
if only I didn't have play find my non-published dependency every time I
do an svn-update ;-)

-- 
View this message in context: 
http://old.nabble.com/No-camel-clock--How-does-one-test--tp26583664p26597741.html
Sent from the Camel - Users mailing list archive at Nabble.com.



Re: How to break from routing slip in camel on exception?

2009-12-01 Thread murugess

I think I am using the older version of camel ( 1.6.1.0) which does not have
the fix for breaking the routingslip when exception is thrown by the
recipient. I guess I need to upgrade to the latest version. Thanks for the
quick fix.



janstey wrote:
 
 FYI I've fixed this on the trunk here
 http://svn.apache.org/viewvc?rev=885876view=rev
 
 On Tue, Dec 1, 2009 at 3:39 PM, Jon Anstey jans...@gmail.com wrote:
 
 Just took a look into this and found that setting the Exception on the
 Exchange doesn't really break you out of the routing slip as you want.
 I'm
 gonna fix that up on the trunk. But, throwing an Exception from a
 recipient
 does stop the routing slip. See this test case for an example
 http://svn.apache.org/repos/asf/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/routingslip/RoutingSlipWithExceptionTest.java


 On Tue, Dec 1, 2009 at 1:34 PM, murugess msan...@gmail.com wrote:


 We are using camel binding component, with camel version 1.6.1.0, on
 servicemix for our project. We are leveraging dynamic routing slip in
 camel
 to process our request and are facing issues related to exception
 handling.
 We have already defined global errorHandler which handles any exception
 that
 occurs in any of the route. Now, whenever an exception occurs in any of
 the
 endpoints within routing slip, exception handler is called as expected
 but
 then once the exceptionHandler route is finished, control comes back to
 the
 routingslip and rest of the endpoints get executed. No matter what we
 set
 on
 exception route ( such as handled=false), all the endpoints in routing
 slip
 eventually gets called. Here is the code snippet from RoutingSlip :


  for (String nextRecipient : recipients) {
EndpointExchange endpoint = resolveEndpoint(exchange,
 nextRecipient);
ProducerExchange producer =
 producerCache.getProducer(endpoint);
Exchange ex = current.newInstance();

updateRoutingSlip(current);
copyOutToIn(ex, current);

producer.process(ex);

current = ex;
}



We don't see any provision to break from the above loop. Right now,
 the
 work around we have adopted is to set EXCEPTION_HANDLED_PROPERTY on the
 exchange so that the pipeline class does not delegate the request to the
 actual endpoint. But there is still an overhead of pipeline being called
 for
 all the endpoints configured within the routing slip.

Any suggestions are welcome.
 --
 View this message in context:
 http://old.nabble.com/How-to-break-from-routing-slip-in-camel-on-exception--tp26594251p26594251.html
 Sent from the Camel - Users mailing list archive at Nabble.com.




 --
 Cheers,
 Jon

 Camel in Action: http://manning.com/ibsen
 Blog: http://janstey.blogspot.com

 
 
 
 -- 
 Cheers,
 Jon
 
 Camel in Action: http://manning.com/ibsen
 Blog: http://janstey.blogspot.com
 
 

-- 
View this message in context: 
http://old.nabble.com/How-to-break-from-routing-slip-in-camel-on-exception--tp26594251p26597746.html
Sent from the Camel - Users mailing list archive at Nabble.com.



Potential bug in camel jms

2009-12-01 Thread Christian Schneider

Hi,

I am using the camel jms component to do soap/jms. I was using the 
option useMessageIDAsCorrelationID=true. This way Iwanted my client to 
set the message id as correlation id when doing a request.

This worked well.

The problem was that when the same jms component was used as a server 
this option was also effective. When the client sent in a message with a 
correlation id that did not match the message id then the camel server 
component still sent the message back with correlation id set to the 
message id. I think in the server case this is wrong. When the server 
receives a message with a correlation id set it should reply with the 
same correlation id. Am I correct here?


In any case it was easy to solve thee problem by simply turning this 
option off but I still think this is a bug.


If necessary I can provide an example project.

Greetings

Christian

--

Christian Schneider
---
http://www.liquid-reality.de