How many Escape characters in Camel

2013-03-28 Thread liugang
Hi All:

Does anybody can give me a link or an answer about this problem: 
How many Escape characters in Camel ?

For example, if I want to send an email, and the password includes '&', then I 
have to use & right? 


Thanks.
Gangliu



Re: Need help with cxfrs component, actually RESTful service consumption, in general

2013-03-28 Thread Willem jiang
Hi,

If you have used CXF before, you can reuse most of you knowledge about the CXF 
in camel-cxfrs or camel-cxf component.
If you just want to access the RESTful service from examples, you can take a 
look at some unit tests[1] in the camel-cxfrs.

[1]https://svn.apache.org/repos/asf/camel/trunk/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducerTest.java
  

--  
Willem Jiang

Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://www.fusesource.com | http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) 
(English)
  http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem




On Friday, March 29, 2013 at 6:35 AM, Chris Wolf wrote:

> So I have the book, "Camel In Action", which is a very good and
> thorough treatment of camel-core. However, now my development efforts
> are starting to hit severe turbulence upon making the jump from
> camel-core to camel-cxf, in particular, how to consume a RESTful
> service?
>  
> I read these:
> http://camel.apache.org/cxfrs.html
> http://camel.apache.org/cxf-bean-component.html
>  
> ...but these pages seem to be reference pages for people who have
> already mastered camel-cxfrs - not newbies, like me. Can anyone point
> me to an end-to-end example? I don't need the server-side - this is
> legacy and produces XML.
>  
> N.B. Outside of Camel, I have had much previous experience using CXF
> for JAX-WS style services, client and server (never JAX-RS, though)
>  
> Thanks for any help,
>  
> -Chris  




Need help with cxfrs component, actually RESTful service consumption, in general

2013-03-28 Thread Chris Wolf
So I have the book, "Camel In Action", which is a very good and
thorough treatment of camel-core. However, now my development efforts
are starting to hit severe turbulence upon making the jump from
camel-core to camel-cxf, in particular, how to consume a RESTful
service?

I read these:
http://camel.apache.org/cxfrs.html
http://camel.apache.org/cxf-bean-component.html

...but these pages seem to be reference pages for people who have
already mastered camel-cxfrs - not newbies, like me.  Can anyone point
me to an end-to-end example?  I don't need the server-side - this is
legacy and produces XML.

N.B. Outside of Camel, I have had much previous experience using CXF
for JAX-WS style services, client and server  (never JAX-RS, though)

Thanks for any help,

  -Chris


Change ErrorHandlerFactory of a route runtime

2013-03-28 Thread shindito
Hello,

is Camel capable of the following:
I have a CamelContext with several routes defined and running. I have
specified an ErrorHandlerFactory in the CamelContext (e.g. a
DefautlErrorHandlerBuilder with maximumRedeliveries, redeliveryProcessor,
and redeliverDelay properties defined) so that all routes created from this
context inherit the ErrorHandlerFactory (DefaultErrorHandlerBuilder). 
Now, I want to update all running routes with a DeadLetterChannel error
handler (remove the default one!). How is this achievable?
I've tried the following:
1. Stop context -> context.setErrorHandlerBuilder(dlc) -> context.start()
2. Stop all routes -> for each route setErrorHandlerBuilder(dlc) -> start
all routes
3. Stop context -> stop all routes -> context.setErrorHandlerBuilder(dlc) ->
for each route setErrorHandlerBuilder(dlc) -> start routes and context

In all cases the old error handler is still active and gets activated if an
error occurs. I've debugged the routes (in case 2. and 4. for example) and
they are successfully updated with the dlc, however, the old handler is
still active and the dlc is not used at all in case of a failure.

Any ideas how to update the error handler runtime?

Thanks for your help and advices!!!

Best regards,
Atanas



--
View this message in context: 
http://camel.465427.n5.nabble.com/Change-ErrorHandlerFactory-of-a-route-runtime-tp5730057.html
Sent from the Camel - Users mailing list archive at Nabble.com.


idempotentkey available from 2.11 ???

2013-03-28 Thread ganeshkumar.kanagavel
Hi Clauss,
Based on the documentation it looks like idempotentkey is available from 2.11 , 
does that mean we have to wait for 2.11 release?

idempotentKey

Expression

Camel 2.11: To use a custom idempotent key. By default the absolute path of the 
file is used. You can use the File 
Language, for example to use the 
file name and file size, you can do:

idempotentKey=${file:name}-${file:size}



Thanks
Ganesh

___

This message may contain information that is confidential or privileged. If you 
are not an intended recipient of this message, please delete it and any 
attachments, and notify the sender that you have received it in error. Unless 
specifically stated in the message or otherwise indicated, you may not 
duplicate, redistribute or forward this message or any portion thereof, 
including any attachments, by any means to any other person, including any 
retail investor or customer. This message is not a recommendation, advice, 
offer or solicitation, to buy/sell any product or service, and is not an 
official confirmation of any transaction. Any opinions presented are solely 
those of the author and do not necessarily represent those of Barclays.

This message is subject to terms available at: www.barclays.com/emaildisclaimer 
and, if received from Barclays' Sales or Trading desk, the terms available at: 
www.barclays.com/salesandtradingdisclaimer/. By messaging with Barclays you 
consent to the foregoing. Barclays Bank PLC is a company registered in England 
(number 1026167) with its registered office at 1 Churchill Place, London, E14 
5HP. This email may relate to or be sent from other members of the Barclays 
group.

___


Re: How can I perform immediate shutdown of a context and all it's routes and services, etc.?

