CamelExceptionCaught not cleared after successful redelivery

2015-05-07 Thread PaSik
Hi, 

Could you guys please help me out with one thing. 

I have a route that has an error handler configured for a specific exception 
with redelivery settings. When this exception is thrown the redelivery is 
attempted and succeeds but before the processing is continued only the 
exception field on the exchange is cleared but not the CamelExceptionCaught 
property (in RedeliveryErrorHandler). 
The processing is then forwarded to another route through seda that copies the 
exchange along with the 
CamelExceptionCaught exchange property and it happens so that on this other 
route a component is used (soap data format, specifically it's the 
Soap11DataFormatAdapter class) that checks the property and throws the 
exception on this other route. This looks really weird as I'm getting an 
exception on a route/thread that never throws one. 

I'm wondering whether this property shouldn't be cleared after successful 
redelivery. Please let me know if I should register a ticket for this issue. 

Also what would be the suggested way of handling this problem (I'm using 
version 2.10.7 and don't have the luxury of upgrading to a newer version). I'm 
thinking about clearing this property manually on entry to the seda route, but 
maybe there is a better way to handle this. My suggested solution should work 
because no other component seems to be throwing exceptions using 
CamelExceptionCaught property in the original route. 

On the other hand maybe it's the soap data format that checks the property that 
should be fixed? Maybe it should only be reacting to the exceptions set 
directly on the exchange? 

Or maybe it's me who is doing at all wrong and all the camel components are 
just fine . 

Thanks, 
Tom


Apache zookeeper component query

2015-05-07 Thread gilboy
Hi

My application needs to run hot/warm, i.e. 2 instances of the application
running but routes running on one machine only. I am using the camel
zookeeper component to solve this problem

All works fine, when both instances of the application are starting up the
2nd instance outputs a big error message. When the 1st instance shuts down
the routes on the 2nd instance correctly start to fire.

Is there anyway I can prevent the error being output below. I don't see that
it should be output as an error

Thanks
Joe

20150507 08:48:30,106 BST ERROR quartz.QuartzEndpoint
[DefaultQuartzScheduler-Master Slave KT example Node 1_Worker-2] Error
processing exchange. Exchange[Message: [Body is null]]. Caused by:
[org.quartz.JobExecutionException - java.lang.IllegalStateException:
Zookeeper based route policy prohibits processing exchanges, stopping route
and failing the exchange]
20150507 08:48:30,108 BST INFO  core.JobRunShell
[DefaultQuartzScheduler-Master Slave KT example Node 1_Worker-2] Job
DEFAULT.quartz-endpoint1 threw a JobExecutionException: 
org.quartz.JobExecutionException: java.lang.IllegalStateException: Zookeeper
based route policy prohibits processing exchanges, stopping route and
failing the exchange [See nested exception: java.lang.IllegalStateException:
Zookeeper based route policy prohibits processing exchanges, stopping route
and failing the exchange]
at
org.apache.camel.component.quartz.QuartzEndpoint.onJobExecute(QuartzEndpoint.java:125)
at org.apache.camel.component.quartz.CamelJob.execute(CamelJob.java:61)
at org.quartz.core.JobRunShell.run(JobRunShell.java:223)
at
org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549)
Caused by: java.lang.IllegalStateException: Zookeeper based route policy
prohibits processing exchanges, stopping route and failing the exchange
etc



--
View this message in context: 
http://camel.465427.n5.nabble.com/Apache-zookeeper-component-query-tp5766805.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: CamelExceptionCaught not cleared after successful redelivery

2015-05-07 Thread Henryk Konsek
Hi Tom,

Have you got a chance to check if the issue is still valid for the newer
Camel? 2.10 is reeeally old one and it is very likely that the issue has
been already solved.

Cheers!

czw., 7.05.2015 o 09:26 użytkownik PaSik tompa...@poczta.fm napisał:

 Hi,

 Could you guys please help me out with one thing.

 I have a route that has an error handler configured for a specific
 exception with redelivery settings. When this exception is thrown the
 redelivery is attempted and succeeds but before the processing is continued
 only the exception field on the exchange is cleared but not the
 CamelExceptionCaught property (in RedeliveryErrorHandler).
 The processing is then forwarded to another route through seda that copies
 the exchange along with the
 CamelExceptionCaught exchange property and it happens so that on this
 other route a component is used (soap data format, specifically it's the
 Soap11DataFormatAdapter class) that checks the property and throws the
 exception on this other route. This looks really weird as I'm getting an
 exception on a route/thread that never throws one.

 I'm wondering whether this property shouldn't be cleared after successful
 redelivery. Please let me know if I should register a ticket for this
 issue.

 Also what would be the suggested way of handling this problem (I'm using
 version 2.10.7 and don't have the luxury of upgrading to a newer version).
 I'm thinking about clearing this property manually on entry to the seda
 route, but maybe there is a better way to handle this. My suggested
 solution should work because no other component seems to be throwing
 exceptions using CamelExceptionCaught property in the original route.

 On the other hand maybe it's the soap data format that checks the property
 that should be fixed? Maybe it should only be reacting to the exceptions
 set directly on the exchange?

 Or maybe it's me who is doing at all wrong and all the camel components
 are just fine .

 Thanks,
 Tom



Re: Unmarshal not working

2015-05-07 Thread jainmcs03

Hi Claus,

Enabled log4j as DEBUG and found below error, couldn't find other cause. 

xubuntu-49326-1430979187444-0-4 on ExchangeId:
ID-analyzer-xubuntu-49326-1430979187444-0-2). On delivery attempt: 1 caught:
java.io.IOException: javax.xml.bind.UnmarshalException
 - with linked exception:
[com.sun.istack.SAXParseException2; lineNumber: 1; columnNumber: 39;
unexpected element (uri:http://www.w3.org/2003/05/soap-envelope;,
local:Envelope). Expected elements are
{http://ws.cdyne.com/WeatherWS/}ArrayOfWeatherDescription,{http://ws.cdyne.com/WeatherWS/}ForecastReturn,{http://ws.cdyne.com/WeatherWS/}GetCityForecastByZIP,{http://ws.cdyne.com/WeatherWS/}GetCityForecastByZIPResponse,{http://ws.cdyne.com/WeatherWS/}GetCityWeatherByZIP,{http://ws.cdyne.com/WeatherWS/}GetCityWeatherByZIPResponse,{http://ws.cdyne.com/WeatherWS/}GetWeatherInformation,{http://ws.cdyne.com/WeatherWS/}GetWeatherInformationResponse,{http://ws.cdyne.com/WeatherWS/}WeatherReturn]

Regards,
Jayendran



--
View this message in context: 
http://camel.465427.n5.nabble.com/Unmarshal-not-working-tp5766790p5766794.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Unmarshal not working

2015-05-07 Thread jainmcs03

Hi Team,

JAXB can only unmarshall an XML if the soap envelope has already been
removed. However, the SOAP response I'm trying to unmarshall has its
namespace declaration on the soap envelope. So how to remove the SOAP
envelope in camel route.

Regards,
Jayendran



--
View this message in context: 
http://camel.465427.n5.nabble.com/Unmarshal-not-working-tp5766790p5766797.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Destroying Dynamically Add Routes

2015-05-07 Thread Claus Ibsen
Hi

Yeah you can assign the route id with .routeId then you know the id.
Then you can stop and remove the routes by its id.


On Wed, May 6, 2015 at 10:57 PM, bonez05 thibaul...@osu.edu wrote:
 I'm adding dynamic routes during runtime by using

 context.addRoutes(new MyDynamicRouteBuilder(...) )

 I need a custom *.from()* location, which to my understanding I can't do
 with DynamicRouter EIP..

 context.addRoutes does not return a route id ... do I need to stop and
 shutdown the route when its done? How do I do this?

 Thanks




 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Destroying-Dynamically-Add-Routes-tp5766785.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: websocket with jetty 9

2015-05-07 Thread Claus Ibsen
Hi

You need Camel 2.15.x for Jetty 9 support.

On Wed, May 6, 2015 at 6:19 PM, Amit amitpatel2...@gmail.com wrote:
 We are currently using Apache Camel 2.11.4, but we can migrate to 2.15.x

 route
 ==
 route xmlns=http://camel.apache.org/schema/spring; trace=true
 from uri=websocket://invokeService2/v1/helloWebsocket /

 transform
groovy Message received from WebSocket Client:${body}
 /groovy
 /transform

 /route


 Exception
 ==
 12:04:28.303 [com.att.ajsc.runner.Runner.main()] ERROR ajsc.ComputeService -
 NMBS-COMPUTESVC-0042: addRoute for invokeService2:websocket:v1 failed  -
 EXCEPTION: Failed to create route invokeService2:websocket:v1:
 Route(invokeService2:websocket:v1)[[From[websocket://invokeS... because of
 Failed to resolve endpoint: websocket://invokeService2/v1/helloWebsocket due
 to: Cannot auto create component: websocket
 CAUSED BY: java.lang.ClassNotFoundException:
 org.eclipse.jetty.http.ssl.SslContextFactory
 STACKTRACE: at org.apache.camel.model.RouteDefinition(addRoutes:181)
 at org.apache.camel.impl.DefaultCamelContext(startRoute:756)
 at org.apache.camel.impl.DefaultCamelContext(startRouteDefinitions:1850)
 at org.apache.camel.impl.DefaultCamelContext(addRouteDefinitions:693)
 at org.apache.camel.model.ModelCamelContext$addRouteDefinitions(call:-1)
 at ajsc.ComputeService(addRoute:778)
 at ajsc.ComputeService$_init_closure15(doCall:876)
 at ajsc.ComputeService(init:876)
 at ajsc.ComputeService$init(call:-1)
 at ajsc.RouteMgmtService(init:120)
 at ajsc.RouteMgmtService$init(call:-1)
 at ajsc.ContextMgr(onApplicationEvent:16)
 at
 org.springframework.context.event.SimpleApplicationEventMulticaster(multicastEvent:97)
 at
 org.springframework.context.support.AbstractApplicationContext(publishEvent:327)
 at
 org.springframework.context.support.AbstractApplicationContext(finishRefresh:941)
 at
 org.springframework.context.support.AbstractApplicationContext(refresh:475)




 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/websocket-with-jetty-9-tp5766712p5766780.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: Unmarshal not working

2015-05-07 Thread Claus Ibsen
Hi

If its about empty body etc then read this FAQ
http://camel.apache.org/why-is-my-message-body-empty.html

On Thu, May 7, 2015 at 7:32 AM, jainmcs03 tojayendran.in...@gmail.com wrote:

 Hi Team,

 I'm trying webservice proxy with camel 2.15.1. In this trying to unmarshal
 the response message using unmarshal component, below the way route
 defining. Real service getting invoked and received response afterwards no
 process, no more logs in the console. Pls let me know if im wrong. Thanks,

 endpoint id=callRealWebService
 uri=http://wsf.cdyne.com/WeatherWS/Weather.asmx/
 route errorHandlerRef=myDeadLetterErrorHandler streamCache=true
   from uri=cxf:bean:weatherReport?dataFormat=MESSAGE/
   wireTap
 uri=file:/home/analyzer/Desktop/input/?fileName=request.xml/
   to uri=log:input/
   removeHeaders pattern=CamelHttp*/
   to ref=callRealWebService/
   wireTap
 uri=file:/home/analyzer/Desktop/output/?fileName=response.xml/

   unmarshal
 jaxb prettyPrint=true contextPath=com.cdyne.ws.weatherws/
   /unmarshal
   process ref=processor/
   to uri=log:output/
 /route

 Regards,
 Jayendran




 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Unmarshal-not-working-tp5766790.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/


camel-context.xml getting loaded multiple times

2015-05-07 Thread sureshsg
Hi I have 3 wars running on a single tomcat instance. Each of the war has a
spring application context and camel-context.xml. Again each of the war has
a common library. This common library also has camel-context.xml. The error
is common library's camel-context is getting loaded multiple times and
resulting in multiple consumers for an endpoint.

I am using contextScan to load the routes and have also tried specifying the
includes package but did not work.

Could you please help?



--
View this message in context: 
http://camel.465427.n5.nabble.com/camel-context-xml-getting-loaded-multiple-times-tp5766803.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: How to bind context properties to method parameters?

2015-05-07 Thread Claus Ibsen
Hi

You can likely bind using the @Simple language and refer to the
properties with an expression in the likes of something:
camelContext.properties['foo']

http://camel.apache.org/simple


On Thu, May 7, 2015 at 6:53 PM, toomanyedwards toomanyedwa...@gmail.com wrote:
 Yes, we want to be able to bind to the properties on the CamelContext.  The
 reason we want to do this is that we have config information that is
 effectively immutable for the life of the CamelContext  (timeouts, db config
 info, etc.) and our routes depend on this info.  When our routes execute we
 want to validate that all the preconditions for config data (Message
 headers, Exchange properties and Context properties) needed by the route are
 met.  To do this we have a bean for each of our routes that implements a
 validateRoutePreconditons method and we invoke this method via camel bean
 at the beginning of the route execution.  Example validator beans:

 public class RouteAValidatorBean
 {

 public void validateRoutePreconditions(
 @Header(NAME_OF_HEADER_NEEDED_BY_ROUTE_A)String
 valueOfHeaderNeededByRouteA
 )
 {
 // Check if needed header value is set and if not throw
 exception
 }
 }

 public class RouteBValidatorBean
 {

 public void validateRoutePreconditions(
 @Property(NAME_OF_EXCHANGE_PROPERTY_NEEDED_BY_ROUTE_B)String
 valueOfExchangePropertyNeededByRouteB
 )
 {
 // Check if needed exchange property value is set and if not
 throw exception
 }
 }


 We'd like to be able validate that the required camelcontext properties are
 set in a similar fashion.  I guess one option would be to have a parameter
 of type CamelContext on our validate method and then Camel should
 dynamically bind this right?  Then in our validator method we'd have to
 explicitly get the properties we care about from the context.  Not quite as
 clean as being able to just bind context properties that we care about (as
 we can do for headers and exchange properties), but might be the best
 solution.  Is there a better approach to this?  Are CamelContext properties
 the appropriate place to cache static config info that is immutable or is
 there a preferred way to do this?

 Thanks for your insight.

 -e



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/How-to-bind-context-properties-to-method-parameters-tp5766819p5766828.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: Polling DB with quartz2 stateful

2015-05-07 Thread Mansour Al Akeel
Yes, I had a look earlier at this component. But I don't understand
how it solve my problem. Can you please elaborate ?


On Thu, May 7, 2015 at 7:56 PM, fradj zayen zaye...@gmail.com wrote:
 Hi,
 did you tried to use sql component?
 http://camel.apache.org/sql-component.html
 Regards
 Fradj

 2015-05-07 15:08 GMT+01:00 Mansour Al Akeel mansour.alak...@gmail.com:

 Usually I do this in plain java without using camel, however, I would
 like to start using camel for similar tasks.

 I need to use stateful job t opreserve state and variable for last
 run. One of these variable is the ID for the last record that was
 processed. I have seen that some developers mark a field with DONE
 in the originating table. However this is not possible as we don't
 have write permission to the originating table. And we can not read
 all the records, because the table may get big.



 So here's what I want to do:

 // poll the table every 5 seconds

 // if any new resords added or update_timestamp changed, then select
 those new records

 // use Message Enricher to get the new data from the DB. Iterate over
 them.

 // Send each updated record to message queue to be indexed by lucene
 or JDBC endpoint to be inserted into the target table.

 // store the last_id or timestamp for the processed recored to be used
 in the next run.

 A similar functionaity, I may need soon to poll CIMS sharepoint, where
 I don't have write access in the originating DB.

 I was not able to locate any example for using quartz2 stateful job.

 Any advice or pointer ?

 Thank you




Re: StAXSource to InputStream direct conversion

2015-05-07 Thread Claus Ibsen
Hi

Yeah sounds much better if the conversion can happen more directly and
faster in a streaming style.

On Thu, May 7, 2015 at 4:26 PM, Aki Yoshida elak...@gmail.com wrote:
 Hi,
 There is currently no direct type conversion from StAXSource or
 XMLStreamReadder to InputStream. Am I correct? I noticed this while
 looking at the camel-cxf's StAXSource related xml-namespace issue
 (CAMEL-8663) when converting to InputStream, the conversion succeeded
 but went via DOM's NodeList, which you wouldn't really want.

 Assuming this assumption, I am wondering if we can add a direct
 converter. I wrote a class that can convert XMLStreamReader to
 InputStream or Reader using a small buffer while I was doing the
 xmltokenizer last year. A converter can be easily written using this
 approach.

 The code is available here and you can look at them.

 https://github.com/elakito/misc-xml/blob/master/src/main/java/de/elakito/misc/xml/util/XMLStreamReaderInputStream.java
 https://github.com/elakito/misc-xml/blob/master/src/main/java/de/elakito/misc/xml/util/XMLStreamReaderReader.java

 Let me know what you think.

 regards, aki



-- 
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/


Use hdfs2 component in Hadoop HA mode

2015-05-07 Thread Karpov, Ilya
Hi guys,
I can't find a way to use camel-hdfs2 component for Hadoop in HA mode.
I set my ha configuration in core-site.xml and hdfs-site.xml and put them
in classpath, set nameservice name instead of host in hdfs2 endpoint uri,
finally - no luck.

Is this feature supported in any way?
-- 
*Ilya Karpov*
Developer

CleverDATA
make your data clever


Re: Camel Resequencer and JMs transactions

2015-05-07 Thread Claus Ibsen
Hi

Yes the resequencer is memory based, and it is NOT possible to make it
part of a transaction.


On Fri, May 8, 2015 at 6:28 AM, amit2103 ami...@nrifintech.com wrote:
 Hi,

 My scenario is that I have 1 jms queue, from which I read with concurrent
 consumeres, use resequencer and a message header to  arrange the messages
 and then send them to another queue.

 Our route is transacted. Now does the sending part happen in a transaction.
 It seems to me that although the processor is transacted, when resequncer is
 applied, the sending part is not transacted. As a result for a very short
 period of time, the messages are in memory yet not send to the other queue.

 is my assumption correct, is there any way to make the whole process
 transacted.



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Camel-Resequencer-and-JMs-transactions-tp5766843.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/


Camel Resequencer and JMs transactions

2015-05-07 Thread amit2103
Hi,

My scenario is that I have 1 jms queue, from which I read with concurrent
consumeres, use resequencer and a message header to  arrange the messages
and then send them to another queue.

Our route is transacted. Now does the sending part happen in a transaction.
It seems to me that although the processor is transacted, when resequncer is
applied, the sending part is not transacted. As a result for a very short
period of time, the messages are in memory yet not send to the other queue.

is my assumption correct, is there any way to make the whole process
transacted.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-Resequencer-and-JMs-transactions-tp5766843.html
Sent from the Camel - Users mailing list archive at Nabble.com.


StAXSource to InputStream direct conversion

2015-05-07 Thread Aki Yoshida
Hi,
There is currently no direct type conversion from StAXSource or
XMLStreamReadder to InputStream. Am I correct? I noticed this while
looking at the camel-cxf's StAXSource related xml-namespace issue
(CAMEL-8663) when converting to InputStream, the conversion succeeded
but went via DOM's NodeList, which you wouldn't really want.

Assuming this assumption, I am wondering if we can add a direct
converter. I wrote a class that can convert XMLStreamReader to
InputStream or Reader using a small buffer while I was doing the
xmltokenizer last year. A converter can be easily written using this
approach.

The code is available here and you can look at them.

https://github.com/elakito/misc-xml/blob/master/src/main/java/de/elakito/misc/xml/util/XMLStreamReaderInputStream.java
https://github.com/elakito/misc-xml/blob/master/src/main/java/de/elakito/misc/xml/util/XMLStreamReaderReader.java

Let me know what you think.

regards, aki


Polling DB with quartz2 stateful

2015-05-07 Thread Mansour Al Akeel
Usually I do this in plain java without using camel, however, I would
like to start using camel for similar tasks.

I need to use stateful job t opreserve state and variable for last
run. One of these variable is the ID for the last record that was
processed. I have seen that some developers mark a field with DONE
in the originating table. However this is not possible as we don't
have write permission to the originating table. And we can not read
all the records, because the table may get big.



So here's what I want to do:

// poll the table every 5 seconds

// if any new resords added or update_timestamp changed, then select
those new records

// use Message Enricher to get the new data from the DB. Iterate over them.

// Send each updated record to message queue to be indexed by lucene
or JDBC endpoint to be inserted into the target table.

// store the last_id or timestamp for the processed recored to be used
in the next run.

A similar functionaity, I may need soon to poll CIMS sharepoint, where
I don't have write access in the originating DB.

I was not able to locate any example for using quartz2 stateful job.

Any advice or pointer ?

Thank you


Re: Use hdfs2 component in Hadoop HA mode

2015-05-07 Thread Grzegorz Grzybek
please create JIRA issue, I'll investigate it then.

regards
Grzegorz Grzybek

2015-05-07 14:55 GMT+02:00 Karpov, Ilya i.kar...@cleverdata.ru:

 Hi guys,
 I can't find a way to use camel-hdfs2 component for Hadoop in HA mode.
 I set my ha configuration in core-site.xml and hdfs-site.xml and put them
 in classpath, set nameservice name instead of host in hdfs2 endpoint uri,
 finally - no luck.

 Is this feature supported in any way?
 --
 *Ilya Karpov*
 Developer

 CleverDATA
 make your data clever



Re: Unmarshal not working

2015-05-07 Thread Christian Müller
Please check the available data formats in the CXF component.

Best,
Christian
Am 07.05.2015 10:00 schrieb jainmcs03 tojayendran.in...@gmail.com:


 Hi Team,

 JAXB can only unmarshall an XML if the soap envelope has already been
 removed. However, the SOAP response I'm trying to unmarshall has its
 namespace declaration on the soap envelope. So how to remove the SOAP
 envelope in camel route.

 Regards,
 Jayendran



 --
 View this message in context:
 http://camel.465427.n5.nabble.com/Unmarshal-not-working-tp5766790p5766797.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



Re: Proxying with Payload Format

2015-05-07 Thread Christian Müller
Something like this:
https://github.com/muellerc/esbperformance/blob/master/karaf/proxy/src/main/resources/OSGI-INF/blueprint/bundle-context.xml

Best,

Christian
-

Software Integration Specialist

Apache Member
V.P. Apache Camel | Apache Camel PMC Member | Apache Camel committer
Apache Incubator PMC Member

https://www.linkedin.com/pub/christian-mueller/11/551/642

On Mon, May 4, 2015 at 3:09 PM, ercan.canlier ercan.canl...@gmail.com
wrote:

 Hi to everybody,
 I am currently encountering problem about proxy by payload format, any help
 would be helpful.
 I followed the tips at report incident tutorial but there, a jax-ws is used
 and want to expose two web services by Apache CXF.
 One is the proxy and the other for real web service. I am currently writing
 the request and response to database but with long format. When i change my
 jax-ws to apache cxf web service and set the message format to PAYLOAD
 mode, i am not able to expose the real one.
 Have you ever exposed web services like i mentioned?
 Thanks.
 Ercan



 --
 View this message in context:
 http://camel.465427.n5.nabble.com/Proxying-with-Payload-Format-tp5766651.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



Re: Camel Websocket - Connection key not set

2015-05-07 Thread Aki Yoshida
Yes.
We need to add a NPE guard there.
@Harish,
The situation was caused by the fact that the socket was not
established for some reason.
I think you see other error trace showing this reason prior to this
NPE getting thrown.

Let me know if you want to work on this, need help in doing that or
simply have it get resolved.
regards, aki

2015-05-06 17:15 GMT+02:00 Claus Ibsen claus.ib...@gmail.com:
 Hi

 Yeah somewhere in that Camel component is a bug that causes the NPE.

 You are welcome to log a JIRA and if possible provide more details how
 to reproduce it, and or an unit test. Or try to fix the bug and
 provide a patch.
 http://camel.apache.org/contributing.html

 On Wed, May 6, 2015 at 9:07 AM, Harish Kumar harish.kum...@tcs.com wrote:
 Hey Thanks for the suggestion

 Now am using AH-WS component. Leaving the websocket code untounced, now I
 get this error

 java.lang.NullPointerException
 at
 org.apache.camel.component.ahc.ws.WsProducer.sendMessage(WsProducer.j
 ava:77)
 at
 org.apache.camel.component.ahc.ws.WsProducer.process(WsProducer.java:
 52)
 at
 org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncP
 rocessorBridge.process(AsyncProcessorConverterHelper.java:61)
 at
 org.apache.camel.processor.SendProcessor.process(SendProcessor.java:1
 29)
 at
 org.apache.camel.management.InstrumentationProcessor.process(Instrume
 ntationProcessor.java:77)
 at
 org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryE
 rrorHandler.java:448)
 at
 org.apache.camel.processor.CamelInternalProcessor.process(CamelIntern
 alProcessor.java:191)
 at org.apache.camel.processor.Pipeline.process(Pipeline.java:118)
 at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)
 at
 org.apache.camel.processor.CamelInternalProcessor.process(CamelIntern
 alProcessor.java:191)
 at
 org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelp
 er.java:109)
 at
 org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsy
 ncProcessor.java:87)
 at
 org.apache.camel.component.jms.EndpointMessageListener.onMessage(Endp
 ointMessageListener.java:103)
 at
 org.springframework.jms.listener.AbstractMessageListenerContainer.doI
 nvokeListener(AbstractMessageListenerContainer.java:699)
 at
 org.springframework.jms.listener.AbstractMessageListenerContainer.inv
 okeListener(AbstractMessageListenerContainer.java:637)
 at
 org.springframework.jms.listener.AbstractMessageListenerContainer.doE
 xecuteListener(AbstractMessageListenerContainer.java:605)
 at
 org.springframework.jms.listener.AbstractPollingMessageListenerContai
 ner.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:308)
 at
 org.springframework.jms.listener.AbstractPollingMessageListenerContai
 ner.receiveAndExecute(AbstractPollingMessageListenerContainer.java:246)
 at
 org.springframework.jms.listener.DefaultMessageListenerContainer$Asyn
 cMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1144
 )
 at
 org.springframework.jms.listener.DefaultMessageListenerContainer$Asyn
 cMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:
 1136)
 at
 org.springframework.jms.listener.DefaultMessageListenerContainer$Asyn
 cMessageListenerInvoker.run(DefaultMessageListenerContainer.java:1033)
 at
 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
 java:1145)
 at
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
 .java:615)
 at java.lang.Thread.run(Thread.java:724)
 [d #0 - JmsConsumer[test.queue]] EndpointMessageListenerWARN
 Execution
 of JMS message listener failed. Caused by:
 [org.apache.camel.RuntimeCamelExcepti
 on - java.lang.NullPointerException]
 org.apache.camel.RuntimeCamelException: java.lang.NullPointerException
 at
 org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHe
 lper.java:1619)
 at
 org.apache.camel.component.jms.EndpointMessageListener$EndpointMessag
 eListenerAsyncCallback.done(EndpointMessageListener.java:186)
 at
 org.apache.camel.component.jms.EndpointMessageListener.onMessage(Endp
 ointMessageListener.java:107)
 at
 org.springframework.jms.listener.AbstractMessageListenerContainer.doI
 nvokeListener(AbstractMessageListenerContainer.java:699)
 at
 org.springframework.jms.listener.AbstractMessageListenerContainer.inv
 okeListener(AbstractMessageListenerContainer.java:637)
 at
 org.springframework.jms.listener.AbstractMessageListenerContainer.doE
 xecuteListener(AbstractMessageListenerContainer.java:605)
 at
 org.springframework.jms.listener.AbstractPollingMessageListenerContai
 ner.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:308)
 at
 org.springframework.jms.listener.AbstractPollingMessageListenerContai
 

Re: Use hdfs2 component in Hadoop HA mode

2015-05-07 Thread Karpov, Ilya
Finally I figured out what was wrong: my hdfs-site.xml config was :)
In case anybody will meet this problem and find this email, minimal conf is
as follows:
1. use hdfs2://mycluster:8020/dir?opts
2. put hdfs-site.xml in classpath
3. minimal hdfs-site.xml content for HA:
property
namedfs.nameservices/name
valuemycluster/value
/property
property
namedfs.ha.namenodes.mycluster/name
valuenn1,nn2/value
/property
property
namedfs.namenode.rpc-address.mycluster.nn1/name
valuenn1-host1:8020/value
/property
property
namedfs.namenode.rpc-address.mycluster.nn2/name
valuenn1-host2:8020/value
/property
property
namedfs.client.failover.proxy.provider.mycluster/name

valueorg.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider/value
/property


2015-05-07 17:16 GMT+03:00 Grzegorz Grzybek gr.grzy...@gmail.com:

 please create JIRA issue, I'll investigate it then.

 regards
 Grzegorz Grzybek

 2015-05-07 14:55 GMT+02:00 Karpov, Ilya i.kar...@cleverdata.ru:

  Hi guys,
  I can't find a way to use camel-hdfs2 component for Hadoop in HA mode.
  I set my ha configuration in core-site.xml and hdfs-site.xml and put
them
  in classpath, set nameservice name instead of host in hdfs2 endpoint
uri,
  finally - no luck.
 
  Is this feature supported in any way?
  --
  *Ilya Karpov*
  Developer
 
  CleverDATA
  make your data clever
 




--
Ilya Karpov
Developer

CleverDATA
make your data clever


Re: Use hdfs2 component in Hadoop HA mode

2015-05-07 Thread Grzegorz Grzybek
Great you've found the solution!

best regards
Grzegorz Grzybek

2015-05-07 17:34 GMT+02:00 Karpov, Ilya i.kar...@cleverdata.ru:

 Finally I figured out what was wrong: my hdfs-site.xml config was :)
 In case anybody will meet this problem and find this email, minimal conf is
 as follows:
 1. use hdfs2://mycluster:8020/dir?opts
 2. put hdfs-site.xml in classpath
 3. minimal hdfs-site.xml content for HA:
 property
 namedfs.nameservices/name
 valuemycluster/value
 /property
 property
 namedfs.ha.namenodes.mycluster/name
 valuenn1,nn2/value
 /property
 property
 namedfs.namenode.rpc-address.mycluster.nn1/name
 valuenn1-host1:8020/value
 /property
 property
 namedfs.namenode.rpc-address.mycluster.nn2/name
 valuenn1-host2:8020/value
 /property
 property
 namedfs.client.failover.proxy.provider.mycluster/name


 valueorg.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider/value
 /property


 2015-05-07 17:16 GMT+03:00 Grzegorz Grzybek gr.grzy...@gmail.com:
 
  please create JIRA issue, I'll investigate it then.
 
  regards
  Grzegorz Grzybek
 
  2015-05-07 14:55 GMT+02:00 Karpov, Ilya i.kar...@cleverdata.ru:
 
   Hi guys,
   I can't find a way to use camel-hdfs2 component for Hadoop in HA mode.
   I set my ha configuration in core-site.xml and hdfs-site.xml and put
 them
   in classpath, set nameservice name instead of host in hdfs2 endpoint
 uri,
   finally - no luck.
  
   Is this feature supported in any way?
   --
   *Ilya Karpov*
   Developer
  
   CleverDATA
   make your data clever
  




 --
 Ilya Karpov
 Developer

 CleverDATA
 make your data clever



Re: How to bind context properties to method parameters?

2015-05-07 Thread Claus Ibsen
Hi

Are you talking about properties stored on CamelContext that is hardly
in use at all? Or which properties are you talking about?

On Thu, May 7, 2015 at 5:04 PM, toomanyedwards toomanyedwa...@gmail.com wrote:
 Hi all,
   There are clearly defined ways to bind header and exchange property values
 to method parameters via annotations as doc'd here:
 http://camel.apache.org/parameter-binding-annotations.html.  My question is
 what is the best practice to bind *context* properties to method parameters.
 Currently, I'm copying context properties to exchange properties before
 invoking my methods so that I can access their values via parameter binding
 (as exchange properties), but that definitely feels hacky to me.  Is there a
 better way to bind context properties to method parameters?  If not, is
 there a best practice to work around this?

 Thank!

 -edward



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/How-to-bind-context-properties-to-method-parameters-tp5766819.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: Polling DB with quartz2 stateful

2015-05-07 Thread fradj zayen
Hi,
did you tried to use sql component?
http://camel.apache.org/sql-component.html
Regards
Fradj

2015-05-07 15:08 GMT+01:00 Mansour Al Akeel mansour.alak...@gmail.com:

 Usually I do this in plain java without using camel, however, I would
 like to start using camel for similar tasks.

 I need to use stateful job t opreserve state and variable for last
 run. One of these variable is the ID for the last record that was
 processed. I have seen that some developers mark a field with DONE
 in the originating table. However this is not possible as we don't
 have write permission to the originating table. And we can not read
 all the records, because the table may get big.



 So here's what I want to do:

 // poll the table every 5 seconds

 // if any new resords added or update_timestamp changed, then select
 those new records

 // use Message Enricher to get the new data from the DB. Iterate over them.

 // Send each updated record to message queue to be indexed by lucene
 or JDBC endpoint to be inserted into the target table.

 // store the last_id or timestamp for the processed recored to be used
 in the next run.

 A similar functionaity, I may need soon to poll CIMS sharepoint, where
 I don't have write access in the originating DB.

 I was not able to locate any example for using quartz2 stateful job.

 Any advice or pointer ?

 Thank you



Camel Fop - add images to PDF

2015-05-07 Thread Laurentiu Trica
Hello,

I need to produce some PDF files with images. Is there a way to get the
images from the classpath?

I am using Camel from ServiceMix and I deploy my route using jars that
already contain the images I need.

How can I get make camel-fop to get the images from my jar and not from a
relative/absolute path?

Thank you!

Regards,
Laurentiu


How to bind context properties to method parameters?

2015-05-07 Thread toomanyedwards
Hi all,
  There are clearly defined ways to bind header and exchange property values
to method parameters via annotations as doc'd here:
http://camel.apache.org/parameter-binding-annotations.html.  My question is
what is the best practice to bind *context* properties to method parameters. 
Currently, I'm copying context properties to exchange properties before
invoking my methods so that I can access their values via parameter binding
(as exchange properties), but that definitely feels hacky to me.  Is there a
better way to bind context properties to method parameters?  If not, is
there a best practice to work around this? 

Thank!

-edward



--
View this message in context: 
http://camel.465427.n5.nabble.com/How-to-bind-context-properties-to-method-parameters-tp5766819.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Uanble to consume file with special character

2015-05-07 Thread Alok Mishra
I am consuming .msg files from ftp using apache camel. But is giving error
while consuming the file because file names have special character.

Below is my URI :

sftp://username@machinename:22/folderName?delete=trueprivateKeyFile=C%3A%2FprivateKey%2F%2Fcftkey.pemrecursive=truestrictHostKeyChecking=no



It is able to consume files without special characters

Below is stack trace 


org.apache.camel.component.file.remote.SftpConsumer - Error processing file
RemoteFile[test 002 - char sp ?.msg] due to Cannot
retrieve file: 00019/test 002 - char sp?.msg. Caused by:
[org.apache.camel.component.file.GenericFileO
perationFailedException - Cannot retrieve file:
00019/*[cont_123456]_SendingMsgÇ_BU2.msg]*
org.apache.camel.component.file.GenericFileOperationFailedException: Cannot
retrieve file: 00019/test 002 - char sp?.msg
at
org.apache.camel.component.file.remote.SftpOperations.retrieveFileToStreamInBody(SftpOperations.java:651)
at
org.apache.camel.component.file.remote.SftpOperations.retrieveFile(SftpOperations.java:594)
at
org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:394)
at
org.apache.camel.component.file.remote.RemoteFileConsumer.processExchange(RemoteFileConsumer.java:99)
at
org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer.java:211)
at
org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:175)
at
org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:187)
at
org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:114)
at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at
java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java

:98)
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.jav

a:180)
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:204)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: 2:
at
com.jcraft.jsch.ChannelSftp.throwStatusError(ChannelSftp.java:2846)
at com.jcraft.jsch.ChannelSftp._stat(ChannelSftp.java:2198)
at com.jcraft.jsch.ChannelSftp.get(ChannelSftp.java:1294)
at com.jcraft.jsch.ChannelSftp.get(ChannelSftp.java:1266)
at 



--
View this message in context: 
http://camel.465427.n5.nabble.com/Uanble-to-consume-file-with-special-character-tp5766789.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Unmarshal not working

2015-05-07 Thread jainmcs03

Hi Team,

I'm trying webservice proxy with camel 2.15.1. In this trying to unmarshal
the response message using unmarshal component, below the way route
defining. Real service getting invoked and received response afterwards no
process, no more logs in the console. Pls let me know if im wrong. Thanks,

endpoint id=callRealWebService
uri=http://wsf.cdyne.com/WeatherWS/Weather.asmx/ 
route errorHandlerRef=myDeadLetterErrorHandler streamCache=true
  from uri=cxf:bean:weatherReport?dataFormat=MESSAGE/
  wireTap
uri=file:/home/analyzer/Desktop/input/?fileName=request.xml/
  to uri=log:input/
  removeHeaders pattern=CamelHttp*/
  to ref=callRealWebService/
  wireTap
uri=file:/home/analyzer/Desktop/output/?fileName=response.xml/
  
  unmarshal
jaxb prettyPrint=true contextPath=com.cdyne.ws.weatherws/
  /unmarshal
  process ref=processor/
  to uri=log:output/
/route

Regards,
Jayendran




--
View this message in context: 
http://camel.465427.n5.nabble.com/Unmarshal-not-working-tp5766790.html
Sent from the Camel - Users mailing list archive at Nabble.com.


RE: sftp without passward, unable to connect

2015-05-07 Thread cchennupati
Hi -

Can you please send me how you passed the privateKeyFile to the sftp
component?

I was getting same error and when i added this parameter with physical path
to the private key.

Thanks,
Chandra



--
View this message in context: 
http://camel.465427.n5.nabble.com/sftp-without-passward-unable-to-connect-tp5742397p5766829.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: How to bind context properties to method parameters?

2015-05-07 Thread toomanyedwards
Yes, we want to be able to bind to the properties on the CamelContext.  The
reason we want to do this is that we have config information that is
effectively immutable for the life of the CamelContext  (timeouts, db config
info, etc.) and our routes depend on this info.  When our routes execute we
want to validate that all the preconditions for config data (Message
headers, Exchange properties and Context properties) needed by the route are
met.  To do this we have a bean for each of our routes that implements a
validateRoutePreconditons method and we invoke this method via camel bean
at the beginning of the route execution.  Example validator beans:

public class RouteAValidatorBean
{

public void validateRoutePreconditions(
@Header(NAME_OF_HEADER_NEEDED_BY_ROUTE_A)String
valueOfHeaderNeededByRouteA
)
{
// Check if needed header value is set and if not throw
exception
}
}

public class RouteBValidatorBean
{

public void validateRoutePreconditions(
@Property(NAME_OF_EXCHANGE_PROPERTY_NEEDED_BY_ROUTE_B)String
valueOfExchangePropertyNeededByRouteB
)
{
// Check if needed exchange property value is set and if not
throw exception
}
}


We'd like to be able validate that the required camelcontext properties are
set in a similar fashion.  I guess one option would be to have a parameter
of type CamelContext on our validate method and then Camel should
dynamically bind this right?  Then in our validator method we'd have to
explicitly get the properties we care about from the context.  Not quite as
clean as being able to just bind context properties that we care about (as
we can do for headers and exchange properties), but might be the best
solution.  Is there a better approach to this?  Are CamelContext properties
the appropriate place to cache static config info that is immutable or is
there a preferred way to do this?

Thanks for your insight.

-e



--
View this message in context: 
http://camel.465427.n5.nabble.com/How-to-bind-context-properties-to-method-parameters-tp5766819p5766828.html
Sent from the Camel - Users mailing list archive at Nabble.com.