Connect JMS over SSH Tunnel

2015-05-21 Thread Copernico
Hi,

I need to send some messages to an openmq queue on a remote host. 
The problem is that the host is behind a firewall and the only way to
connect is over ssh. That machine has a MySQL server installed. I can
connect with it with putty doing a Port Forwarding to my local machine, so i
can connect to remote mysql server as if it was installed on localhost.

There is a way to do with camel? i mean, create a ssh tunnel to connect to
the openmq queue? 

I forgot to say that the application in which i am working is a Desktop App



--
View this message in context: 
http://camel.465427.n5.nabble.com/Connect-JMS-over-SSH-Tunnel-tp5767395.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Connect JMS over SSH Tunnel

2015-05-21 Thread Doug Douglass
I'd setup the ssh tunnel outside of Camel, then have your Camel JMS URI use
the localhost/port that's being forwarded. That way Camel has no knowledge
of the port forwarding.

Perhaps try something like sshuttle https://github.com/apenwarr/sshuttle to
provide a simple VPN of sorts via ssh. I've used this between unix hosts
with good results.

Or, look into a real vpn solution if it's a critical app.

HTH,
Doug

On Thu, May 21, 2015 at 10:58 AM, Copernico engcopern...@gmail.com wrote:

 Hi,

 I need to send some messages to an openmq queue on a remote host.
 The problem is that the host is behind a firewall and the only way to
 connect is over ssh. That machine has a MySQL server installed. I can
 connect with it with putty doing a Port Forwarding to my local machine, so
 i
 can connect to remote mysql server as if it was installed on localhost.

 There is a way to do with camel? i mean, create a ssh tunnel to connect to
 the openmq queue?

 I forgot to say that the application in which i am working is a Desktop App



 --
 View this message in context:
 http://camel.465427.n5.nabble.com/Connect-JMS-over-SSH-Tunnel-tp5767395.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



Re: Connect JMS over SSH Tunnel

2015-05-21 Thread François LIOT
Hi,

Apache Mina is a full implementation of SSH.

Somebody already document the same issue than yours :
http://stackoverflow.com/questions/8279426/how-tunnel-all-rmi-traffic-over-ssh

I did use Mina as SSHd server, but I didn't test it for port forwarding,
Nevertheless I believe it's the most elegant full java solution.

Regards,

François Liot

 ​


From: Doug Douglass douglass.d...@gmail.com
Sent: Thursday, May 21, 2015 8:08 PM
To: users@camel.apache.org
Subject: Re: Connect JMS over SSH Tunnel

I'd setup the ssh tunnel outside of Camel, then have your Camel JMS URI use
the localhost/port that's being forwarded. That way Camel has no knowledge
of the port forwarding.

Perhaps try something like sshuttle https://github.com/apenwarr/sshuttle to
provide a simple VPN of sorts via ssh. I've used this between unix hosts
with good results.

Or, look into a real vpn solution if it's a critical app.

HTH,
Doug

On Thu, May 21, 2015 at 10:58 AM, Copernico engcopern...@gmail.com wrote:

 Hi,

 I need to send some messages to an openmq queue on a remote host.
 The problem is that the host is behind a firewall and the only way to
 connect is over ssh. That machine has a MySQL server installed. I can
 connect with it with putty doing a Port Forwarding to my local machine, so
 i
 can connect to remote mysql server as if it was installed on localhost.

 There is a way to do with camel? i mean, create a ssh tunnel to connect to
 the openmq queue?

 I forgot to say that the application in which i am working is a Desktop App



 --
 View this message in context:
 http://camel.465427.n5.nabble.com/Connect-JMS-over-SSH-Tunnel-tp5767395.html
 Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Connect JMS over SSH Tunnel

2015-05-21 Thread Doug Douglass
François makes a good point since your scenario is a desktop app.

On Thu, May 21, 2015 at 11:30 AM, François LIOT francois.l...@poplidays.com
 wrote:

 Hi,

 Apache Mina is a full implementation of SSH.

 Somebody already document the same issue than yours :

 http://stackoverflow.com/questions/8279426/how-tunnel-all-rmi-traffic-over-ssh

 I did use Mina as SSHd server, but I didn't test it for port forwarding,
 Nevertheless I believe it's the most elegant full java solution.

 Regards,

 François Liot

  ​

 
 From: Doug Douglass douglass.d...@gmail.com
 Sent: Thursday, May 21, 2015 8:08 PM
 To: users@camel.apache.org
 Subject: Re: Connect JMS over SSH Tunnel

 I'd setup the ssh tunnel outside of Camel, then have your Camel JMS URI use
 the localhost/port that's being forwarded. That way Camel has no knowledge
 of the port forwarding.

 Perhaps try something like sshuttle https://github.com/apenwarr/sshuttle
 to
 provide a simple VPN of sorts via ssh. I've used this between unix hosts
 with good results.

 Or, look into a real vpn solution if it's a critical app.

 HTH,
 Doug

 On Thu, May 21, 2015 at 10:58 AM, Copernico engcopern...@gmail.com
 wrote:

  Hi,
 
  I need to send some messages to an openmq queue on a remote host.
  The problem is that the host is behind a firewall and the only way to
  connect is over ssh. That machine has a MySQL server installed. I can
  connect with it with putty doing a Port Forwarding to my local machine,
 so
  i
  can connect to remote mysql server as if it was installed on localhost.
 
  There is a way to do with camel? i mean, create a ssh tunnel to connect
 to
  the openmq queue?
 
  I forgot to say that the application in which i am working is a Desktop
 App
 
 
 
  --
  View this message in context:
 
 http://camel.465427.n5.nabble.com/Connect-JMS-over-SSH-Tunnel-tp5767395.html
  Sent from the Camel - Users mailing list archive at Nabble.com.
 



Connect JMS over SSH Tunnel

2015-05-21 Thread Copernico
Hi,

I need to send some messages to an openmq queue on a remote host. The
problem is
that host is behind a firewall and the only way to connect is over ssh. That
machine has installed
a MySQL server. I can connect it with putty doing a PortForwarding to my
localmachine, so i can connect
to remote mysql server on localhost.

There is a way to do that with camel? i mean create a ssh tunnel to conect
to openmq queue?

Sorry for my english, 

Nicolas






--
View this message in context: 
http://camel.465427.n5.nabble.com/Connect-JMS-over-SSH-Tunnel-tp5767394.html
Sent from the Camel - Users mailing list archive at Nabble.com.


How can i use CDI with the Camel Context

2015-05-21 Thread kikou1984
Hi, 

I m using camel version 2.10.0.

In my route spring XML , i want to use the CamelContextCDI instead of the
DefaultCamelContext.

How can i do it ? 

beans xmlns=http://www.springframework.org/schema/beans;
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
xmlns:context=http://www.springframework.org/schema/context;
xsi:schemaLocation=http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://camel.apache.org/schema/spring
http://camel.apache.org/schema/spring/camel-spring.xsd;
import resource=classpath:/suivi-import-jms.xml /
bean id=InitLcl class=net.InitLCLBean /
bean id=CtrlCB2A class=net.CtrlCb2aLclBean /

camelContext  id=TM-UNL-TEST
xmlns=http://camel.apache.org/schema/spring; 

is there a way to change the DefaultCamelContext, or to specify to the  a
bean that it must run with CDI container.

In this bean id = CtrlCB2A, i have the CDI.

public class CtrlContratBean {

@Inject
DateBusinessManager dateBusinessManager;

/**
 * Bean Ctrl Contrat
 * 
 * @param exchange
 * @return
 */
public ListContratControllable ctrlContrat(final Exchange exchange) {
}

And the value of dateBusinessManager still null , may be is there a way to
make like :
cdi-bean id=CtrlCB2A class=net.CtrlCb2aLclBean /

thxs for help, i really don t know to run CDI with camel.




--
View this message in context: 
http://camel.465427.n5.nabble.com/How-can-i-use-CDI-with-the-Camel-Context-tp5767375.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Problem with swagger in the camel-example-servlet-rest-tomcat

2015-05-21 Thread Christina Lin
I was using the latest snapshot. 
After your replay, 
I checked again with the 2.15.x branch, and it worked!!! 

Thanks!

-Christina



--
View this message in context: 
http://camel.465427.n5.nabble.com/Problem-with-swagger-in-the-camel-example-servlet-rest-tomcat-tp5767376p5767381.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: How can i use CDI with the Camel Context

2015-05-21 Thread kikou1984
I have tried to add to the tag beans.

xsi:schemalocation=http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/beans_1_0.xsd; 

and i add @Named to the Interface DateBusinessManager.

Named
public interface DateBusinessManager {

/**
 * 
 * 
 * @param date
 * @return
 * @throws DateBusinessException
 */
DateCalendar findDate(final java.util.Date date) throws
DateBusinessException;


Nothing change... :( 



--
View this message in context: 
http://camel.465427.n5.nabble.com/How-can-i-use-CDI-with-the-Camel-Context-tp5767375p5767382.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Problem with swagger in the camel-example-servlet-rest-tomcat

2015-05-21 Thread Claus Ibsen
Hi

What version of Camel do you use? And what JDK version?

On Thu, May 21, 2015 at 12:48 PM, Christina Lin c...@redhat.com wrote:
 I wanted to see how swagger works, but is having trouble with the
 camel-example-servlet-rest-tomcat quickstart example. After packaging it,
 and placing the WAR file in Tomcat 8.0.22. I was able play with the rest
 service without any problem.

 BUT, I was not able to get the
 http://localhost:8080/camel-example-servlet-rest-tomcat/api-docs; swagger
 API page working.

 It shows a NullPointerException. Is there a specific version of Tomcat that
 we need to use?

 java.lang.NullPointerException

 org.apache.camel.component.swagger.RestSwaggerReader$$anonfun$createParameters$2.apply(RestSwaggerReader.scala:190)

 org.apache.camel.component.swagger.RestSwaggerReader$$anonfun$createParameters$2.apply(RestSwaggerReader.scala:179)

 scala.collection.TraversableLike$WithFilter$$anonfun$foreach$1.apply(TraversableLike.scala:772)
 scala.collection.Iterator$class.foreach(Iterator.scala:727)
 scala.collection.AbstractIterator.foreach(Iterator.scala:1157)
 scala.collection.IterableLike$class.foreach(IterableLike.scala:72)
 scala.collection.AbstractIterable.foreach(Iterable.scala:54)

 scala.collection.TraversableLike$WithFilter.foreach(TraversableLike.scala:771)

 org.apache.camel.component.swagger.RestSwaggerReader.createParameters(RestSwaggerReader.scala:179)

 org.apache.camel.component.swagger.RestSwaggerReader$$anonfun$read$2.apply(RestSwaggerReader.scala:123)

 org.apache.camel.component.swagger.RestSwaggerReader$$anonfun$read$2.apply(RestSwaggerReader.scala:70)

 scala.collection.TraversableLike$WithFilter$$anonfun$foreach$1.apply(TraversableLike.scala:772)

 scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59)
 scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:47)

 scala.collection.TraversableLike$WithFilter.foreach(TraversableLike.scala:771)

 org.apache.camel.component.swagger.RestSwaggerReader.read(RestSwaggerReader.scala:70)

 org.apache.camel.component.swagger.RestApiListingCache$$anonfun$listing$1$$anonfun$apply$1.apply(RestApiListingCache.scala:42)

 org.apache.camel.component.swagger.RestApiListingCache$$anonfun$listing$1$$anonfun$apply$1.apply(RestApiListingCache.scala:41)
 scala.collection.immutable.List.foreach(List.scala:318)

 scala.collection.generic.TraversableForwarder$class.foreach(TraversableForwarder.scala:32)
 scala.collection.mutable.ListBuffer.foreach(ListBuffer.scala:45)

 org.apache.camel.component.swagger.RestApiListingCache$$anonfun$listing$1.apply(RestApiListingCache.scala:41)

 org.apache.camel.component.swagger.RestApiListingCache$$anonfun$listing$1.apply(RestApiListingCache.scala:38)
 scala.Option.orElse(Option.scala:257)

 org.apache.camel.component.swagger.RestApiListingCache$.listing(RestApiListingCache.scala:38)

 org.apache.camel.component.swagger.RestSwaggerApiDeclarationServlet.renderResourceListing(RestSwaggerApiDeclarationServlet.scala:171)

 org.apache.camel.component.swagger.RestSwaggerApiDeclarationServlet.doGet(RestSwaggerApiDeclarationServlet.scala:98)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
 org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

 org.apache.camel.component.swagger.RestSwaggerCorsFilter.doFilter(RestSwaggerCorsFilter.scala:44)



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Problem-with-swagger-in-the-camel-example-servlet-rest-tomcat-tp5767376.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: How can i use CDI with the Camel Context

2015-05-21 Thread Claus Ibsen
Hi

No camelContext is a spring based CamelContext.


On Thu, May 21, 2015 at 11:36 AM, kikou1984 hichem.ouesl...@atos.net wrote:
 Hi,

 I m using camel version 2.10.0.

 In my route spring XML , i want to use the CamelContextCDI instead of the
 DefaultCamelContext.

 How can i do it ?

 beans xmlns=http://www.springframework.org/schema/beans;
 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
 xmlns:context=http://www.springframework.org/schema/context;
 xsi:schemaLocation=http://www.springframework.org/schema/beans
 http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
 http://camel.apache.org/schema/spring
 http://camel.apache.org/schema/spring/camel-spring.xsd;
 import resource=classpath:/suivi-import-jms.xml /
 bean id=InitLcl class=net.InitLCLBean /
 bean id=CtrlCB2A class=net.CtrlCb2aLclBean /

 camelContext  id=TM-UNL-TEST
 xmlns=http://camel.apache.org/schema/spring; 

 is there a way to change the DefaultCamelContext, or to specify to the  a
 bean that it must run with CDI container.

 In this bean id = CtrlCB2A, i have the CDI.

 public class CtrlContratBean {

 @Inject
 DateBusinessManager dateBusinessManager;

 /**
  * Bean Ctrl Contrat
  *
  * @param exchange
  * @return
  */
 public ListContratControllable ctrlContrat(final Exchange exchange) 
 {
 }

 And the value of dateBusinessManager still null , may be is there a way to
 make like :
 cdi-bean id=CtrlCB2A class=net.CtrlCb2aLclBean /

 thxs for help, i really don t know to run CDI with camel.




 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/How-can-i-use-CDI-with-the-Camel-Context-tp5767375.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/


Problem with swagger in the camel-example-servlet-rest-tomcat

2015-05-21 Thread Christina Lin
I wanted to see how swagger works, but is having trouble with the 
camel-example-servlet-rest-tomcat quickstart example. After packaging it,
and placing the WAR file in Tomcat 8.0.22. I was able play with the rest
service without any problem. 

BUT, I was not able to get the
http://localhost:8080/camel-example-servlet-rest-tomcat/api-docs; swagger
API page working. 

It shows a NullPointerException. Is there a specific version of Tomcat that
we need to use? 

java.lang.NullPointerException

org.apache.camel.component.swagger.RestSwaggerReader$$anonfun$createParameters$2.apply(RestSwaggerReader.scala:190)

org.apache.camel.component.swagger.RestSwaggerReader$$anonfun$createParameters$2.apply(RestSwaggerReader.scala:179)

scala.collection.TraversableLike$WithFilter$$anonfun$foreach$1.apply(TraversableLike.scala:772)
scala.collection.Iterator$class.foreach(Iterator.scala:727)
scala.collection.AbstractIterator.foreach(Iterator.scala:1157)
scala.collection.IterableLike$class.foreach(IterableLike.scala:72)
scala.collection.AbstractIterable.foreach(Iterable.scala:54)

scala.collection.TraversableLike$WithFilter.foreach(TraversableLike.scala:771)

org.apache.camel.component.swagger.RestSwaggerReader.createParameters(RestSwaggerReader.scala:179)

org.apache.camel.component.swagger.RestSwaggerReader$$anonfun$read$2.apply(RestSwaggerReader.scala:123)

org.apache.camel.component.swagger.RestSwaggerReader$$anonfun$read$2.apply(RestSwaggerReader.scala:70)

scala.collection.TraversableLike$WithFilter$$anonfun$foreach$1.apply(TraversableLike.scala:772)

scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59)
scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:47)

scala.collection.TraversableLike$WithFilter.foreach(TraversableLike.scala:771)

org.apache.camel.component.swagger.RestSwaggerReader.read(RestSwaggerReader.scala:70)

org.apache.camel.component.swagger.RestApiListingCache$$anonfun$listing$1$$anonfun$apply$1.apply(RestApiListingCache.scala:42)

org.apache.camel.component.swagger.RestApiListingCache$$anonfun$listing$1$$anonfun$apply$1.apply(RestApiListingCache.scala:41)
scala.collection.immutable.List.foreach(List.scala:318)

scala.collection.generic.TraversableForwarder$class.foreach(TraversableForwarder.scala:32)
scala.collection.mutable.ListBuffer.foreach(ListBuffer.scala:45)

org.apache.camel.component.swagger.RestApiListingCache$$anonfun$listing$1.apply(RestApiListingCache.scala:41)

org.apache.camel.component.swagger.RestApiListingCache$$anonfun$listing$1.apply(RestApiListingCache.scala:38)
scala.Option.orElse(Option.scala:257)

org.apache.camel.component.swagger.RestApiListingCache$.listing(RestApiListingCache.scala:38)

org.apache.camel.component.swagger.RestSwaggerApiDeclarationServlet.renderResourceListing(RestSwaggerApiDeclarationServlet.scala:171)

org.apache.camel.component.swagger.RestSwaggerApiDeclarationServlet.doGet(RestSwaggerApiDeclarationServlet.scala:98)
javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

org.apache.camel.component.swagger.RestSwaggerCorsFilter.doFilter(RestSwaggerCorsFilter.scala:44)
  



--
View this message in context: 
http://camel.465427.n5.nabble.com/Problem-with-swagger-in-the-camel-example-servlet-rest-tomcat-tp5767376.html
Sent from the Camel - Users mailing list archive at Nabble.com.


is it dependency issue?

2015-05-21 Thread nono
when i try to start bundle, i got below error.
is it dependency issue?

Caused by: org.apache.camel.RuntimeCamelException: Cannot auto create
component: file
at
org.apache.camel.impl.DefaultCamelContext.getComponent(DefaultCamelContext.java:322)
at
org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:441)
... 27 more
Caused by: java.lang.ClassCastException:
org.apache.camel.impl.osgi.Activator$BundleComponentResolver cannot be cast
to org.apache.camel.spi.ComponentResolver
at
org.apache.camel.core.osgi.OsgiComponentResolver.getComponent(OsgiComponentResolver.java:72)
at
org.apache.camel.core.osgi.OsgiComponentResolver.resolveComponent(OsgiComponentResolver.java:64)
at
org.apache.camel.impl.DefaultCamelContext.getComponent(DefaultCamelContext.java:311)
... 28 more



--
View this message in context: 
http://camel.465427.n5.nabble.com/is-it-dependency-issue-tp5767374.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: How can i use CDI with the Camel Context

2015-05-21 Thread kikou1984
Hi Claus,

So how i can make CDI with Spring Context ? 

Thxs.



--
View this message in context: 
http://camel.465427.n5.nabble.com/How-can-i-use-CDI-with-the-Camel-Context-tp5767375p5767380.html
Sent from the Camel - Users mailing list archive at Nabble.com.


LoadBalancer seems to be doing some sort of throttling

2015-05-21 Thread apara
I am using Camel 2.15.1.

I have a route defined like this:

from(
vmAsyncEndpoint 
//vm://async.handle.event?blockWhenFull=truesize=4
)
.routeId(vmAsyncEndpoint.getEndpointUri())
.startupOrder(order())
.loadBalance()
.sticky(
simple(${body.partitionKey})
)
.inOnly(
makePipelineRoutes(
pipeline
)
);

The pipeline routes are defined as (pipeline 12 for example):
vm://pipeline_12?blockWhenFull=truepollTimeout=1000size=1000

I am seeing that the queue for the load balancer gets full at 40K, however,
the queues for the pipelines do not go above 200 (1000 is max) and it really
takes them a while to get there.  None of the queues are at 1000 (which
would cause the loadBalance to block).  When I observe via JMX, at the start
of the application the queues are at 5 or 2 or mostly ZERO.

Via JMX I see that Pipelines are defined with ConcurrentConsumers is 1,
CurrentQueueSize is 10 which is correct.

So, I am not sure why the load balancer would just not unload as much as it
can out of it's collection of 40,000 entries?  Is there some sort of
throttling that the load balancer is doing in addition to being sticky?

Thanks
-AP_








--
View this message in context: 
http://camel.465427.n5.nabble.com/LoadBalancer-seems-to-be-doing-some-sort-of-throttling-tp5767401.html
Sent from the Camel - Users mailing list archive at Nabble.com.


RE: camel-parent pom properties

2015-05-21 Thread Ronny Aerts
Hello,

This works very fine for everything which has to do with camel (as groupid) 
itself but not for dependencies with other groupid like the one below:
dependencies
dependency
groupIdorg.springframework.ws/groupId
artifactIdspring-ws-security/artifactId
 version${spring-ws-version}/version
/dependency
/dependencies
--
vriendelijke groeten,
Ronny Aerts – Intris nv – Wapenstilstandlaan 47, 2600 Berchem, België
RD Integration Architect
Prince II certified – ITIL certified
Tel: +32-3-326.50.75

-Original Message-
From: Henryk Konsek [mailto:hekon...@gmail.com]
Sent: vrijdag 15 mei 2015 17:23
To: users@camel.apache.org
Subject: Re: camel-parent pom properties

Hi,

The better practice is to import Camel parent as BOM:


dependencyManagement
  dependnecies
dependency
  groupIdorg.apache.camel/groupId
  artifactIdcamel-parent/artifactId
  version${camel.version}/version
  typepom/type
  scopeimport/scope
/dependency
  /dependnecies
/dependencyManagement

And then simply:

  dependency
  groupIdorg.apache.camel/groupId
  artifactIdcamel-core/artifactId
/dependency

Cheers!

pt., 15.05.2015 o 15:24 użytkownik Ronny Aerts ronny.ae...@intris.be
napisał:

Hello camel community,

I'm interested in using the maven properties which are defined in the 
camel-parent pom.xml. In order to inherit these maven properties, I need to set 
the parent in my projects to the camel-parent. The point is that my projects 
use other version numbers than those of camel and this results in unresolvable 
camel-core references because the camel-parent uses the ${project.version} 
variable in its dependencies (which is not 2.15.2 in my projects).

dependency
groupIdorg.apache.camel/groupId
artifactIdcamel-core/artifactId
version${project.version}/version
/dependency

Is there a workaround for this?

--
vriendelijke groeten,
Ronny Aertsmailto:ronny.ae...@intris.be - Intris nv - Wapenstilstandlaan 47, 
2600 Berchem, België RD Integration Architect Prince 
IIhttp://nl.wikipedia.org/wiki/PRINCE2 certified - ITIL 
http://nl.wikipedia.org/wiki/Information_Technology_Infrastructure_Library
certified
Tel: +32-3-326.50.75

Intris nv
Wapenstilstandlaan 47
B-2600 Berchem Tel. +32 3 326 50 75
Fax +32 3 326 42 23
www.intris.behttp://www.intris.be/ [
http://www.intris.be/mail/AEO_Sticker_108pxRGB.jpg] http://www.intris.be

DISCLAIMER
This is an e-mail from Intris. The information contained in this communication 
is intended solely for use by the individual or entity to whom it is addressed.
Use of this communication by others is prohibited. If the e-mail message was 
sent to you by mistake, please notify supp...@intris.bemailto:
supp...@intris.be, destroy it without reading, using, copying or disclosing 
its contents to any other person.
We accept no liability for damage related to data and/or documents which are 
communicated by electronic mail.
Intris nv
Wapenstilstandlaan 47
B-2600 Berchem  Tel.  +32 3 326 50 75
Fax  +32 3 326 42 23
www.intris.behttp://www.intris.be/
[http://www.intris.be/mail/AEO_Sticker_108pxRGB.jpg] http://www.intris.be

DISCLAIMER
This is an e-mail from Intris. The information contained in this communication 
is intended solely for use by the individual or entity to whom it is addressed.
Use of this communication by others is prohibited. If the e-mail message was 
sent to you by mistake, please notify 
supp...@intris.bemailto:supp...@intris.be, destroy it without reading, using, 
copying or disclosing its contents to any other person.
We accept no liability for damage related to data and/or documents which are 
communicated by electronic mail.


Re: camel sql outputType=SelectList is giving errors

2015-05-21 Thread Henryk Konsek
Hi,

Option outputType has SelectList by default. Does it mean that your
endpoint always fail or only when you set outputType=SelectList explictly.


Cheers.

czw., 21.05.2015 o 10:51 użytkownik chaituu yarlagadd...@gmail.com
napisał:

  using 2.14.1 version...

  route id=route1
from uri=sql:select *  from

 Employee?dataSource=empSourceamp;outputType=SelectListamp;outputClass=com.xxx.util.Employeeamp;consumer.useIterator=true/
bean ref=htmlprocess/
 /route


 In the bean..
  final ListTelecast record =
 exchange.getIn().getBody(List.class);
   LOG.info( record size: + record.size());

 failed polling endpoint:

 Endpoint[sql://select%20*%20%20from%20EMPLOYEE?consumer.useIterator=truedataSource=elogDataSourceoutputClass=com.xxx.util.TelecastoutputType=SelectList].
 Will try again at next poll. Caused by:
 [org.springframework.beans.BeanInstantiationException - Could not
 instantiate bean class [com.xxx.util.Telecast]: Is it an abstract class?;
 nested exception is java.lang.InstantiationException:
 com.xxx.util.Telecast]
 org.springframework.beans.BeanInstantiationException: Could not instantiate
 bean class [com.xxx.util.Telecast]: Is it an abstract class?; nested
 exception is java.lang.InstantiationException: com.xxx.util.Telecast
 at
 org.springframework.beans.BeanUtils.instantiate(BeanUtils.java:82)
 at

 org.springframework.jdbc.core.BeanPropertyRowMapper.mapRow(BeanPropertyRowMapper.java:235)
 at

 org.springframework.jdbc.core.RowMapperResultSetExtractor.extractData(RowMapperResultSetExtractor.java:92)
 at

 org.apache.camel.component.sql.SqlEndpoint.queryForList(SqlEndpoint.java:260)
 at

 org.apache.camel.component.sql.SqlConsumer$1.doInPreparedStatement(SqlConsumer.java:102)




 --
 View this message in context:
 http://camel.465427.n5.nabble.com/camel-sql-outputType-SelectList-is-giving-errors-tp5767373.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



Re: Problem with swagger in the camel-example-servlet-rest-tomcat

2015-05-21 Thread Claus Ibsen
Hi

Okay thanks. There has been some swagger improvements for 2.16.

So maybe it broke something in the example.
You are welcome to log a JIRA so we wont forget about this - as its
maybe sometimes a bit easy to not test the example but all the unit
tests works.
http://camel.apache.org/support

On Thu, May 21, 2015 at 2:34 PM, Christina Lin c...@redhat.com wrote:
 I was using the latest snapshot.
 After your replay,
 I checked again with the 2.15.x branch, and it worked!!!

 Thanks!

 -Christina



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Problem-with-swagger-in-the-camel-example-servlet-rest-tomcat-tp5767376p5767381.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/


On exception notify first error.

2015-05-21 Thread Cecilio Alvarez
Hello,

is there a way on the on exception or in the error handler to send a message
one time and keep retrying?


Something like this but with error handler or on exception.

route
from uri=activemq:in/
doTry
throw new=sql.Exception/
doCatch
exceptionjava.sql.SQLException/exception
choice
when
simple${header.Reported} == 
null/simple
setHeader headerName=Reported
simpletrue/simple
/setHeader
multicast
to uri=activemq:NOTIFY/
to uri=activemq:in/
/multicast
/when
otherwise
to uri=activemq:in/
/otherwise
/choice
/doCatch
/doTry
/route

Any suggestion will be appreciated.

Cecilio.



--
View this message in context: 
http://camel.465427.n5.nabble.com/On-exception-notify-first-error-tp5767385.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: How can i use CDI with CamelTestSupport

2015-05-21 Thread Willem Jiang
I just added a comment on your issue.

I think you may need to extends the CdiTestSupport instead of 
CamelTestSupport. The key point is find the right CdiContainer to use, as I 
didn't see the code of EJBContainerRunner, you may need to the work there if 
the CdiTestSupport doesn't work.


--  
Willem Jiang

Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On May 21, 2015 at 3:58:00 PM, kikou1984 (hichem.ouesl...@atos.net) wrote:
 I found a Camel-cdi.jar contains a CdiBeanRegistry with method lookup, how
 can we use it please in the context ?
  
  
  
 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/How-can-i-use-CDI-with-CamelTestSupport-tp5767328p5767370.html
   
 Sent from the Camel - Users mailing list archive at Nabble.com.
  



Re: onException query for sending error message to queue before starting retry

2015-05-21 Thread Andrew Block
Vanshul,

Take a look at the onRedelivery (or onRedeliveryRef for spring/blueprint) that 
can be applied to either onException [1]  or errorHandler [2]. It allows for 
for a custom processor to be executed prior to redelivering a message. You 
should be able to configure a ProducerTemplate to send to a downstream 
endpoint. It should provide the functionality for your use case.

Thanks,
Andy

[1] - http://camel.apache.org/exception-clause.html
[2] - http://camel.apache.org/error-handler.html  



-- 
Andrew Block


On May 21, 2015 at 11:26:51 AM, Vanshul.Chawla (vanshul.cha...@target.com) 
wrote:

Hello,  

We have a requirement wherein we need to perform a retry for 10 times with gap 
of 30 min. If retries fail, then we need to put message in error queue. Issue 
here is operations team will be unaware of any issues will 5 hrs 30 min.  
Is there a way OnException puts one error message before starting retry and may 
be one after all retry are exhausted.  


Thanks and Regards,  

Vanshul Chawla  



Re: On exception notify first error.

2015-05-21 Thread Andrew Block
Hi,

You can use a combination of the retryWhile property of onException to allow 
for indefinite retrying. In addition, you can also use the onRedelivery 
property to define a custom process to perform action prior to the redelivery 
of a message. A ProducerTemplate can be used to send to a downstream process.

- Andy

-- 
Andrew Block

On May 21, 2015 at 9:02:33 AM, Cecilio Alvarez (cecilio.alva...@hotmail.com) 
wrote:

Hello,  

is there a way on the on exception or in the error handler to send a message  
one time and keep retrying?  


Something like this but with error handler or on exception.  

route  
from uri=activemq:in/  
doTry  
throw new=sql.Exception/
doCatch  
exceptionjava.sql.SQLException/exception  
choice  
when  
simple${header.Reported} == null/simple  
setHeader headerName=Reported  
simpletrue/simple  
/setHeader  
multicast  
to uri=activemq:NOTIFY/  
to uri=activemq:in/  
/multicast
/when  
otherwise  
to uri=activemq:in/  
/otherwise  
/choice  
/doCatch  
/doTry  
/route  

Any suggestion will be appreciated.  

Cecilio.  



--  
View this message in context: 
http://camel.465427.n5.nabble.com/On-exception-notify-first-error-tp5767385.html
  
Sent from the Camel - Users mailing list archive at Nabble.com.  


Re: LoadBalancer seems to be doing some sort of throttling

2015-05-21 Thread apara
So, it turns out that the processing of simple expressions is apparently
somewhat slow (my camel routes are currently handling 2300 events/second) so
each message is taking milliseconds to get through the pipelines.  If the
load balancing calculation takes too long it cannot keep the pipelines full.

I replaced the sticky(...) specification with my own code and things are
flying:

.loadBalance(
new QueueLoadBalancer() {
@Override
protected Processor chooseProcessor(final ListProcessor
processors, final Exchange exchange) {
//Get the partition key
//
final String
partitionKey =
exchange
.getIn()
.getBody(
EventData.class
)
.getPartitionKey();

//Calculate the position
//
final int
size = processors.size(),
index = (partitionKey.hashCode() % size + size) %
size;

//Return the processor to use
//
return
processors
.get(
index
);
}
}
)

It's amazing the kind of issues you start to find at these processing
speeds.  I am quite satisfied with Camel's raw processing speed when it
comes to core message routing.

-AP_




--
View this message in context: 
http://camel.465427.n5.nabble.com/LoadBalancer-seems-to-be-doing-some-sort-of-throttling-tp5767401p5767406.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: LoadBalancer seems to be doing some sort of throttling

2015-05-21 Thread Claus Ibsen
Hi

Yes your custom code is compiled java code, where as when using simple
with an OGNL expression, eg body.partionKey then Camel need to invoke
the method using reflection and hence the overhead.

You can likely use groovy or mvel as the expression and do some code like:

.sticky().groovy(exchange.getBody(EventData.class).getPartitionKey())

As they would be able to compile this on the fly and run it faster


On Fri, May 22, 2015 at 6:02 AM, apara ap...@standardset.com wrote:
 So, it turns out that the processing of simple expressions is apparently
 somewhat slow (my camel routes are currently handling 2300 events/second) so
 each message is taking milliseconds to get through the pipelines.  If the
 load balancing calculation takes too long it cannot keep the pipelines full.

 I replaced the sticky(...) specification with my own code and things are
 flying:

 .loadBalance(
 new QueueLoadBalancer() {
 @Override
 protected Processor chooseProcessor(final ListProcessor
 processors, final Exchange exchange) {
 //Get the partition key
 //
 final String
 partitionKey =
 exchange
 .getIn()
 .getBody(
 EventData.class
 )
 .getPartitionKey();

 //Calculate the position
 //
 final int
 size = processors.size(),
 index = (partitionKey.hashCode() % size + size) %
 size;

 //Return the processor to use
 //
 return
 processors
 .get(
 index
 );
 }
 }
 )

 It's amazing the kind of issues you start to find at these processing
 speeds.  I am quite satisfied with Camel's raw processing speed when it
 comes to core message routing.

 -AP_




 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/LoadBalancer-seems-to-be-doing-some-sort-of-throttling-tp5767401p5767406.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/


Using shared Netty configuration with Rest DSL

2015-05-21 Thread Alex Soto
I would like to reuse the same Netty Service that is configured outside of the 
Rest DSL.  For example I have the Netty and SSL configuration:


camel:sslContextParameters id=sslParams
 camel:keyManagers keyPassword=changeit
   camel:keyStore resource={{env:HOME}}/localhost.jks password=changeit 
type=JKS provider=SUN/
 /camel:keyManagers
 camel:trustManagers
   camel:keyStore resource={{env:HOME}}/localhost.jks password=changeit 
type=JKS provider=SUN/
 /camel:trustManagers
/camel:sslContextParameters

bean id=configuration 
class=org.apache.camel.component.netty4.http.NettySharedHttpServerBootstrapConfiguration
   property name=port value=8890/
   property name=host value=0.0.0.0/
   property name=backlog value=50/
   property name=sslContextParameters ref=sslParams/
   property name=ssl value=true/
/bean

bean id=sharedNettyHttpServer 
class=org.apache.camel.component.netty4.http.DefaultNettySharedHttpServer 
init-method=start destroy-method=stop
   property name=nettyServerBootstrapConfiguration ref=configuration/
/bean


Now in my Camel Context I declare the Rest DSL:


camelContext id=camel-context-name trace=true 
xmlns=http://camel.apache.org/schema/spring 
http://camel.apache.org/schema/spring

 restConfiguration component=netty4-http  
  camel:componentProperty key=nettySharedHttpServer 
value=#sharedNettyHttpServer/
  componentProperty key=nettyServerBootstrapConfiguration 
value=#configuration/
  camel:endpointProperty key=nettyServerBootstrapConfiguration 
value=#configuration/
 /restConfiguration
  
 rest path=/customers/
get uri=/{id}
to uri=direct:getCustomers/
/get
get uri=/{id}/orders
to uri=direct:getCustomerOrders/
/get
post uri=/neworder
to uri=direct:newOrder/
/post
/rest


However, it does not seem to be picking up the shared configuration.  Log file 
shows:

BootstrapFactory on port 0 is using bootstrap configuration: 
[NettyServerBootstrapConfiguration{protocol='tcp', host=‘X.local', port=0, 
broadcast=false, sendBufferSize=65536, receiveBufferSize=65536, 
receiveBufferSizePredictor=0, workerCount=0, bossCount=1, keepAlive=true, 
tcpNoDelay=true, reuseAddress=true, connectTimeout=1, backlog=0, 
serverInitializerFactory=org.apache.camel.component.netty4.http.HttpServerInitializerFactory@2db0d008,
 nettyServerBootstrapFactory=null, options=null, ssl=false, sslHandler=null, 
sslContextParameters='null', needClientAuth=false, 
enabledProtocols='TLSv1,TLSv1.1,TLSv1.2, keyStoreFile=null, 
trustStoreFile=null, keyStoreResource='null', trustStoreResource='null', 
keyStoreFormat='JKS', securityProvider='SunX509', passphrase='null', 
bossGroup=null, workerGroup=null, networkInterface='null’}]

I could not find any examples of how to accomplish this.  Any hints?

Best regards,
Alex soto

Re: is it dependency issue?

2015-05-21 Thread Shemeem
Hi,

What is your OSGI container? 
Is it Karaf? If so, you have to install camel in karaf (even though, you
have provided dependency in camel ) with the below command :

karaf@root features:chooseurl camel 2.12.1 (provide the version you want)
karaf@root features:install camel

These camel commands may have little difference based on your karaf version.
 
This is how you should initialize your camel context for OSGI bundles in
case of Java DSL.

OsgiServiceRegistry reg = new OsgiServiceRegistry(bundleContext); 

context=new OsgiDefaultCamelContext(bundleContext, reg); 




--
View this message in context: 
http://camel.465427.n5.nabble.com/is-it-dependency-issue-tp5767374p5767390.html
Sent from the Camel - Users mailing list archive at Nabble.com.


onException query for sending error message to queue before starting retry

2015-05-21 Thread Vanshul . Chawla
Hello,

We have a requirement wherein we need to perform a retry for 10 times with gap 
of 30 min. If retries fail, then we need to put message in error queue. Issue 
here is operations team will be unaware of any issues will 5 hrs 30 min.
Is there a way OnException puts one error message before starting retry and may 
be one after all retry are exhausted.


Thanks and Regards,

Vanshul Chawla