2013-03-28 Thread Chris Wolf
On Thu, Mar 28, 2013 at 3:36 AM, Claus Ibsen  wrote:
[...]
>> have expected.  Is there a way to restart
>> the route from the top upon resuming?  Or do you recommend any other
>> "busy work" kind of route to use
>> for RoutePolicy testing?
>>
>
> The route only runs if there is messages available on the seda queue.
> So send a message to the "seda:foo" queue to have it route that
> message.
[...]

I'm new to this, but by now, I should have known that - sorry and
thanks again for the help!


Re: Processor can't receive exchange !

2013-03-28 Thread Christian Müller
Try exchange.getIn() instead of exchange.getOut().

Sent from a mobile device
Am 28.03.2013 20:23 schrieb "takidean" :

> hi
> everything goes well with my jdbc connection and my routes but i have to
> receive data from my exchange i don't know where is the problem with my
> processor here
>
> public void configure() {
>/*   from("file:src/data?noop=true")
> .to("jms:queue:Orders")
>  .bean(OrderToOracle.class, "toSql")
>   .to("jdbc:ds");*/
>from("file:src/data?noop=true")
>.choice()
>.when(xpath("/person/city = 'London'"))
> .setBody().constant("SELECT * FROM `examen`.`user` WHERE `user`.`name` =
> 'tt';")
>
>.to("jdbc:ds").process(new Processor() {
>
> @Override
> public void process(Exchange exchange)
> throws Exception {
>
>
> List> data =
> exchange.getOut().getBody(List.class);
> Map row =
> data.get(0);
>
> System.out.println("*nom="+row.get("lastname")) ;
> }
> })
>
>
>.otherwise()
>.to("file:target/messages/others");
>
> }
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Processor-can-t-receive-exchange-tp5730048.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


RE: JASYPT String Decryption

2013-03-28 Thread ganeshkumar.kanagavel
Thanks Ibsen, I followed the below steps and it works like Charm‼!

The original password we have will be encrypted with the master password.

F:\Camel\apache-camel-2.10.3\lib>java -jar camel-jasypt-2.10.3.jar -c encrypt 
-p secret -i Ganesh
Encrypted text: wJdhCP0vS8ynUrUSDVwF1Q==

The Encrypted text value can be stored in the 100 byte of string in the 
database( mainly for FTP process). The following changes are done to integrate 
the Jasypt into the application.

1.  Bean Definition

  

  

2.  Inject bean into any class.






3.  Get hold of the parser and decrypt the value back.

  String password = jasyptparser.parseProperty(null, 
"ENC(ys8/O1bndJr4C046uHignHm4gTTCSmnl)", null);
System.out.println(password);


-Original Message-
From: Claus Ibsen [mailto:claus.ib...@gmail.com]
Sent: Thursday, March 28, 2013 2:14 AM
To: users@camel.apache.org
Subject: Re: JASYPT String Decryption

On Wed, Mar 27, 2013 at 10:47 PM,  
mailto:ganeshkumar.kanaga...@barclays.com>> 
wrote:
> Hi,
> Please advise if anyone know how to decrypt the jasyped value inside a class ?
>
> We are planning to encrypt the password values using jasypt and store in a 
> Databases.
>
> We want to decrypt the value back inside a bean class. Please advise
> if it's possible
>

Hi

You can use this method from CamelContext
http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/CamelContext.html#resolvePropertyPlaceholders(java.lang.String)

and just put in the value in the method as you would do in the endpoint uris, 
eg with ENC(value) around the value.
http://camel.apache.org/jasypt

An alternative is to get hold of the JasyptPropertiesParser and use its API 
http://camel.apache.org/jasypt


Or use the Jasypt library without Camel.




> Thanks
> Ganesh
>
> ___
>
> This message may contain information that is confidential or privileged. If 
> you are not an intended recipient of this message, please delete it and any 
> attachments, and notify the sender that you have received it in error. Unless 
> specifically stated in the message or otherwise indicated, you may not 
> duplicate, redistribute or forward this message or any portion thereof, 
> including any attachments, by any means to any other person, including any 
> retail investor or customer. This message is not a recommendation, advice, 
> offer or solicitation, to buy/sell any product or service, and is not an 
> official confirmation of any transaction. Any opinions presented are solely 
> those of the author and do not necessarily represent those of Barclays.
>
> This message is subject to terms available at: 
> www.barclays.com/emaildisclaimer 
> and, if received from Barclays' Sales or Trading desk, the terms available 
> at: 
> www.barclays.com/salesandtradingdisclaimer/.
>  By messaging with Barclays you consent to the foregoing. Barclays Bank PLC 
> is a company registered in England (number 1026167) with its registered 
> office at 1 Churchill Place, London, E14 5HP. This email may relate to or be 
> sent from other members of the Barclays group.
>
> ___



--
Claus Ibsen
-
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cib...@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


___

This message may contain information that is confidential or privileged. If you 
are not an intended recipient of this message, please delete it and any 
attachments, and notify the sender that you have received it in error. Unless 
specifically stated in the message or otherwise indicated, you may not 
duplicate, redistribute or forward this message or any portion thereof, 
including any attachments, by any means to any other person, including any 
retail investor or customer. This message is not a recommendation, advice, 
offer or solicitation, to buy/sell any product or service, and is not an 
official confirmation of any transaction. Any opinions presented are solely 
those of the author and do not necessarily represent those of Barclays.

This message is subject to terms available at: www.barclays.com/emaildisclaimer 
and, if received from Barclays' Sales or Trading desk, the terms available at: 
www.barclays.com/salesandtradingdisclaimer/. By messaging with Barclays you 
consent to the foregoing. Barclays Bank PLC is a company registered in England 
(number 1026167) with its registered office at 1 Churchill Place, London, E14 
5HP. This email may relate to or be sent from other members of the Barclays 
group.

___


Ciphers with camel-sftp

2013-03-28 Thread lleclerc
Hi,

How can I have access to more ciphers with camel-sftp ?

Here is some log of it working displaying the available ciphers : 

2013-03-28 14:49:04,619 INFO  [SftpOperations] JSCH -> kex: client:
diffie-hellman-group1-sha1,diffie-hellman-group-exchange-sha1
2013-03-28 14:49:04,619 INFO  [SftpOperations] JSCH -> kex: client:
ssh-rsa,ssh-dss
2013-03-28 14:49:04,619 INFO  [SftpOperations] JSCH -> kex: client:
aes128-ctr,aes128-cbc,3des-ctr,3des-cbc,blowfish-cbc
2013-03-28 14:49:04,620 INFO  [SftpOperations] JSCH -> kex: client:
aes128-ctr,aes128-cbc,3des-ctr,3des-cbc,blowfish-cbc
2013-03-28 14:49:04,620 INFO  [SftpOperations] JSCH -> kex: client:
hmac-md5,hmac-sha1,hmac-sha2-256,hmac-sha1-96,hmac-md5-96
2013-03-28 14:49:04,620 INFO  [SftpOperations] JSCH -> kex: client:
hmac-md5,hmac-sha1,hmac-sha2-256,hmac-sha1-96,hmac-md5-96

Thanks,



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


Re: fail to transform from file to jms

2013-03-28 Thread Claus Ibsen
Hi

What do you do in your bean?
   .bean(OrderToOracle.class, "toSql")

What method signature does the toSql method have?

The exception indicate you use a @XPath annotation on one of the
paramaters and its value is empty, but a number was expected.

On Thu, Mar 28, 2013 at 2:11 PM, takidean  wrote:
> hi i used to send file to a jms queu this is my code an then error:
>
> /code*/
>  public void configure() {
> from("file:src/data?noop=true")
> .choice()
> .when(xpath("/person/city ='SFIN'"))
> .to("jms:queue:Orders")
>
>.otherwise()
> .to("file:target/messages/others");
>
> from("jms:queue:Orders")
>  .bean(OrderToOracle.class, "toSql")
>   // .setBody(constant("INSERT INTO user
> values('tA','bb','v');"))
>   .to("jdbc:ds");
>
> }
> /*** Errors/
>
>
> [hread #1 - JmsConsumer[Orders]] DefaultErrorHandlerERROR Failed
> delivery for (MessageId: ID:unknown-PC-2544-1364475709718-2:0:1:1:1 on
> ExchangeId: ID-unknown-PC-2555-1364476033077-0-3). Exhausted after delivery
> attempt: 1 caught: org.apache.camel.TypeConversionException: Error during
> type conversion from type:
> com.sun.org.apache.xml.internal.dtm.ref.DTMNodeList to the required type:
> int with value com.sun.org.apache.xml.internal.dtm.ref.DTMNodeList@e9af03
> due java.lang.NumberFormatException: For input string: ""
> org.apache.camel.TypeConversionException: Error during type conversion from
> type: com.sun.org.apache.xml.internal.dtm.ref.DTMNodeList to the required
> type: int with value
> com.sun.org.apache.xml.internal.dtm.ref.DTMNodeList@e9af03 due
> java.lang.NumberFormatException: For input string: ""
> at
> org.apache.camel.impl.converter.BaseTypeConverterRegistry.convertTo(BaseTypeConverterRegistry.java:126)[camel-core-2.10.4.jar:2.10.4]
> at
> org.apache.camel.util.ExchangeHelper.convertToType(ExchangeHelper.java:199)[camel-core-2.10.4.jar:2.10.4]
> at
> org.apache.camel.builder.xml.XPathBuilder.evaluate(XPathBuilder.java:728)[camel-core-2.10.4.jar:2.10.4]
> at
> org.apache.camel.builder.xml.XPathBuilder.evaluate(XPathBuilder.java:154)[camel-core-2.10.4.jar:2.10.4]
> at
> org.apache.camel.component.bean.MethodInfo$2.evaluateParameterBinding(MethodInfo.java:530)[camel-core-2.10.4.jar:2.10.4]
> at
> org.apache.camel.component.bean.MethodInfo$2.evaluate(MethodInfo.java:429)[camel-core-2.10.4.jar:2.10.4]
> at
> org.apache.camel.component.bean.MethodInfo.createMethodInvocation(MethodInfo.java:209)[camel-core-2.10.4.jar:2.10.4]
> at
> org.apache.camel.component.bean.BeanInfo.createInvocation(BeanInfo.java:230)[camel-core-2.10.4.jar:2.10.4]
> at
> org.apache.camel.component.bean.BeanInfo.createInvocation(BeanInfo.java:160)[camel-core-2.10.4.jar:2.10.4]
> at
> org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:143)[camel-core-2.10.4.jar:2.10.4]
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[camel-core-2.10.4.jar:2.10.4]
> at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)[camel-core-2.10.4.jar:2.10.4]
> at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[camel-core-2.10.4.jar:2.10.4]
> at
> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)[camel-core-2.10.4.jar:2.10.4]
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[camel-core-2.10.4.jar:2.10.4]
> at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)[camel-core-2.10.4.jar:2.10.4]
> at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[camel-core-2.10.4.jar:2.10.4]
> at
> org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:91)[camel-core-2.10.4.jar:2.10.4]
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[camel-core-2.10.4.jar:2.10.4]
> at
> org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:334)[camel-core-2.10.4.jar:2.10.4]
> at
> org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:220)[camel-core-2.10.4.jar:2.10.4]
> at
> org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:46)[camel-core-2.10.4.jar:2.10.4]
> at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[camel-core-2.10.4.jar:2.10.4]
> at
> org.apache.camel.processor.interceptor.DefaultChannel.process(DefaultChannel.java:308)[camel-core-2.10.4.jar:2.10.4]
> at
> org.apache.camel.util

fail to transform from file to jms

2013-03-28 Thread takidean
hi i used to send file to a jms queu this is my code an then error:

/code*/
 public void configure() {
from("file:src/data?noop=true")
.choice()
.when(xpath("/person/city ='SFIN'"))
.to("jms:queue:Orders")

   .otherwise()
.to("file:target/messages/others");

from("jms:queue:Orders")
 .bean(OrderToOracle.class, "toSql")
  // .setBody(constant("INSERT INTO user
values('tA','bb','v');"))
  .to("jdbc:ds");
   
}
/*** Errors/


[hread #1 - JmsConsumer[Orders]] DefaultErrorHandlerERROR Failed
delivery for (MessageId: ID:unknown-PC-2544-1364475709718-2:0:1:1:1 on
ExchangeId: ID-unknown-PC-2555-1364476033077-0-3). Exhausted after delivery
attempt: 1 caught: org.apache.camel.TypeConversionException: Error during
type conversion from type:
com.sun.org.apache.xml.internal.dtm.ref.DTMNodeList to the required type:
int with value com.sun.org.apache.xml.internal.dtm.ref.DTMNodeList@e9af03
due java.lang.NumberFormatException: For input string: ""
org.apache.camel.TypeConversionException: Error during type conversion from
type: com.sun.org.apache.xml.internal.dtm.ref.DTMNodeList to the required
type: int with value
com.sun.org.apache.xml.internal.dtm.ref.DTMNodeList@e9af03 due
java.lang.NumberFormatException: For input string: ""
at
org.apache.camel.impl.converter.BaseTypeConverterRegistry.convertTo(BaseTypeConverterRegistry.java:126)[camel-core-2.10.4.jar:2.10.4]
at
org.apache.camel.util.ExchangeHelper.convertToType(ExchangeHelper.java:199)[camel-core-2.10.4.jar:2.10.4]
at
org.apache.camel.builder.xml.XPathBuilder.evaluate(XPathBuilder.java:728)[camel-core-2.10.4.jar:2.10.4]
at
org.apache.camel.builder.xml.XPathBuilder.evaluate(XPathBuilder.java:154)[camel-core-2.10.4.jar:2.10.4]
at
org.apache.camel.component.bean.MethodInfo$2.evaluateParameterBinding(MethodInfo.java:530)[camel-core-2.10.4.jar:2.10.4]
at
org.apache.camel.component.bean.MethodInfo$2.evaluate(MethodInfo.java:429)[camel-core-2.10.4.jar:2.10.4]
at
org.apache.camel.component.bean.MethodInfo.createMethodInvocation(MethodInfo.java:209)[camel-core-2.10.4.jar:2.10.4]
at
org.apache.camel.component.bean.BeanInfo.createInvocation(BeanInfo.java:230)[camel-core-2.10.4.jar:2.10.4]
at
org.apache.camel.component.bean.BeanInfo.createInvocation(BeanInfo.java:160)[camel-core-2.10.4.jar:2.10.4]
at
org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:143)[camel-core-2.10.4.jar:2.10.4]
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[camel-core-2.10.4.jar:2.10.4]
at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)[camel-core-2.10.4.jar:2.10.4]
at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[camel-core-2.10.4.jar:2.10.4]
at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)[camel-core-2.10.4.jar:2.10.4]
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[camel-core-2.10.4.jar:2.10.4]
at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)[camel-core-2.10.4.jar:2.10.4]
at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[camel-core-2.10.4.jar:2.10.4]
at
org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:91)[camel-core-2.10.4.jar:2.10.4]
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[camel-core-2.10.4.jar:2.10.4]
at
org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:334)[camel-core-2.10.4.jar:2.10.4]
at
org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:220)[camel-core-2.10.4.jar:2.10.4]
at
org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:46)[camel-core-2.10.4.jar:2.10.4]
at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[camel-core-2.10.4.jar:2.10.4]
at
org.apache.camel.processor.interceptor.DefaultChannel.process(DefaultChannel.java:308)[camel-core-2.10.4.jar:2.10.4]
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[camel-core-2.10.4.jar:2.10.4]
at
org.apache.camel.processor.Pipeline.process(Pipeline.java:117)[camel-core-2.10.4.jar:2.10.4]
at
org.apache.camel.processor.Pipeline.process(Pipeline.java:80)[camel-core-2.10.4.jar:2.10.4]
at
org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:46)[camel-core-2.10.4.jar:2.10.4]
 

Processor can't receive exchange !

2013-03-28 Thread takidean
hi 
everything goes well with my jdbc connection and my routes but i have to
receive data from my exchange i don't know where is the problem with my
processor here

public void configure() {
   /*   from("file:src/data?noop=true")
.to("jms:queue:Orders")
 .bean(OrderToOracle.class, "toSql")
  .to("jdbc:ds");*/
   from("file:src/data?noop=true")
   .choice()
   .when(xpath("/person/city = 'London'"))
.setBody().constant("SELECT * FROM `examen`.`user` WHERE `user`.`name` =
'tt';")

   .to("jdbc:ds").process(new Processor() {

@Override
public void process(Exchange exchange) throws 
Exception {


List> data =
exchange.getOut().getBody(List.class);
Map row = data.get(0);

System.out.println("*nom="+row.get("lastname")) ;
}
})
   

   .otherwise()
   .to("file:target/messages/others");

}



--
View this message in context: 
http://camel.465427.n5.nabble.com/Processor-can-t-receive-exchange-tp5730048.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: unmarshal JSON to Map/List of Strings

2013-03-28 Thread tosheer
Hi All,

I have found a very simple solution to this problem.

if we write 
.unmarshal(new JacksonDataFormat(Map.class))

it will get the JSON in the body and try to map this to a Map object. It
will successfully map the Json if immediate children of key value type and
not of the List type. it will throw a data transformation exception if you
provide a wrong data type.

Thanks
Tosheer



--
View this message in context: 
http://camel.465427.n5.nabble.com/unmarshal-JSON-to-Map-List-of-Strings-tp5721600p5730050.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Refering implicitly to routeContext

2013-03-28 Thread edvicif
Hi

I want to develop an interceptor, which I can turn on on demand using spring
DSL, by adding the xml file to the spring configuration list.

So what I want to have
myInterceptor.xml


  
  


Sometimes I want to run configs: normal-config.xml
but sometimgs normal-config.xml,myInterceptor.xml

I was only able to find examples, that I explicit refer to these context
through:

 in the camelContext node. But I want to avoid it
as I don't want to modify the original camelContext definition.

The camelContext has packageScan and contextScan function. I was able to
achieve my goal with that to dynamically add route. Unfortunately I have to
define the route using JAVA.

Can I achieve somehow, that if I list of the XML files for Spring and
contains route definitions beans they add them self to the camelContext?

I understand there will be an issue, when I define multiple camel context.

Other think I realized that if I want to define an interceptor in
routeContext I must define a dummy from, to node before the interceptor
definition. Am I doing something wrong here?



--
View this message in context: 
http://camel.465427.n5.nabble.com/Refering-implicitly-to-routeContext-tp5730047.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Clearing ThreadLocal when exchange completes

2013-03-28 Thread Raul Kripalani
But isn't it the same with the Synchronization approach? In all cases,
special caution is required when the Async Routing Engine kicks in, or when
threadpool-based EIPs are involved. I mentioned it in my first reply.

Regards,
Raúl.

On Thu, Mar 28, 2013 at 11:25 AM, Claus Ibsen  wrote:

> On Thu, Mar 28, 2013 at 9:36 AM, Raul Kripalani  wrote:
> > With this technique, developers  have to remember to add the custom
> > processor at the start of each route. (Unless it's set from an
> > interceptor...).
> >
> > Since the user explicitly asked for a non intrusive technique,
> > EventNotifier is the only method that fulfills that requirement. Set once
> > per Camel context and forget about it.
> >
> > And it's higher level, not fiddling with internal APIs.
> >
>
> That would only work if its the same thread that calls the listener at
> exchange created and exchange done events. As he need to use that same
> thread for clearing his thread locals.
>
>
>
> > Just my 2 cents.
> >
> > Regards,
> > Raúl.
> >  On 28 Mar 2013 06:11, "Claus Ibsen"  wrote:
> >
> >> On Wed, Mar 27, 2013 at 10:02 PM, Christian Müller
> >>  wrote:
> >> > Isn't it called in a separate thread, isn't it?
> >> >
> >>
> >> Ah yeah, then use this as base class
> >>
> >>
> http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/support/SynchronizationAdapter.html
> >>
> >> And return false from the allowHandover method
> >> Then its done on the same thread.
> >>
> >>
> >> > Sent from a mobile device
> >> > Am 27.03.2013 08:14 schrieb "Claus Ibsen" :
> >> >
> >> >> You can use this method on the Exchange
> >> >>
> >> >>
> >> >>
> >>
> http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/Exchange.html#addOnCompletion(org.apache.camel.spi.Synchronization)
> >> >>
> >> >>
> >> >> On Tue, Mar 26, 2013 at 2:13 PM, davelund 
> >> wrote:
> >> >> > We are currently using ThreadLocal to store some information that
> gets
> >> >> > included in a log4j converter (and is used in other projects that
> dont
> >> >> have
> >> >> > camel in). Is there a callback I can use that for all routes in my
> >> >> context
> >> >> > so that at the end of the route it will get called (without
> explicitly
> >> >> > setting it) For example:
> >> >> > from("jms:somequeue")
> >> >> >   .processRef("someRandomProcessor")
> >> >> >   .processRef("someProcessorThatSetsThreadLocalValue")
> >> >> >   
> >> >> >   .to("jms:someotherqueue")
> >> >> >
> >> >> >
> >> >> > Ideally I'd like the threadlocal cleared when the exchange has been
> >> >> written
> >> >> > to the queue, without adding a processor that explicitly clears it
> (as
> >> >> > developers when adding new routes will forget to do it). I know the
> >> >> > onCompletion runs in a seperate thread so isn't fit for my purpose.
> >> I've
> >> >> > noticed  syncronisations and unitofworks, but cant seem to find any
> >> >> > documentation on it. Would this be fit for purpose?
> >> >> >
> >> >> >
> >> >> >
> >> >> > --
> >> >> > View this message in context:
> >> >>
> >>
> http://camel.465427.n5.nabble.com/Clearing-ThreadLocal-when-exchange-completes-tp5729849.html
> >> >> > Sent from the Camel - Users mailing list archive at Nabble.com.
> >> >>
> >> >>
> >> >>
> >> >> --
> >> >> Claus Ibsen
> >> >> -
> >> >> Red Hat, Inc.
> >> >> FuseSource is now part of Red Hat
> >> >> Email: cib...@redhat.com
> >> >> Web: http://fusesource.com
> >> >> Twitter: davsclaus
> >> >> Blog: http://davsclaus.com
> >> >> Author of Camel in Action: http://www.manning.com/ibsen
> >> >>
> >>
> >>
> >>
> >> --
> >> Claus Ibsen
> >> -
> >> Red Hat, Inc.
> >> FuseSource is now part of Red Hat
> >> Email: cib...@redhat.com
> >> Web: http://fusesource.com
> >> Twitter: davsclaus
> >> Blog: http://davsclaus.com
> >> Author of Camel in Action: http://www.manning.com/ibsen
> >>
>
>
>
> --
> Claus Ibsen
> -
> Red Hat, Inc.
> FuseSource is now part of Red Hat
> Email: cib...@redhat.com
> Web: http://fusesource.com
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen
>


Re: Clearing ThreadLocal when exchange completes

2013-03-28 Thread Claus Ibsen
On Thu, Mar 28, 2013 at 9:36 AM, Raul Kripalani  wrote:
> With this technique, developers  have to remember to add the custom
> processor at the start of each route. (Unless it's set from an
> interceptor...).
>
> Since the user explicitly asked for a non intrusive technique,
> EventNotifier is the only method that fulfills that requirement. Set once
> per Camel context and forget about it.
>
> And it's higher level, not fiddling with internal APIs.
>

That would only work if its the same thread that calls the listener at
exchange created and exchange done events. As he need to use that same
thread for clearing his thread locals.



> Just my 2 cents.
>
> Regards,
> Raúl.
>  On 28 Mar 2013 06:11, "Claus Ibsen"  wrote:
>
>> On Wed, Mar 27, 2013 at 10:02 PM, Christian Müller
>>  wrote:
>> > Isn't it called in a separate thread, isn't it?
>> >
>>
>> Ah yeah, then use this as base class
>>
>> http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/support/SynchronizationAdapter.html
>>
>> And return false from the allowHandover method
>> Then its done on the same thread.
>>
>>
>> > Sent from a mobile device
>> > Am 27.03.2013 08:14 schrieb "Claus Ibsen" :
>> >
>> >> You can use this method on the Exchange
>> >>
>> >>
>> >>
>> http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/Exchange.html#addOnCompletion(org.apache.camel.spi.Synchronization)
>> >>
>> >>
>> >> On Tue, Mar 26, 2013 at 2:13 PM, davelund 
>> wrote:
>> >> > We are currently using ThreadLocal to store some information that gets
>> >> > included in a log4j converter (and is used in other projects that dont
>> >> have
>> >> > camel in). Is there a callback I can use that for all routes in my
>> >> context
>> >> > so that at the end of the route it will get called (without explicitly
>> >> > setting it) For example:
>> >> > from("jms:somequeue")
>> >> >   .processRef("someRandomProcessor")
>> >> >   .processRef("someProcessorThatSetsThreadLocalValue")
>> >> >   
>> >> >   .to("jms:someotherqueue")
>> >> >
>> >> >
>> >> > Ideally I'd like the threadlocal cleared when the exchange has been
>> >> written
>> >> > to the queue, without adding a processor that explicitly clears it (as
>> >> > developers when adding new routes will forget to do it). I know the
>> >> > onCompletion runs in a seperate thread so isn't fit for my purpose.
>> I've
>> >> > noticed  syncronisations and unitofworks, but cant seem to find any
>> >> > documentation on it. Would this be fit for purpose?
>> >> >
>> >> >
>> >> >
>> >> > --
>> >> > View this message in context:
>> >>
>> http://camel.465427.n5.nabble.com/Clearing-ThreadLocal-when-exchange-completes-tp5729849.html
>> >> > Sent from the Camel - Users mailing list archive at Nabble.com.
>> >>
>> >>
>> >>
>> >> --
>> >> Claus Ibsen
>> >> -
>> >> Red Hat, Inc.
>> >> FuseSource is now part of Red Hat
>> >> Email: cib...@redhat.com
>> >> Web: http://fusesource.com
>> >> Twitter: davsclaus
>> >> Blog: http://davsclaus.com
>> >> Author of Camel in Action: http://www.manning.com/ibsen
>> >>
>>
>>
>>
>> --
>> Claus Ibsen
>> -
>> Red Hat, Inc.
>> FuseSource is now part of Red Hat
>> Email: cib...@redhat.com
>> Web: http://fusesource.com
>> Twitter: davsclaus
>> Blog: http://davsclaus.com
>> Author of Camel in Action: http://www.manning.com/ibsen
>>



-- 
Claus Ibsen
-
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cib...@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


Re: Retry based on HTTP response codes

2013-03-28 Thread Claus Ibsen
Hi

See this FAQ
http://camel.apache.org/why-is-the-exception-null-when-i-use-onexception.html

You can also some how to do this on this page
http://camel.apache.org/exception-clause.html

If you have a copy of Camel in Action book, then section 5.5 covers
such a use case to only handle certain conditions from a http response
code.

On Thu, Mar 28, 2013 at 10:02 AM, vss123  wrote:
> Oh sorry.. I did not explain clearly.We wanted to throw different exceptions
> for 4xx and 5xx errors and handle them differently.  The problem is that we
> do not know how to get the exception object. We tried this
> handle[HttpOperationFailedException]{  process(new Processor {
> def process(exchange: Exchange) {  val httpStatusCode =
> exchange.getIn.getHeader(Exchange.HTTP_RESPONSE_CODE)
> if(httpStatusCode.toString.startsWith("5")) throw new
> ServerHttpErrorException
> if(httpStatusCode.toString.startsWith("4")) throw new
> ClientHttpErrorExceptionthrow new Exception}  })
> }.handled(true)
> The httpStatusCode was /null/. We guess probably because it was thrown and
> not set on the exchange. We tried /getException/.But that, too is /null/
> Then we tried this,
> class ReThrower {  def doIt(httpException: HttpOperationFailedException){
> if(httpException.getStatusCode.toString.startsWith("5")) throw new
> ServerHttpErrorException
> if(httpException.getStatusCode.toString.startsWith("4")) throw new
> ClientHttpErrorExceptionthrow httpException
> }}handle[HttpOperationFailedException]().handled(true).onWhen(bean(classOf[ReThrower],
> "doIt"))
> We got /java.util.NoSuchElementException: head of empty list/ when running.
> Could you give us ideas on how to go about this?
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Retry-based-on-HTTP-response-codes-tp5729939p5730016.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cib...@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


Re: Retry based on HTTP response codes

2013-03-28 Thread vss123
Oh sorry.. I did not explain clearly.We wanted to throw different exceptions
for 4xx and 5xx errors and handle them differently.  The problem is that we
do not know how to get the exception object. We tried this 
handle[HttpOperationFailedException]{  process(new Processor {   
def process(exchange: Exchange) {  val httpStatusCode =
exchange.getIn.getHeader(Exchange.HTTP_RESPONSE_CODE) 
if(httpStatusCode.toString.startsWith("5")) throw new
ServerHttpErrorException 
if(httpStatusCode.toString.startsWith("4")) throw new
ClientHttpErrorExceptionthrow new Exception}  })   
}.handled(true)
The httpStatusCode was /null/. We guess probably because it was thrown and
not set on the exchange. We tried /getException/.But that, too is /null/
Then we tried this,
class ReThrower {  def doIt(httpException: HttpOperationFailedException){   
if(httpException.getStatusCode.toString.startsWith("5")) throw new
ServerHttpErrorException   
if(httpException.getStatusCode.toString.startsWith("4")) throw new
ClientHttpErrorExceptionthrow httpException 
}}handle[HttpOperationFailedException]().handled(true).onWhen(bean(classOf[ReThrower],
"doIt"))
We got /java.util.NoSuchElementException: head of empty list/ when running.
Could you give us ideas on how to go about this?



--
View this message in context: 
http://camel.465427.n5.nabble.com/Retry-based-on-HTTP-response-codes-tp5729939p5730016.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Ignore JMSReplyTo

2013-03-28 Thread Marco Crivellaro
That worked, thanks a lot!



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


Re: Clearing ThreadLocal when exchange completes

2013-03-28 Thread Raul Kripalani
With this technique, developers  have to remember to add the custom
processor at the start of each route. (Unless it's set from an
interceptor...).

Since the user explicitly asked for a non intrusive technique,
EventNotifier is the only method that fulfills that requirement. Set once
per Camel context and forget about it.

And it's higher level, not fiddling with internal APIs.

Just my 2 cents.

Regards,
Raúl.
 On 28 Mar 2013 06:11, "Claus Ibsen"  wrote:

> On Wed, Mar 27, 2013 at 10:02 PM, Christian Müller
>  wrote:
> > Isn't it called in a separate thread, isn't it?
> >
>
> Ah yeah, then use this as base class
>
> http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/support/SynchronizationAdapter.html
>
> And return false from the allowHandover method
> Then its done on the same thread.
>
>
> > Sent from a mobile device
> > Am 27.03.2013 08:14 schrieb "Claus Ibsen" :
> >
> >> You can use this method on the Exchange
> >>
> >>
> >>
> http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/Exchange.html#addOnCompletion(org.apache.camel.spi.Synchronization)
> >>
> >>
> >> On Tue, Mar 26, 2013 at 2:13 PM, davelund 
> wrote:
> >> > We are currently using ThreadLocal to store some information that gets
> >> > included in a log4j converter (and is used in other projects that dont
> >> have
> >> > camel in). Is there a callback I can use that for all routes in my
> >> context
> >> > so that at the end of the route it will get called (without explicitly
> >> > setting it) For example:
> >> > from("jms:somequeue")
> >> >   .processRef("someRandomProcessor")
> >> >   .processRef("someProcessorThatSetsThreadLocalValue")
> >> >   
> >> >   .to("jms:someotherqueue")
> >> >
> >> >
> >> > Ideally I'd like the threadlocal cleared when the exchange has been
> >> written
> >> > to the queue, without adding a processor that explicitly clears it (as
> >> > developers when adding new routes will forget to do it). I know the
> >> > onCompletion runs in a seperate thread so isn't fit for my purpose.
> I've
> >> > noticed  syncronisations and unitofworks, but cant seem to find any
> >> > documentation on it. Would this be fit for purpose?
> >> >
> >> >
> >> >
> >> > --
> >> > View this message in context:
> >>
> http://camel.465427.n5.nabble.com/Clearing-ThreadLocal-when-exchange-completes-tp5729849.html
> >> > Sent from the Camel - Users mailing list archive at Nabble.com.
> >>
> >>
> >>
> >> --
> >> Claus Ibsen
> >> -
> >> Red Hat, Inc.
> >> FuseSource is now part of Red Hat
> >> Email: cib...@redhat.com
> >> Web: http://fusesource.com
> >> Twitter: davsclaus
> >> Blog: http://davsclaus.com
> >> Author of Camel in Action: http://www.manning.com/ibsen
> >>
>
>
>
> --
> Claus Ibsen
> -
> Red Hat, Inc.
> FuseSource is now part of Red Hat
> Email: cib...@redhat.com
> Web: http://fusesource.com
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen
>


Re: Handle multiple exceptions in scala dsl

2013-03-28 Thread Willem jiang
After digging the code for a while, I found it is impossible to set the 
multiple exceptions into handle method, as it use implicit manifest parameter 
to pass the Class related information.  

Here is a workaround by calling the onException method directly in the scala 
code like this  

builder.onException(Class[MyFunctionalException], 
Class[MyTechnicalException]).to("mock:error").handled(true)



--  
Willem Jiang

Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://www.fusesource.com | http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) 
(English)
  http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem





On Thursday, March 28, 2013 at 12:01 PM, Willem jiang wrote:

> Hi
>  
> I just filled a JIRA[1] for it, and will try to fix it today.
>  
> [1]https://issues.apache.org/jira/browse/CAMEL-6221  
>  
> --  
> Willem Jiang
>  
> Red Hat, Inc.
> FuseSource is now part of Red Hat
> Web: http://www.fusesource.com | http://www.redhat.com
> Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) 
> (English)
> http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
> Twitter: willemjiang  
> Weibo: 姜宁willem
>  
>  
>  
>  
>  
> On Thursday, March 28, 2013 at 1:09 AM, Claus Ibsen wrote:
>  
> > On Wed, Mar 27, 2013 at 3:30 PM, dhavalsdoshi  > (mailto:dhaval.do...@gmail.com) (mailto:dhaval.do...@gmail.com)> wrote:
> > > Hi,
> > > What's the equivalent syntax in Scala DSL for doing the following Java DSL
> > > onException(IOException.class, SQLException.class,
> > > JMSException.class).maximumRedeliveries(5)
> > > Scala DSL only has
> > > handle[T]
> > > which can take only one exception type, I believe.Please help.
> > >  
> >  
> >  
> >  
> >  
> >  
> > Ah that may be a limitation in the Scala DSL.
> >  
> > Feel free to log a JIRA ticket for an enhancement. So the Scala DSL
> > accepts multiple like the Java DSL
> > http://camel.apache.org/support
> >  
> >  
> > >  
> > >  
> > > --
> > > View this message in context: 
> > > http://camel.465427.n5.nabble.com/Handle-multiple-exceptions-in-scala-dsl-tp5729941.html
> > > Sent from the Camel - Users mailing list archive at Nabble.com 
> > > (http://Nabble.com) (http://Nabble.com).
> > >  
> >  
> >  
> >  
> >  
> >  
> >  
> >  
> > --  
> > Claus Ibsen
> > -
> > Red Hat, Inc.
> > FuseSource is now part of Red Hat
> > Email: cib...@redhat.com (mailto:cib...@redhat.com) 
> > (mailto:cib...@redhat.com)
> > Web: http://fusesource.com
> > Twitter: davsclaus
> > Blog: http://davsclaus.com
> > Author of Camel in Action: http://www.manning.com/ibsen
> >  
>  
>  





Re: How can I perform immediate shutdown of a context and all it's routes and services, etc.?

2013-03-28 Thread Claus Ibsen
On Mon, Mar 25, 2013 at 4:50 PM, Chris Wolf  wrote:
> Claus,
>
> Ok, that worked - thanks a lot.
>
> BTW, the unit test is for testing custom RoutePolicy.  The route in
> the test looks like:
>
> from("seda:foo").routeId("foo").noAutoStartup().routePolicy(policy)
> .loop(10).copy().delay(1000)
> .log("*** loop ${property.CamelLoopIndex}")
> .to("mock:foo");
>
>
> The RoutePolicy suspends the route, then resume it after a period of
> time - it performs this suspend/resume
> cycle in a loop.  I notice that this route, using the loop() method
> only does the 10 iterations and does not
> start from the top again after being resumed, which I guess I should
> have expected.  Is there a way to restart
> the route from the top upon resuming?  Or do you recommend any other
> "busy work" kind of route to use
> for RoutePolicy testing?
>

The route only runs if there is messages available on the seda queue.
So send a message to the "seda:foo" queue to have it route that
message.


> Thanks,
>
>
> Chris
>
> On Sat, Mar 23, 2013 at 4:02 AM, Claus Ibsen  wrote:
>> Hi
>>
>> Just set the shutdown timeout to 1 milli second (or 1 sec) etc. And
>> just call stop on CamelContext.
>>
>> And if you extend the CamelTestSupport classes for your unit tests.
>> There may be a method you can override and return 1 to indiciate 1 sec
>> timeout.
>>
>>
>>
>> On Fri, Mar 22, 2013 at 5:23 PM, Chris Wolf  wrote:
>>> I am implementing some unit tests and if things go wrong I just want
>>> to shutdown ASAP without regard for inconsistent
>>> states, etc.  There's no easy hook in DefaultShutDownStrategy to do
>>> that because you need to know the route
>>> startup order, so I ended up with this convoluted code (that I kick
>>> off in a separate thread). It doesn't work, BTW.
>>>
>>> DefaultRouteStartupOrder rsuo = null;
>>> int startOrder = 0;
>>> List suo = new
>>> ArrayList();
>>> List routes = context.getRoutes();
>>> for (Route route : routes) {
>>> List services = route.getServices();
>>> for (Service service : services) {
>>> if (service instanceof RouteService) {
>>> rsuo = new
>>> DefaultRouteStartupOrder(startOrder, route, (RouteService) service);
>>> suo.add(rsuo);
>>> }
>>> }
>>> startOrder++;
>>> }
>>> ShutdownStrategy sds = context.getShutdownStrategy();
>>> sds.shutdownForced(context, suo);
>>>
>>> I know there must be an easier way, but I haven't found such.  Any ideas?
>>>
>>> Thanks,
>>>
>>> Chris
>>
>>
>>
>> --
>> Claus Ibsen
>> -
>> Red Hat, Inc.
>> FuseSource is now part of Red Hat
>> Email: cib...@redhat.com
>> Web: http://fusesource.com
>> Twitter: davsclaus
>> Blog: http://davsclaus.com
>> Author of Camel in Action: http://www.manning.com/ibsen



-- 
Claus Ibsen
-
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cib...@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


Re: Retry based on HTTP response codes

2013-03-28 Thread Claus Ibsen
The HttpOperationFailedException class has methods to get the response code.


On Wed, Mar 27, 2013 at 3:11 PM, vss123  wrote:
> Hi,
>
> We use camel 2.10.3 with Scala DSL.
>
> We have route that does a http post. We want to retry based on the response
> code.
> For e.g. no retries for 4xx and 2 retries for 5xx
>
> We tried using handle[HttpOperationFailedException] but not sure how to get
> the response code within that.
> Can you help us with whats the best way to handle this case?
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Retry-based-on-HTTP-response-codes-tp5729939.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cib...@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen