Re: JSch connection issue with Maverick SSHD server

2014-09-15 Thread Guillaume Nodet
Your server is configured with zlib compression only, while the client
only supports compression none, so there's a mismatch and both can't talk
to each other.  You need to configure the server with both zlib *and*
none compression factories.

2014-09-15 7:39 GMT+02:00 Baweja, Keshav keshav.baw...@jpmorgan.com.invalid
:

 Hello

 I am using Camel 2.13.2 in my application to build up routes to download
 files from sftp server locations. The codebase has been tested ok against 5
 different sftp servers. However against one particular sftp server, JSch
 the sftp implementation used  by Camel seems to disconnect immediately
 after connecting. Could you please advise what could be the issue here. The
 log from application is as below -

 [2014-09-15 05:52:32.236] [Camel (camel-1) thread #0 - 
 sftp://user@hostname:port/data]
 DEBUG org.apache.camel.component.file.remote.SftpOperations - Using private
 keyfile: /home/.ssh/id_rsa
 [2014-09-15 05:52:32.238] [Camel (camel-1) thread #0 - 
 sftp://user@hostname:port/data]
 DEBUG org.apache.camel.component.file.remote.SftpOperations - Using
 knownhosts file: /home/.ssh/known_hosts
 [2014-09-15 05:52:32.329] [Camel (camel-1) thread #0 - 
 sftp://user@hostname:port/data]
 DEBUG org.apache.camel.component.file.remote.SftpOperations - Using
 StrickHostKeyChecking: no
 [2014-09-15 05:52:32.329] [Camel (camel-1) thread #0 - 
 sftp://user@hostname:port/data]
 INFO  org.apache.camel.component.file.remote.SftpOperations - JSCH -
 Connecting to hostname port port
 [2014-09-15 05:52:32.462] [Camel (camel-1) thread #0 - 
 sftp://user@hostname:port/data]
 INFO  org.apache.camel.component.file.remote.SftpOperations - JSCH -
 Connection established
 [2014-09-15 05:52:32.589] [Camel (camel-1) thread #0 - 
 sftp://user@hostname:port/data]
 INFO  org.apache.camel.component.file.remote.SftpOperations - JSCH -
 Remote version string: SSH-2.0-Maverick_SSHD
 [2014-09-15 05:52:32.589] [Camel (camel-1) thread #0 - 
 sftp://user@hostname:port/data]
 INFO  org.apache.camel.component.file.remote.SftpOperations - JSCH - Local
 version string: SSH-2.0-JSCH-0.1.50
 [2014-09-15 05:52:32.589] [Camel (camel-1) thread #0 - 
 sftp://user@hostname:port/data]
 INFO  org.apache.camel.component.file.remote.SftpOperations - JSCH -
 CheckCiphers:
 aes256-ctr,aes192-ctr,aes128-ctr,aes256-cbc,aes192-cbc,aes128-cbc,3des-ctr,arcfour,arcfour128,arcfour256
 [2014-09-15 05:52:32.598] [Camel (camel-1) thread #0 - 
 sftp://user@hostname:port/data]
 INFO  org.apache.camel.component.file.remote.SftpOperations - JSCH -
 CheckKexes: diffie-hellman-group14-sha1
 [2014-09-15 05:52:32.621] [Camel (camel-1) thread #0 - 
 sftp://user@hostname:port/data]
 INFO  org.apache.camel.component.file.remote.SftpOperations - JSCH -
 SSH_MSG_KEXINIT sent
 [2014-09-15 05:52:32.621] [Camel (camel-1) thread #0 - 
 sftp://user@hostname:port/data]
 INFO  org.apache.camel.component.file.remote.SftpOperations - JSCH -
 SSH_MSG_KEXINIT received
 [2014-09-15 05:52:32.622] [Camel (camel-1) thread #0 - 
 sftp://user@hostname:port/data]
 INFO  org.apache.camel.component.file.remote.SftpOperations - JSCH - kex:
 server: diffie-hellman-group1-sha1,diffie-hellman-group-exchange-sha1
 [2014-09-15 05:52:32.622] [Camel (camel-1) thread #0 - 
 sftp://user@hostname:port/data]
 INFO  org.apache.camel.component.file.remote.SftpOperations - JSCH - kex:
 server: ssh-rsa
 [2014-09-15 05:52:32.622] [Camel (camel-1) thread #0 - 
 sftp://user@hostname:port/data]
 INFO  org.apache.camel.component.file.remote.SftpOperations - JSCH - kex:
 server:
 aes128-cbc,aes256-cbc,aes192-cbc,3des-cbc,twofish256-cbc,twofish192-cbc,twofish128-cbc,blowfish-cbc,cast128-cbc
 [2014-09-15 05:52:32.622] [Camel (camel-1) thread #0 - 
 sftp://user@hostname:port/data]
 INFO  org.apache.camel.component.file.remote.SftpOperations - JSCH - kex:
 server:
 aes128-cbc,aes256-cbc,aes192-cbc,3des-cbc,twofish256-cbc,twofish192-cbc,twofish128-cbc,blowfish-cbc,cast128-cbc
 [2014-09-15 05:52:32.622] [Camel (camel-1) thread #0 - 
 sftp://user@hostname:port/data]
 INFO  org.apache.camel.component.file.remote.SftpOperations - JSCH - kex:
 server: hmac-sha1,hmac-sha1-96
 [2014-09-15 05:52:32.622] [Camel (camel-1) thread #0 - 
 sftp://user@hostname:port/data]
 INFO  org.apache.camel.component.file.remote.SftpOperations - JSCH - kex:
 server: hmac-sha1,hmac-sha1-96
 [2014-09-15 05:52:32.622] [Camel (camel-1) thread #0 - 
 sftp://user@hostname:port/data]
 INFO  org.apache.camel.component.file.remote.SftpOperations - JSCH - kex:
 server: zlib
 [2014-09-15 05:52:32.622] [Camel (camel-1) thread #0 - 
 sftp://user@hostname:port/data]
 INFO  org.apache.camel.component.file.remote.SftpOperations - JSCH - kex:
 server: zlib
 [2014-09-15 05:52:32.622] [Camel (camel-1) thread #0 - 
 sftp://user@hostname:port/data]
 INFO  org.apache.camel.component.file.remote.SftpOperations - JSCH - kex:
 server:
 [2014-09-15 05:52:32.623] [Camel (camel-1) thread #0 - 
 sftp://user@hostname:port/data]
 INFO  

RE: JSch connection issue with Maverick SSHD server

2014-09-15 Thread Baweja, Keshav
Thanks for your reply Nodet, 

The sftp server is hosted externally and is outside our infrastructure. I can't 
make any changes to the server, and need to make client work with the server 
configuration.  Would you know how I can do it, found the below on Camel's ftp2 
page and guess need to look at this - 

compression | Default Value = 0 | SFTP Only: Camel 2.8.3/2.9: To use 
compression. Specify a level from 1 to 10. Important: You must manually add the 
needed JSCH zlib JAR to the classpath for compression support.

Regards
Keshav


-Original Message-
From: Guillaume Nodet [mailto:gno...@apache.org] 
Sent: Monday, September 15, 2014 2:15 PM
To: users@camel.apache.org
Subject: Re: JSch connection issue with Maverick SSHD server

Your server is configured with zlib compression only, while the client only 
supports compression none, so there's a mismatch and both can't talk to each 
other.  You need to configure the server with both zlib *and* none 
compression factories.

2014-09-15 7:39 GMT+02:00 Baweja, Keshav keshav.baw...@jpmorgan.com.invalid
:

 Hello

 I am using Camel 2.13.2 in my application to build up routes to 
 download files from sftp server locations. The codebase has been 
 tested ok against 5 different sftp servers. However against one 
 particular sftp server, JSch the sftp implementation used  by Camel 
 seems to disconnect immediately after connecting. Could you please 
 advise what could be the issue here. The log from application is as 
 below -

 [2014-09-15 05:52:32.236] [Camel (camel-1) thread #0 - 
 sftp://user@hostname:port/data] DEBUG 
 org.apache.camel.component.file.remote.SftpOperations - Using private
 keyfile: /home/.ssh/id_rsa
 [2014-09-15 05:52:32.238] [Camel (camel-1) thread #0 - 
 sftp://user@hostname:port/data] DEBUG 
 org.apache.camel.component.file.remote.SftpOperations - Using 
 knownhosts file: /home/.ssh/known_hosts
 [2014-09-15 05:52:32.329] [Camel (camel-1) thread #0 - 
 sftp://user@hostname:port/data] DEBUG 
 org.apache.camel.component.file.remote.SftpOperations - Using
 StrickHostKeyChecking: no
 [2014-09-15 05:52:32.329] [Camel (camel-1) thread #0 - 
 sftp://user@hostname:port/data] INFO  
 org.apache.camel.component.file.remote.SftpOperations - JSCH - 
 Connecting to hostname port port
 [2014-09-15 05:52:32.462] [Camel (camel-1) thread #0 - 
 sftp://user@hostname:port/data] INFO  
 org.apache.camel.component.file.remote.SftpOperations - JSCH - 
 Connection established
 [2014-09-15 05:52:32.589] [Camel (camel-1) thread #0 - 
 sftp://user@hostname:port/data] INFO  
 org.apache.camel.component.file.remote.SftpOperations - JSCH - Remote 
 version string: SSH-2.0-Maverick_SSHD
 [2014-09-15 05:52:32.589] [Camel (camel-1) thread #0 - 
 sftp://user@hostname:port/data] INFO  
 org.apache.camel.component.file.remote.SftpOperations - JSCH - Local 
 version string: SSH-2.0-JSCH-0.1.50
 [2014-09-15 05:52:32.589] [Camel (camel-1) thread #0 - 
 sftp://user@hostname:port/data] INFO  
 org.apache.camel.component.file.remote.SftpOperations - JSCH -
 CheckCiphers:
 aes256-ctr,aes192-ctr,aes128-ctr,aes256-cbc,aes192-cbc,aes128-cbc,3des
 -ctr,arcfour,arcfour128,arcfour256
 [2014-09-15 05:52:32.598] [Camel (camel-1) thread #0 - 
 sftp://user@hostname:port/data] INFO  
 org.apache.camel.component.file.remote.SftpOperations - JSCH -
 CheckKexes: diffie-hellman-group14-sha1
 [2014-09-15 05:52:32.621] [Camel (camel-1) thread #0 - 
 sftp://user@hostname:port/data] INFO  
 org.apache.camel.component.file.remote.SftpOperations - JSCH - 
 SSH_MSG_KEXINIT sent
 [2014-09-15 05:52:32.621] [Camel (camel-1) thread #0 - 
 sftp://user@hostname:port/data] INFO  
 org.apache.camel.component.file.remote.SftpOperations - JSCH - 
 SSH_MSG_KEXINIT received
 [2014-09-15 05:52:32.622] [Camel (camel-1) thread #0 - 
 sftp://user@hostname:port/data] INFO  
 org.apache.camel.component.file.remote.SftpOperations - JSCH - kex:
 server: diffie-hellman-group1-sha1,diffie-hellman-group-exchange-sha1
 [2014-09-15 05:52:32.622] [Camel (camel-1) thread #0 - 
 sftp://user@hostname:port/data] INFO  
 org.apache.camel.component.file.remote.SftpOperations - JSCH - kex:
 server: ssh-rsa
 [2014-09-15 05:52:32.622] [Camel (camel-1) thread #0 - 
 sftp://user@hostname:port/data] INFO  
 org.apache.camel.component.file.remote.SftpOperations - JSCH - kex:
 server:
 aes128-cbc,aes256-cbc,aes192-cbc,3des-cbc,twofish256-cbc,twofish192-cb
 c,twofish128-cbc,blowfish-cbc,cast128-cbc
 [2014-09-15 05:52:32.622] [Camel (camel-1) thread #0 - 
 sftp://user@hostname:port/data] INFO  
 org.apache.camel.component.file.remote.SftpOperations - JSCH - kex:
 server:
 aes128-cbc,aes256-cbc,aes192-cbc,3des-cbc,twofish256-cbc,twofish192-cb
 c,twofish128-cbc,blowfish-cbc,cast128-cbc
 [2014-09-15 05:52:32.622] [Camel (camel-1) thread #0 - 
 sftp://user@hostname:port/data] INFO  
 org.apache.camel.component.file.remote.SftpOperations - JSCH - kex:
 server: hmac-sha1,hmac-sha1-96
 [2014-09-15 05:52:32.622] [Camel (camel-1) thread #0 - 
 

Re: Over-riding JSON deserializers/serializers in Camel w/o using annotations

2014-09-15 Thread Paul McCulloch
I've achieved this for Jackson as follows. I've no idea if this is a good
solution, but it works!:
1) Create a Spring Factory Bean for creating JacksonDataFormat instances.
i.e. bean id=json-jackson class=my.JacksonDataFormatFactory/
2) In my factory's getObject() method so something like:
ObjectMapper mapper = new ObjectMapper();
 //There are a bunch of properties than don't have matching getters 
setters. Ignore these on deserialisation.
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
 //We need to include type info for properties of abstract types, so we can
deserialise them.
mapper.enableDefaultTyping();
 mapper.registerModule(new JacksonCustomisationModule());
JacksonDataFormat df = new JacksonDataFormat(mapper, null);
return df;

I use a custom Jackson SimpleModule where I register a number of mixins.
This allows me add some annotations to classes which are part of a
different project.

On 12 September 2014 22:35, rickaroni rgfa...@directv.com wrote:

 Hi,

 JSON libraries like Jackson and XStream provide ways of overriding the
 serializers/deserializers that get used for various specific object types.

 [While you can always hand-annotate code (e.g. with @JsonSerializer) to use
 custom serializers and deserializers, that can be cumbersome and invasive.]

 Some frameworks like Spring provide handy ways to do override the object to
 serializer/deserializer mappings:

 http://docs.spring.io/spring/docs/current/javadoc-api/index.html?org/springframework/http/converter/json/Jackson2ObjectMapperFactoryBean.html
 
 http://docs.spring.io/spring/docs/current/javadoc-api/index.html?org/springframework/http/converter/json/Jackson2ObjectMapperFactoryBean.html
 

 How can I do the same kind of thing in Camel to override the converters
 found in the the dataFormats section of camelContext?

 e.g. How do can I change the converters that get used to convert to/from
 MyObj1 and MyObj2 below?
   camelContext
 ..
   dataFormats
   json id=MyObj1MarshallingJSON
 unmarshalTypeName=com.blah.bleh.MyObj1  library=Jackson /
   json id=MyObj2MarshallingJSON
 unmarshalTypeName=com.blah.bleh.MyObj2  library=XStream /
   /dataFormats

 Thanks,
 Rick




 --
 View this message in context:
 http://camel.465427.n5.nabble.com/Over-riding-JSON-deserializers-serializers-in-Camel-w-o-using-annotations-tp5756458.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



Re: Camel 2.13.1 Orignal Body from Splitter

2014-09-15 Thread Bilgin Ibryam
Before the splitter, put the original body into a property, then you can
access it from the processor.

HTH,


On 10 September 2014 18:10, sandp sandeepred...@gmail.com wrote:

 Hi,
 Is it possible to access the original body along with the split body in a
 processor?

 *E.g. Parent object has a ListChild  objects,*
  And in the route:

 .split(simple(${in.body?children})).stopOnException().process(new
 TestProcessor())

 For each split, the Message body in the TestProcessor will have a* Child
 object* , now, is it possible to access the original body containing the
 Parent object as well in the Processor?






 --
 View this message in context:
 http://camel.465427.n5.nabble.com/Camel-2-13-1-Orignal-Body-from-Splitter-tp5756291.html
 Sent from the Camel - Users mailing list archive at Nabble.com.




-- 
Bilgin Ibryam

Red Hat, Inc.
Apache Camel  Apache OFBiz committer
Blog: ofbizian.com
Twitter: @bibryam https://twitter.com/bibryam

Author of Instant Apache Camel Message Routing
http://www.amazon.com/dp/1783283475


Camel 2.14-SNAPSHOT - Is interceptFrom() broken for the Rest dsl?

2014-09-15 Thread panzerhans
I am struggelig to get interceptFrom() working for the rest-DSL.

My project only has one Rest DSL route.

If I add interceptFrom().stop() in the beginning of a my RouteDefinition
file, no stop of that route occurs. In addition, if I add the
interceptFrom().stop() after my rest dsl route is defined, no exception is
thrown (as it should be).

However, if I add another regular DSL, like:

from(timer://foo?fixedRate=trueperiod=10s).log(Hello world) 

The interceptor is fired (and Exception is thrown if I move the interceptor
below the route). Am I missing something?



--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-2-14-SNAPSHOT-Is-interceptFrom-broken-for-the-Rest-dsl-tp5756537.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel 2.14-SNAPSHOT - Is interceptFrom() broken for the Rest dsl?

2014-09-15 Thread Claus Ibsen
Hi

Are you use the rest dsl with embedded route or just a single short-hand to?

There could be a situation where the intercept from is applied to
early, and the rest-dsl routes gets added as route models after that
logic.

Though I would have to check the source code to sure. But sounds like
we could improve this so interceptors work on the rest dsl routes too.

Feel free to log a JIRA ticket

On Mon, Sep 15, 2014 at 3:00 PM, panzerhans espen+ca...@tjonneland.no wrote:
 I am struggelig to get interceptFrom() working for the rest-DSL.

 My project only has one Rest DSL route.

 If I add interceptFrom().stop() in the beginning of a my RouteDefinition
 file, no stop of that route occurs. In addition, if I add the
 interceptFrom().stop() after my rest dsl route is defined, no exception is
 thrown (as it should be).

 However, if I add another regular DSL, like:

 from(timer://foo?fixedRate=trueperiod=10s).log(Hello world)

 The interceptor is fired (and Exception is thrown if I move the interceptor
 below the route). Am I missing something?



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Camel-2-14-SNAPSHOT-Is-interceptFrom-broken-for-the-Rest-dsl-tp5756537.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/


Re: Camel 2.14-SNAPSHOT - Is interceptFrom() broken for the Rest dsl?

2014-09-15 Thread panzerhans
Here is a snippet of the code:

@Component
@DependsOn(camelConfig)
public class IncomingRestCalls extends RouteBuilder {

interceptFrom().id(Logging interceptor).bean(NISAccessLog.class);

   restConfiguration()more code here..;

rest(NISConfig.API_VERSION_1 + /holdings).description(Holdings
service  +   NISConfig.API_VERSION_1)
.consumes(application/json).produces(application/json)

.get(/{ID}).description(List the customers holdings for
the given ID.).outTypeList(
InsuranceDTO.class).to(log:hello); 
}



--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-2-14-SNAPSHOT-Is-interceptFrom-broken-for-the-Rest-dsl-tp5756537p5756539.html
Sent from the Camel - Users mailing list archive at Nabble.com.


ProducerTemplate null when used to construct bean in new JndiContext in a unit test

2014-09-15 Thread Jason Holmberg
I am trying to unit test a route that uses bean to dynamically construct an
sftp endpoint. This works when I run my route in a normal context, as it
seems a template is already in the registry and can be correctly injected.  

My problem is when trying to construct the unit test I seem to be running
into a condition where the ProducerTemplate is still null when
createJndiContext is invoked and that results in an NPE in my bean that need
to call a method on the template.

Any help would be greatly appreciated.

Here is a simplified unit test that illustrates this:

public class BeanWithProdTemplateDependencyTest
  extends CamelTestSupport
{

  
  private static final Logger log =
LoggerFactory.getLogger(BeanWithProdTemplateDependencyTest.class);
  private static final String FROM = direct:start;

  @EndpointInject(uri = mock:result)
  protected MockEndpoint resultEndpoint;
  
  @Before
  public void setUp() throws Exception {

super.setUp();
context.getRouteDefinition(my-cool-route).adviceWith(context, new
AdviceWithRouteBuilder()
{

  @Override
  public void configure()
throws Exception
  {
replaceFromWith(FROM);

  }
});
startCamelContext();

  }
  
  @Test
  public void test()
  {
template.sendBody(FROM, cheese);
  }

  @Override
  public boolean isUseAdviceWith()
  {
return true;
  }
  
  @Override
  protected Context createJndiContext()
throws Exception
  {
JndiContext context = new JndiContext();
MyBean myBean = new MyBean(template);
context.bind(myBean, myBean);

return context;
  }
  
  @Override
  protected RouteBuilder createRouteBuilder()
throws Exception
  {
return new RouteBuilder()
{
  
  @Override
  public void configure()
throws Exception
  {
from(jms:queue:inbox)
.routeId(my-cool-route)
.beanRef(myBean, doStuff)
.log(Body: $body})
.to(mock:result);
  }
};
  }
  
  public class MyBean {

private final ProducerTemplate producerTemplate;

public MyBean(ProducerTemplate template)
{
  this.producerTemplate = template;
}

public void doStuff() throws Exception{
  // NPE here, template is null
  this.producerTemplate.sendBody(seda:foo, beer); 
}
  }
}




--
View this message in context: 
http://camel.465427.n5.nabble.com/ProducerTemplate-null-when-used-to-construct-bean-in-new-JndiContext-in-a-unit-test-tp5756543.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: ProducerTemplate null when used to construct bean in new JndiContext in a unit test

2014-09-15 Thread Jason Holmberg
I figured it out.  My answer can be found here:

http://stackoverflow.com/questions/25851033/producertemplate-null-when-used-to-construct-bean-in-new-jndicontext-in-a-unit-t
http://stackoverflow.com/questions/25851033/producertemplate-null-when-used-to-construct-bean-in-new-jndicontext-in-a-unit-t
  



--
View this message in context: 
http://camel.465427.n5.nabble.com/ProducerTemplate-null-when-used-to-construct-bean-in-new-JndiContext-in-a-unit-test-tp5756543p5756551.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Setting CXF TLSClientParameters programmatically

2014-09-15 Thread jjathman
I realize this is a very old post, but I don't really see a concrete answer
to the questions from the OP. From what I can tell using a wildcard HTTP
conduit configuration does not work correctly when programmatically creating
a CxfEndpoint. Using that would be ideal, but even if that isn't possible
can we programmatically set the TLS Client Parameters somehow?



--
View this message in context: 
http://camel.465427.n5.nabble.com/Setting-CXF-TLSClientParameters-programmatically-tp5120622p5756553.html
Sent from the Camel - Users mailing list archive at Nabble.com.


@Consumed

2014-09-15 Thread Bejjanki, Yuvanaga
Hi,

How we can access a custom value(from exchange) in @consumed method of an entity

This custom value would be determined based on some logic in a processor, so 
how does @consumed method can get this value and set to the entity property.

Thanks,
Yuva

This message and any attachments are intended only for the use of the addressee 
and may contain information that is privileged and confidential. If the reader 
of the message is not the intended recipient or an authorized representative of 
the intended recipient, you are hereby notified that any dissemination of this 
communication is strictly prohibited. If you have received this communication 
in error, please notify us immediately by e-mail and delete the message and any 
attachments from your system.

Custom message handling and routing

2014-09-15 Thread vikrant
I have a custom message which is a combination of - 
Part A – java map message
Part B – xml
This routing is based on the details from both the parts and to the end
point the both parts should be delivered a single message. Can I use content
based routing xpath for the xml message and bean for map message. What is
the best strategy that can be used here? 

Currently, the current system is accepting only xml and jms messages. Can I
accept the custom message and the xml message on the same port. Based on
type of message(i.e., custom or xml) it needs to be routed to endpoint. Any
pointers/examples to this situations.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Custom-message-handling-and-routing-tp5756552.html
Sent from the Camel - Users mailing list archive at Nabble.com.


DataAccessResourceFailureException was not handled by onException DSL

2014-09-15 Thread shrivallabh
I have a postgres connection and I have given wrong credentials, I want to
catch connection exception in camel context. It never catch the exception. 

see camel context
bean id=myQ
class=org.apache.activemq.camel.component.ActiveMQComponent
 property name=brokerURL value=tcp://localhost:61616/
/bean

camel:errorHandler id=deadLetterErrorHandler type=DeadLetterChannel 
deadLetterUri=activemq:myQ:errQueue
camel:redeliveryPolicy maximumRedeliveries=3 redeliveryDelay=1000 /
/camel:errorHandler

camelContext id=myContext
xmlns=http://camel.apache.org/schema/spring;
errorHandlerRef=deadLetterErrorHandler 

onException

exceptionorg.springframework.jdbc.CannotGetJdbcConnectionException/exception

exceptionorg.apache.commons.dbcp.SQLNestedException/exception

exceptionorg.springframework.dao.DataAccessResourceFailureException/exception

exceptionorg.springframework.jdbc.support.MetaDataAccessException/exception
handled
constanttrue/constant
/handled 
setHeader headerName=ExceptionStacktrace
simple${exception.stacktrace}/simple
/setHeader
setHeader headerName=ExceptionMessage
simple${exception.message}/simple
/setHeader
to uri=activemq:myQ:errQueue /
/onException

route id=routeid1 handleFault=true 
from uri=start /
.
.
to uri=seda:asyncOne /
/route

route id=routeid2 handleFault=true 
from uri=seda:asyncOne /
setHeader headerName=BATCH_STATUS
method ref=demoProcessor method=process /
/setHeader
.
.
.
/route


Throws exception but could not be caught.

see the log:
org.springframework.retry.ExhaustedRetryException: Retry exhausted after
last attempt in recovery path, but exception is not skippable.; nested
exception is org.springframework.dao.DataAccessResourceFailureException:
Error retreiving database metadata; nested exception is
org.springframework.jdbc.support.MetaDataAccessException: Could not get
Connection for extracting meta data; nested exception is
org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get
JDBC Connection; nested exception is
org.apache.commons.dbcp.SQLNestedException: Cannot create
PoolableConnectionFactory (FATAL: password authentication failed for user
test_user1)

Thanks in advance



--
View this message in context: 
http://camel.465427.n5.nabble.com/DataAccessResourceFailureException-was-not-handled-by-onException-DSL-tp5756550.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Reusable route definitions?

2014-09-15 Thread toomanyedwards
Hey all,
  I have several direct: routes that I'd like to be able to reuse across
multiple standalone camel projects.  I am currently using Java DSL to define
my routes.  Can anyone point me to any existing patterns for creating
reusable route definitions?

The solution I've come up with is creating a RouteConfigurer Java
interface that has one method: RouteDefinition configure(RouteBuilder)  I
have specific classes that implement this interface that configure the
RouteDefinitions I want to reuse  so that I can use them in different Camel
projects.

I feel like I'm probably reinventing the wheel here.  Are there any
established patterns/route libraries that already do this better?

-e



--
View this message in context: 
http://camel.465427.n5.nabble.com/Reusable-route-definitions-tp5756545.html
Sent from the Camel - Users mailing list archive at Nabble.com.


502 Timeout

2014-09-15 Thread berdoni
Hi,

I have a simple proxy route deployed on ServiceMix:

from(jetty:http://{{smx.host}}:{{smx.rest-proxy-port}}/{{smx.context}}?matchOnUriPrefix=trueenableMultipartFilter=false;)
.noStreamCaching()
.to(jetty:http://{{target-server-address}}:{{target-ws-port}}/?bridgeEndpoint=truethrowExceptionOnFailure=false;);

All ReST services are proxied without any issue except one where a timeout
occurs. A direct service call lasts for ~2mins but when the call is proxied
through SMX it timeouts after 60seconds. How to configure my proxy route to
timeout on 3mins? My route is deployed on SMX as an OSGi bundle with Spring.
The call is initiated by a CXF producer (i.e. System A) it is proxied
through SMX and the consumer is a CXF Rest Service on System B.

SystemA (CXF Rest client) - SMX (camel-hetty proxy route) - System B
(CXF Rest service)

thanks



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