Re: Camel swallows Error
Sorry for late response. I was in vacation. I ran your test and checked the stack trace output and found some difference with the one I got problem. Stacktrace with your test: org.apache.camel.CamelExecutionException: Exception occurred during execution on the exchange: Exchange[Message: Hello World] at org.apache.camel.util.ObjectHelper.wrapCamelExecutionException(ObjectHelper.java:1368) at org.apache.camel.impl.DefaultExchange.setException(DefaultExchange.java:283) at org.apache.camel.processor.DelegateSyncProcessor.process(DelegateSyncProcessor.java:66) at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:398) at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.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(CamelInternalProcessor.java:191) at org.apache.camel.component.seda.SedaConsumer.sendToConsumers(SedaConsumer.java:291) at org.apache.camel.component.seda.SedaConsumer.doRun(SedaConsumer.java:200) at org.apache.camel.component.seda.SedaConsumer.run(SedaConsumer.java:147) 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:744) Caused by: java.lang.NoClassDefFoundError at org.apache.camel.util.ProcessorFail.process(ProcessorFail.java:26) at org.apache.camel.processor.DelegateSyncProcessor.process(DelegateSyncProcessor.java:63) ... 11 more It indicates the exception is thrown in DelegateSyncProcessor. But in the error log of my problem, I found it's in DelegateAsyncProcessor. I don't know in which case Camel uses DelegateSyncProcessor and DelegateAsyncProcessor. Could that cause the different behavior? 2014-01-23 18:06:04 WARN Camel (camel-1) thread #0 - JmsConsumer[com.test.new] org.apache.camel.component.jms.EndpointMessageListener - Execution of JMS message listener failed. Caused by : [org.apache.camel.CamelExecutionException - Exception occurred during execution on the exchange: Exchange[JmsMessage[JmsMessageID: ID:test-ubt-43737-1390470192665-1:1:5:1:1]]] org.apache.camel.CamelExecutionException: Exception occurred during execution on the exchange: Exchange[JmsMessage[JmsMessageID: ID:test-ubt-43737-1390470192665-1:1:5:1:1]] at org.apache.camel.util.ObjectHelper.wrapCamelExecutionException(ObjectHelper.java:1368)[camel-core-2.12.2.jar:2.12.2] at org.apache.camel.impl.DefaultExchange.setException(DefaultExchange.java:283)[camel-core-2.12.2.jar:2.12.2] at org.apache.camel.processor.DelegateSyncProcessor.process(DelegateSyncProcessor.java:66)[camel-core-2.12.2.jar:2.12.2] at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)[camel-core-2.12.2.jar:2.12.2] at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:398)[camel-core-2.12.2.jar:2.12.2] at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)[camel-core-2.12.2.jar:2.12.2] at org.apache.camel.processor.Pipeline.process(Pipeline.java:118)[camel-core-2.12.2.jar:2.12.2] at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)[camel-core-2.12.2.jar:2.12.2] at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)[camel-core-2.12.2.jar:2.12.2] at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:105)[camel-core-2.12.2.jar:2.12.2] at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:87)[camel-core-2.12.2.jar:2.12.2] at org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:103)[camel-jms-2.12.2.jar:2.12.2] at org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:562)[spring-jms-3.2.4.RELEASE.jar:3.2.4.RELEASE] at org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:500)[spring-jms-3.2.4.RELEASE.jar:3.2.4.RELEASE] at org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:468)[spring-jms-3.2.4.RELEASE.jar:3.2.4.RELEASE] at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:325)[spring-jms-3.2.4.RELEASE.jar:3.2.4.RELEASE] at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:263)[spring-jms-3.2.4.RELEASE.jar:3.2.4.RELEASE] at
Re: Cross war comms using direct-vm and cxf
Thanks very much Claus Dan for replying - Dan I will take a look at what you suggest regarding local transport and mail you on the cxf user group if I have further questions (which is very likely :-)) Claus - I'd really appreciate it if you could send me a sample camel route which shows how to route via direct-vm from one CXF rest service in one war to another in another war as I just don't understand what the format of the uris in the from/to should look like. Many thanks Mandy On 10 Feb 2014, at 15:08, Daniel Kulp wrote: You should be able to use the Local transport, but as you said, it’s not exactly easy. It would likely also require you to have the CXF jars in the shared/lib area of your app server so that the actual java classes are shared and can be cast to one another. You’d probably need to create a very small jar (also in shared/lib) with a Spring factory thing that would return a LocalTransportFactory singleton (instead of a new instance per bus). Each of your wars would then grab their LocalTranportFactory via that factory.May also be able to do it via a BusLIstener or similar that would register a singleton factory for each bus that is created. Dan On Feb 9, 2014, at 5:21 PM, Mandy Warren mandys.in...@gmail.com wrote: Hi, I've just started looking at Camel and I was wondering whether there was a way to call from a CXF rest service deployed in war A to a CXF rest service deployed in war B without the overhead of an HTTP call if both wars are deployed in the same JVM? Some background to my requirement.. - we have a large number of cxf services deployed in weblogic and a single service may call 2 or 3 other services to complete its work. We'd ideally like the calls to be made on a single thread when the calls are within the same JVM as it makes debugging much easier. Local transport in CXF looks ideal except it doesn't work across wars (at least I haven't managed to make it work). direct-vm looks interesting but I don't want the 2 services to be dependent on each others service interface classes - instead I'd just like to pass a JSON request between the 2 services and then have something execute the appropriate rest service (and it's interceptors ideally). Is there any way to achieve this? Many thanks Mandy -- Daniel Kulp dk...@apache.org - http://dankulp.com/blog Talend Community Coder - http://coders.talend.com
how to pass parameter to camel custom datafotmat?
I am new to camel i have implemented custom dataformat *Now i want to use custom property in marshel or unmarshal method.* Is this possible to do this in camel? please give example if there is way. My custom dataformat code is as follows package com.camel.spring.test.dataFormat; import groovy.xml.MarkupBuilder; import java.io.InputStream; import java.io.OutputStream; import java.io.StringWriter; import java.util.HashMap; import org.apache.camel.Exchange; import org.apache.camel.spi.DataFormat; import com.predic8.wsdl.Definitions; import com.predic8.wsdl.WSDLParser; import com.predic8.wstool.creator.RequestCreator; import com.predic8.wstool.creator.SOARequestCreator; public final class SOAPDataFormat implements DataFormat { public void marshal(Exchange exchange, Object dataDefination, OutputStream stream) throws Exception { WSDLParser parser = new WSDLParser(); Definitions wsdl = parser .parse(http://localhost:8081/Myservice/services/TestService?wsdl;); StringWriter writer = new StringWriter(); HashMapString, Object formParams = new HashMapString, Object(); SOARequestCreator creator = new SOARequestCreator(wsdl, new RequestCreator(), new MarkupBuilder(writer)); creator.setBuilder(new MarkupBuilder(writer)); creator.setDefinitions(wsdl); creator.setFormParams(formParams); creator.setCreator(new RequestCreator()); creator.createRequest(TestService, getApplication,TestServiceHttpBinding); stream.write(writer.toString().getBytes()); } public Object unmarshal(Exchange exchange, InputStream stream) throws Exception { return null; } } *my route configuration is* camel:route from uri=file:d:/inbox/wsJson?noop=true / marshal custom ref=soapDataFormat / /marshal to uri=cxf://http://localhost:8081/Myservice/services/TestService?wsdlURL=http://localhost:8081//Myservice/services/TestService?wsdlamp;serviceName={http://service.application.atpl.com}TestServiceamp;portName={http://service.application.atpl.com}TestServiceHttpPortamp;dataFormat=MESSAGE/ /camel:route I am just working on marshaling so ignore unmarshal code. i want to pass http://localhost:8081/Myservice/services/TestService?wsdl,TestService;, getApplication,TestServiceHttpBinding values runtime that is changed on request to request basis. i found 1 work aroung by setting header values, but which is not proper solution please help me Thanks in advance. -- View this message in context: http://camel.465427.n5.nabble.com/how-to-pass-parameter-to-camel-custom-datafotmat-tp5747098.html Sent from the Camel - Users mailing list archive at Nabble.com.
Upgrade Jsch to 0.1.50
Since the discussions have started about a new release of Camel, I checked the version of Jsch used. Currently Camel uses version 0.1.49 which is rather old (from 2012-10-11). The latest version is 0.1.50 (from 2013-05-09). One of the bugs fixed has to do with a verify error on Java7u6 (and later). I think Java 7 support is very important and suggest that Camel upgrades Jsch to 0.1.50 in the next release of Camel. Bengt Rodehav
Re: Upgrade Jsch to 0.1.50
I think jsch 0.1.50 does not work in OSGi. And therefore we do not upgrade until it works also in OSGi. On Tue, Feb 11, 2014 at 11:24 AM, Bengt Rodehav be...@rodehav.com wrote: Since the discussions have started about a new release of Camel, I checked the version of Jsch used. Currently Camel uses version 0.1.49 which is rather old (from 2012-10-11). The latest version is 0.1.50 (from 2013-05-09). One of the bugs fixed has to do with a verify error on Java7u6 (and later). I think Java 7 support is very important and suggest that Camel upgrades Jsch to 0.1.50 in the next release of Camel. Bengt Rodehav -- 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 Make your Camel applications look hawt, try: http://hawt.io
Re: Cross war comms using direct-vm and cxf
On Tue, Feb 11, 2014 at 9:43 AM, Mandy Warren mandys.in...@gmail.com wrote: Thanks very much Claus Dan for replying - Dan I will take a look at what you suggest regarding local transport and mail you on the cxf user group if I have further questions (which is very likely :-)) Claus - I'd really appreciate it if you could send me a sample camel route which shows how to route via direct-vm from one CXF rest service in one war to another in another war as I just don't understand what the format of the uris in the from/to should look like. The direct-vm has a little example http://camel.apache.org/direct-vm But that is using Camel routes. If you use pure CXF-RS (without Camel) then you can use the Camel ProducerTemplate API to send a message to a camel endpoint from java code. http://camel.apache.org/producertemplate.html Many thanks Mandy On 10 Feb 2014, at 15:08, Daniel Kulp wrote: You should be able to use the Local transport, but as you said, it's not exactly easy. It would likely also require you to have the CXF jars in the shared/lib area of your app server so that the actual java classes are shared and can be cast to one another. You'd probably need to create a very small jar (also in shared/lib) with a Spring factory thing that would return a LocalTransportFactory singleton (instead of a new instance per bus). Each of your wars would then grab their LocalTranportFactory via that factory.May also be able to do it via a BusLIstener or similar that would register a singleton factory for each bus that is created. Dan On Feb 9, 2014, at 5:21 PM, Mandy Warren mandys.in...@gmail.com wrote: Hi, I've just started looking at Camel and I was wondering whether there was a way to call from a CXF rest service deployed in war A to a CXF rest service deployed in war B without the overhead of an HTTP call if both wars are deployed in the same JVM? Some background to my requirement.. - we have a large number of cxf services deployed in weblogic and a single service may call 2 or 3 other services to complete its work. We'd ideally like the calls to be made on a single thread when the calls are within the same JVM as it makes debugging much easier. Local transport in CXF looks ideal except it doesn't work across wars (at least I haven't managed to make it work). direct-vm looks interesting but I don't want the 2 services to be dependent on each others service interface classes - instead I'd just like to pass a JSON request between the 2 services and then have something execute the appropriate rest service (and it's interceptors ideally). Is there any way to achieve this? Many thanks Mandy -- Daniel Kulp dk...@apache.org - http://dankulp.com/blog Talend Community Coder - http://coders.talend.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 Make your Camel applications look hawt, try: http://hawt.io
Re: Upgrade Jsch to 0.1.50
Normally you send a request to the Servicemix people and ask them to OSGi:fy Jsch. At least that's how it's been done before. /Bengt 2014-02-11 11:27 GMT+01:00 Claus Ibsen claus.ib...@gmail.com: I think jsch 0.1.50 does not work in OSGi. And therefore we do not upgrade until it works also in OSGi. On Tue, Feb 11, 2014 at 11:24 AM, Bengt Rodehav be...@rodehav.com wrote: Since the discussions have started about a new release of Camel, I checked the version of Jsch used. Currently Camel uses version 0.1.49 which is rather old (from 2012-10-11). The latest version is 0.1.50 (from 2013-05-09). One of the bugs fixed has to do with a verify error on Java7u6 (and later). I think Java 7 support is very important and suggest that Camel upgrades Jsch to 0.1.50 in the next release of Camel. Bengt Rodehav -- 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 Make your Camel applications look hawt, try: http://hawt.io
Re: Upgrade Jsch to 0.1.50
I think Willem Jiang has done this in the past. /Bengt 2014-02-11 13:01 GMT+01:00 Bengt Rodehav be...@rodehav.com: Normally you send a request to the Servicemix people and ask them to OSGi:fy Jsch. At least that's how it's been done before. /Bengt 2014-02-11 11:27 GMT+01:00 Claus Ibsen claus.ib...@gmail.com: I think jsch 0.1.50 does not work in OSGi. And therefore we do not upgrade until it works also in OSGi. On Tue, Feb 11, 2014 at 11:24 AM, Bengt Rodehav be...@rodehav.com wrote: Since the discussions have started about a new release of Camel, I checked the version of Jsch used. Currently Camel uses version 0.1.49 which is rather old (from 2012-10-11). The latest version is 0.1.50 (from 2013-05-09). One of the bugs fixed has to do with a verify error on Java7u6 (and later). I think Java 7 support is very important and suggest that Camel upgrades Jsch to 0.1.50 in the next release of Camel. Bengt Rodehav -- 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 Make your Camel applications look hawt, try: http://hawt.io
Re: Performance degradation on consumer side when switching Camel from 2.11.0 to 2.12.1v
It seems the performance regression is caused by a change triggered due to this defect: CAMEL-6541 https://issues.apache.org/jira/browse/CAMEL-6541 . The excessive copy of message headers seems to be causing ~10% degradation. Any ideas how to overcome this? -- View this message in context: http://camel.465427.n5.nabble.com/Performance-degradation-on-consumer-side-when-switching-Camel-from-2-11-0-to-2-12-1v-tp5742125p5747114.html Sent from the Camel - Users mailing list archive at Nabble.com.
File component include and sortBy together
I'm using Camel 2.10.1 and the Java DSL. I have a route that begins by polling a directory. The from() has an include parameter to only include files with a certain file extension and also a sortBy=file:name to sort the files. When I start the route, it does select only the files matching the include but they are apparently not being sorted. I tried sortBy=reverse:file:name but there is no effect. What am I doing wrong? Can these parameters be used together? -- View this message in context: http://camel.465427.n5.nabble.com/File-component-include-and-sortBy-together-tp5747115.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: File component include and sortBy together
Try setting eagerMaxMessagesPerPoll=false On Tue, Feb 11, 2014 at 2:27 PM, Paul Anderson pbander...@gmualumni.org wrote: I'm using Camel 2.10.1 and the Java DSL. I have a route that begins by polling a directory. The from() has an include parameter to only include files with a certain file extension and also a sortBy=file:name to sort the files. When I start the route, it does select only the files matching the include but they are apparently not being sorted. I tried sortBy=reverse:file:name but there is no effect. What am I doing wrong? Can these parameters be used together? -- View this message in context: http://camel.465427.n5.nabble.com/File-component-include-and-sortBy-together-tp5747115.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 Make your Camel applications look hawt, try: http://hawt.io
Re: File component include and sortBy together
That worked! And, thanks for the almost instantaneous response. -- View this message in context: http://camel.465427.n5.nabble.com/File-component-include-and-sortBy-together-tp5747115p5747117.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Customize http ports change /cxf to / for different services hosted on Fuse container
If no other services are running under different context at the same port, can you just set the cxf's servlet context to / to make the cxf services accessible at that root path context? 2014-02-10 22:25 GMT+01:00 lkrao31 lavin.koruka...@broadridge.com: Hello All, We have a requirement where in we have multiple services deployed on our container and these containers are in a cluster spread across different hosts. Below is our Infra design It has 2 hosts which have fuse software instlled. ssh is not available between the 2 nor is internet access. all containers created are children of either host. Fuse ESB Version 6 and patch 5 * All containers on same version * seprate profile for web service * 3 jvms (2 root and one extra on server2) for ensemble cluster. These will not host any applications. They are purely meant for zookeeper registry. * Camel/cxf fabs to be deployed in web service profile * 2 jvms/containers for web services(one on each host) * Setup custom port for webservice 9001. We thought of achieving load balancing via a load balancer. ie create a vip for the 2 service endpoints. CSS being the load balancer. Services are supposed to be deployed in 2 containers with the following configs: Web-Service-1 URL =http://ip1:9001/contexrtoor1 Web-Service-1 URL=http://ip2:9001/contextroot1 Web-Service-2 URL =http://ip1:9001/contexrtoor2 Web-Service-2 URL=http://ip2:9001/contextroot2 The web service would be called by the consumers by using a loadbalancer VIP http://vip/contexroot1 and http://vip/contextroot2 We were able to cusmtomize the http ports by installing the cxf feature and pax web server and we have addded a custom filed in the file org.ops4j.pax.web.properties as org.osgi.service.http.port=9001 now our container is binded to 9001 but the issue is our web-service ends points are only accessible as Web-Service-1 URL =http://ip1:9001/cxf/contexrtoor1 Web-Service-1 URL=http://ip2:9001/cxf/contextroot1 Web-Service-2 URL =http://ip1:9001/cxf/contexrtoor2 Web-Service-2 URL=http://ip2:9001/cxf/contextroot2 http://vip/cxf/contexroot1 and http://vip/cxf/contextroot2 if we remove '/cxf' from the context root is trowing a 404 error and this is not acceptable by the dev because as per the design they want the consumers to access their services as http://vip/contexroot1 and http://vip/contextroot2 I know that one solution will be to Add org.apache.cxf.osgi.cfg file into $FUSE _ESB/etc/ folder, add an entry org.apache.cxf.servlet.context=/mycontext but my doing that it is always explicitly set to only one service , and for the consumers to access other service again they should have to go through Web-Service-2 URL =http://ip1:9001/contestroot1/contexrtoor2 , which is not desired by our architecture team since in future they could be many services running on this container and each service should have to be independently accessed. Please kindly guide me on how to achieve this. Thanks -- View this message in context: http://camel.465427.n5.nabble.com/Customize-http-ports-change-cxf-to-for-different-services-hosted-on-Fuse-container-tp5747052.html Sent from the Camel - Users mailing list archive at Nabble.com.
Custom IdempotentConsumer/Processor
Hi, I want to extend the IdempotentConsumer to only deny duplicated while the duplicate message is being processed. My plan was to add an additional Synchronization that removed the messageId from the repository when the message has finished processing. However I can't find a simple example of how to add my version of the IdempotentConsumer to my route. I believe I could add it as a standard processor but I don't really know how to do this as doesn't have a no-args constructor. My other idea would be to add the additional Synchronization in the route directly, outside the IdempotentConsumer but I couldn't see a clean way of finding the messageId or the repository. Any help would be greatly appreciated. Thanks, Sam
Re: Problem in mqtt Component
I am working on doing the exact same thing; consuming from a topic and publishing to another. The consuming works fine however nothing gets published. I was made aware of the following note of the doc http://camel.apache.org/mqtt.html http://camel.apache.org/mqtt.html Note: The component currently only supports polling (consuming) feeds. It makes me wonder why the component would include a publishTopicName option if it doesnt support publishing messages. I am doing some further digging on this. -- View this message in context: http://camel.465427.n5.nabble.com/Problem-in-mqtt-Component-tp5733027p5747127.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Problem in mqtt Component
The mqtt client does (or should) support publishing - the polling feeds is the type of consumption - a poll as opposed to asynchronous delivery from the underlying matt-client implementation Could you raise a jira (with a test case) so we can track the issue ? thanks, Rob On 11 Feb 2014, at 18:25, Zadko zaqavil...@gmail.com wrote: I am working on doing the exact same thing; consuming from a topic and publishing to another. The consuming works fine however nothing gets published. I was made aware of the following note of the doc http://camel.apache.org/mqtt.html http://camel.apache.org/mqtt.html Note: The component currently only supports polling (consuming) feeds. It makes me wonder why the component would include a publishTopicName option if it doesnt support publishing messages. I am doing some further digging on this. -- View this message in context: http://camel.465427.n5.nabble.com/Problem-in-mqtt-Component-tp5733027p5747127.html Sent from the Camel - Users mailing list archive at Nabble.com. Rob Davies Red Hat, Inc Twitter: rajdavies Blog: http://rajdavies.blogspot.com ActiveMQ in Action: http://www.manning.com/snyder/
Set directory at runtime with file:
I am using Camel 2.12.2. I assume this is supported, but I've been looking and looking all day and found nothing. I load properties and apply them to generic routes. All the route's particulars -- the URI -- are defined in the properties file. The route knows how to look up its properties because the pattern is static as follows: routeType.propertyId.property For example, move.testupload.directory=c:\\Temp The route resolves these as follows: a) the propertyId is passed in as a header setHeader(propId, sometest). The properties are then resolved like this: .log(directory = ${properties:move.${header.propId}.dir}) My first question is: is this a reasonable strategy? Is there a better way to accomplish this? My main question is how to use this dynamic property lookup in file to specify the directory? from(file://directory ...) This doesn't work: from(file://${properties:move.${header.propId}.dir}?noop=true) I tried passing in as header. Same problem -- ${} is not allowed in the URI. I would have thought the file component would have a way to set the directory as an argument (a la fileName). Some writers have suggested that you could use fileName= but I have not been able to get it to work. .from(file://?noop=truefileName=${properties:move.${header.propsId}.dir}) I can't use the straight property language because it's not dynamic (testupload is hardcoded, not gleaned from a header value). .from(file://{{move.testupload.from.dir}}?noop=true) Any specific help is appreciated. I've used recipientList when the URI is in a to() -- is there a equivalent to recipientList for from()? -- View this message in context: http://camel.465427.n5.nabble.com/Set-directory-at-runtime-with-file-tp5747126.html Sent from the Camel - Users mailing list archive at Nabble.com.
Converter not getting called
Hi All, I am using camel to call a restful webservice. I am calling the requestBodyandheader method of producerTemplate and expecting a response of type JSONarray template.requestBodyAndHeader(direct:aa,null,ab,header,JSONArray.class); A converter is also defined to manipulate the response. But i am not getting any result ,in logs converter is loaded but it is not getting called . The converter has been already added to classpath. Can anybody help me to indicate the possible causes of this issue? -- View this message in context: http://camel.465427.n5.nabble.com/Converter-not-getting-called-tp5747122.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: how to pass parameter to camel custom datafotmat?
Setting the parameter as Exchange properties or Message headers is the right way. The data format has access to these and can change the behavior based on this. 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 Tue, Feb 11, 2014 at 9:58 AM, viral.patel69 viral.pa...@algorhythm.co.in wrote: I am new to camel i have implemented custom dataformat *Now i want to use custom property in marshel or unmarshal method.* Is this possible to do this in camel? please give example if there is way. My custom dataformat code is as follows package com.camel.spring.test.dataFormat; import groovy.xml.MarkupBuilder; import java.io.InputStream; import java.io.OutputStream; import java.io.StringWriter; import java.util.HashMap; import org.apache.camel.Exchange; import org.apache.camel.spi.DataFormat; import com.predic8.wsdl.Definitions; import com.predic8.wsdl.WSDLParser; import com.predic8.wstool.creator.RequestCreator; import com.predic8.wstool.creator.SOARequestCreator; public final class SOAPDataFormat implements DataFormat { public void marshal(Exchange exchange, Object dataDefination, OutputStream stream) throws Exception { WSDLParser parser = new WSDLParser(); Definitions wsdl = parser .parse(http://localhost:8081/Myservice/services/TestService?wsdl;); StringWriter writer = new StringWriter(); HashMapString, Object formParams = new HashMapString, Object(); SOARequestCreator creator = new SOARequestCreator(wsdl, new RequestCreator(), new MarkupBuilder(writer)); creator.setBuilder(new MarkupBuilder(writer)); creator.setDefinitions(wsdl); creator.setFormParams(formParams); creator.setCreator(new RequestCreator()); creator.createRequest(TestService, getApplication,TestServiceHttpBinding); stream.write(writer.toString().getBytes()); } public Object unmarshal(Exchange exchange, InputStream stream) throws Exception { return null; } } *my route configuration is* camel:route from uri=file:d:/inbox/wsJson?noop=true / marshal custom ref=soapDataFormat / /marshal to uri=cxf:// http://localhost:8081/Myservice/services/TestService?wsdlURL=http://localhost:8081//Myservice/services/TestService?wsdlamp;serviceName={http://service.application.atpl.com}TestServiceamp;portName={http://service.application.atpl.com}TestServiceHttpPortamp;dataFormat=MESSAGE / /camel:route I am just working on marshaling so ignore unmarshal code. i want to pass http://localhost:8081/Myservice/services/TestService?wsdl,TestService;, getApplication,TestServiceHttpBinding values runtime that is changed on request to request basis. i found 1 work aroung by setting header values, but which is not proper solution please help me Thanks in advance. -- View this message in context: http://camel.465427.n5.nabble.com/how-to-pass-parameter-to-camel-custom-datafotmat-tp5747098.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Upgrade Jsch to 0.1.50
Yep, it's in maven central: http://search.maven.org/#artifactdetails|org.apache.servicemix.bundles|org.apache.servicemix.bundles.jsch|0.1.50_1|bundle 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 Tue, Feb 11, 2014 at 1:09 PM, Bengt Rodehav be...@rodehav.com wrote: I think Willem Jiang has done this in the past. /Bengt 2014-02-11 13:01 GMT+01:00 Bengt Rodehav be...@rodehav.com: Normally you send a request to the Servicemix people and ask them to OSGi:fy Jsch. At least that's how it's been done before. /Bengt 2014-02-11 11:27 GMT+01:00 Claus Ibsen claus.ib...@gmail.com: I think jsch 0.1.50 does not work in OSGi. And therefore we do not upgrade until it works also in OSGi. On Tue, Feb 11, 2014 at 11:24 AM, Bengt Rodehav be...@rodehav.com wrote: Since the discussions have started about a new release of Camel, I checked the version of Jsch used. Currently Camel uses version 0.1.49 which is rather old (from 2012-10-11). The latest version is 0.1.50 (from 2013-05-09). One of the bugs fixed has to do with a verify error on Java7u6 (and later). I think Java 7 support is very important and suggest that Camel upgrades Jsch to 0.1.50 in the next release of Camel. Bengt Rodehav -- 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 Make your Camel applications look hawt, try: http://hawt.io
Re: Custom IdempotentConsumer/Processor
See [1] for details. bean id=myRepo class=org.apache.camel.processor.idempotent.MemoryIdempotentRepository/ camelContext xmlns=http://camel.apache.org/schema/spring; route from uri=direct:start/ idempotentConsumer messageIdRepositoryRef=myRepo !-- use the messageId header as key for identifying duplicate messages -- headermessageId/header !-- if not a duplicate send it to this mock endpoint -- to uri=mock:result/ /idempotentConsumer /route /camelContext [1] http://camel.apache.org/idempotent-consumer.html 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 Tue, Feb 11, 2014 at 6:21 PM, Sam Adams sbad...@gmail.com wrote: Hi, I want to extend the IdempotentConsumer to only deny duplicated while the duplicate message is being processed. My plan was to add an additional Synchronization that removed the messageId from the repository when the message has finished processing. However I can't find a simple example of how to add my version of the IdempotentConsumer to my route. I believe I could add it as a standard processor but I don't really know how to do this as doesn't have a no-args constructor. My other idea would be to add the additional Synchronization in the route directly, outside the IdempotentConsumer but I couldn't see a clean way of finding the messageId or the repository. Any help would be greatly appreciated. Thanks, Sam
Re: Custom IdempotentConsumer/Processor
Hi, Unless I am mistaken this just adds a the standard IdempotentConsumer to the route? This would remove messages with duplicate keys indefinatly. I only want to remove them while the duplicate message is being processed. Or am I missing something? Thanks, Sam On 11 February 2014 21:43, Christian Müller christian.muel...@gmail.comwrote: See [1] for details. bean id=myRepo class=org.apache.camel.processor.idempotent.MemoryIdempotentRepository/ camelContext xmlns=http://camel.apache.org/schema/spring; route from uri=direct:start/ idempotentConsumer messageIdRepositoryRef=myRepo !-- use the messageId header as key for identifying duplicate messages -- headermessageId/header !-- if not a duplicate send it to this mock endpoint -- to uri=mock:result/ /idempotentConsumer /route /camelContext [1] http://camel.apache.org/idempotent-consumer.html 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 Tue, Feb 11, 2014 at 6:21 PM, Sam Adams sbad...@gmail.com wrote: Hi, I want to extend the IdempotentConsumer to only deny duplicated while the duplicate message is being processed. My plan was to add an additional Synchronization that removed the messageId from the repository when the message has finished processing. However I can't find a simple example of how to add my version of the IdempotentConsumer to my route. I believe I could add it as a standard processor but I don't really know how to do this as doesn't have a no-args constructor. My other idea would be to add the additional Synchronization in the route directly, outside the IdempotentConsumer but I couldn't see a clean way of finding the messageId or the repository. Any help would be greatly appreciated. Thanks, Sam
Re: Upgrade Jsch to 0.1.50
Done. Upgraded in master, camel-2.12.x and 2.11.x. 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 Tue, Feb 11, 2014 at 10:34 PM, Christian Müller christian.muel...@gmail.com wrote: I'm working on it... 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 Tue, Feb 11, 2014 at 10:30 PM, Christian Müller christian.muel...@gmail.com wrote: Yep, it's in maven central: http://search.maven.org/#artifactdetails|org.apache.servicemix.bundles|org.apache.servicemix.bundles.jsch|0.1.50_1|bundle 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 Tue, Feb 11, 2014 at 1:09 PM, Bengt Rodehav be...@rodehav.com wrote: I think Willem Jiang has done this in the past. /Bengt 2014-02-11 13:01 GMT+01:00 Bengt Rodehav be...@rodehav.com: Normally you send a request to the Servicemix people and ask them to OSGi:fy Jsch. At least that's how it's been done before. /Bengt 2014-02-11 11:27 GMT+01:00 Claus Ibsen claus.ib...@gmail.com: I think jsch 0.1.50 does not work in OSGi. And therefore we do not upgrade until it works also in OSGi. On Tue, Feb 11, 2014 at 11:24 AM, Bengt Rodehav be...@rodehav.com wrote: Since the discussions have started about a new release of Camel, I checked the version of Jsch used. Currently Camel uses version 0.1.49 which is rather old (from 2012-10-11). The latest version is 0.1.50 (from 2013-05-09). One of the bugs fixed has to do with a verify error on Java7u6 (and later). I think Java 7 support is very important and suggest that Camel upgrades Jsch to 0.1.50 in the next release of Camel. Bengt Rodehav -- 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 Make your Camel applications look hawt, try: http://hawt.io
Re: Custom IdempotentConsumer/Processor
Instead of bean id=myRepo class=org.apache.camel.processor.idempotent.MemoryIdempotentRepository/ you should configure your own IdempotentRepository. 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 Tue, Feb 11, 2014 at 10:59 PM, Sam Adams sbad...@gmail.com wrote: Hi, Unless I am mistaken this just adds a the standard IdempotentConsumer to the route? This would remove messages with duplicate keys indefinatly. I only want to remove them while the duplicate message is being processed. Or am I missing something? Thanks, Sam On 11 February 2014 21:43, Christian Müller christian.muel...@gmail.com wrote: See [1] for details. bean id=myRepo class=org.apache.camel.processor.idempotent.MemoryIdempotentRepository/ camelContext xmlns=http://camel.apache.org/schema/spring; route from uri=direct:start/ idempotentConsumer messageIdRepositoryRef=myRepo !-- use the messageId header as key for identifying duplicate messages -- headermessageId/header !-- if not a duplicate send it to this mock endpoint -- to uri=mock:result/ /idempotentConsumer /route /camelContext [1] http://camel.apache.org/idempotent-consumer.html 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 Tue, Feb 11, 2014 at 6:21 PM, Sam Adams sbad...@gmail.com wrote: Hi, I want to extend the IdempotentConsumer to only deny duplicated while the duplicate message is being processed. My plan was to add an additional Synchronization that removed the messageId from the repository when the message has finished processing. However I can't find a simple example of how to add my version of the IdempotentConsumer to my route. I believe I could add it as a standard processor but I don't really know how to do this as doesn't have a no-args constructor. My other idea would be to add the additional Synchronization in the route directly, outside the IdempotentConsumer but I couldn't see a clean way of finding the messageId or the repository. Any help would be greatly appreciated. Thanks, Sam
Re: Groovy compiled scripts cache execution context
Can you provide a simple test case so that we can more easily dig into it and fix it? 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 Tue, Feb 11, 2014 at 10:19 PM, florin florin.f.ma...@gmail.com wrote: Trying to use a Groovy script inside a Camel (version 12.2.1) validator I encountered the problem that the validator returns always the result form first evaluation (from first message) for subsequent messages. By looking into the code (/org.apache.camel.builder.script.ScriptBuilder/) I noticed that this is caused by calling /result = compiledScript.eval()/; in /runScript/ method without passing as a parameter the recently updated context (in /populateBindings /) and so the cached context from compilation time(first execution) is always used. A quick solution (for testing purpose) was to recompile the camel-scripting component after changing the above mentioned call to /result = compiledScript.eval(getScriptContext())/; - Florin -- View this message in context: http://camel.465427.n5.nabble.com/Groovy-compiled-scripts-cache-execution-context-tp5747131.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Custom IdempotentConsumer/Processor
Unfortunately its not the repository I've extended, its the consumer itself. On Feb 11, 2014 10:30 PM, Christian Müller christian.muel...@gmail.com wrote: Instead of bean id=myRepo class=org.apache.camel.processor.idempotent.MemoryIdempotentRepository/ you should configure your own IdempotentRepository. 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 Tue, Feb 11, 2014 at 10:59 PM, Sam Adams sbad...@gmail.com wrote: Hi, Unless I am mistaken this just adds a the standard IdempotentConsumer to the route? This would remove messages with duplicate keys indefinatly. I only want to remove them while the duplicate message is being processed. Or am I missing something? Thanks, Sam On 11 February 2014 21:43, Christian Müller christian.muel...@gmail.com wrote: See [1] for details. bean id=myRepo class=org.apache.camel.processor.idempotent.MemoryIdempotentRepository/ camelContext xmlns=http://camel.apache.org/schema/spring; route from uri=direct:start/ idempotentConsumer messageIdRepositoryRef=myRepo !-- use the messageId header as key for identifying duplicate messages -- headermessageId/header !-- if not a duplicate send it to this mock endpoint -- to uri=mock:result/ /idempotentConsumer /route /camelContext [1] http://camel.apache.org/idempotent-consumer.html 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 Tue, Feb 11, 2014 at 6:21 PM, Sam Adams sbad...@gmail.com wrote: Hi, I want to extend the IdempotentConsumer to only deny duplicated while the duplicate message is being processed. My plan was to add an additional Synchronization that removed the messageId from the repository when the message has finished processing. However I can't find a simple example of how to add my version of the IdempotentConsumer to my route. I believe I could add it as a standard processor but I don't really know how to do this as doesn't have a no-args constructor. My other idea would be to add the additional Synchronization in the route directly, outside the IdempotentConsumer but I couldn't see a clean way of finding the messageId or the repository. Any help would be greatly appreciated. Thanks, Sam
Re: Camel swallows Error
hmm...I didn't set it manually. Is that default to false? 于 2014/2/12 10:21, Willem Jiang 写道: I just checked the code and found an interesting thing. public class DefaultSpringErrorHandler implements ErrorHandler { private final LoggingExceptionHandler handler; private final boolean logStackTrace; public DefaultSpringErrorHandler(Class? owner, LoggingLevel level, boolean logStackTrace) { this.handler = new LoggingExceptionHandler(owner, level); this.logStackTrace = logStackTrace; } @Override public void handleError(Throwable throwable) { if (logStackTrace) { handler.handleException(Execution of JMS message listener failed, throwable); } else { handler.handleException(Execution of JMS message listener failed. Caused by: [ + throwable.getMessage() + ], null); } } } I double you set the jms configure option errorHandlerLogStackTrace to be false. You can get the full stack trace if you set the option to true. -- Willem Jiang Red Hat, Inc. Web: http://www.redhat.com Blog: http://willemjiang.blogspot.com(http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com(http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem
Resume an Endpoint in a Route
Hi - In the below route, I have interceptors defined which gets invoked before each of these endpoints to enrich the message. from {file:location} to validate to DBLoad to processcomplete My requirement is that validation should complete as soon as file arrives but file load in Endpoint DBLoad should start only at specific time. In the interceptor code I am able to stop the route just before the DBLoad endpoint using exchange.setProperty(ROUTE_STOP, Boolean.TRUE); but how do I resume this validated message from DBLoad endpoint on this same route using the same exchange which has the file body and other headers set in it? -- View this message in context: http://camel.465427.n5.nabble.com/Resume-an-Endpoint-in-a-Route-tp5747151.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Camel swallows Error
The default value is true, BTW, which version of Camel are you using? -- Willem Jiang Red Hat, Inc. Web: http://www.redhat.com Blog: http://willemjiang.blogspot.com(http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com(http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On February 12, 2014 at 10:49:53 AM, Rural Hunter (ruralhun...@gmail.com) wrote: hmm...I didn't set it manually. Is that default to false? 于 2014/2/12 10:21, Willem Jiang 写道: I just checked the code and found an interesting thing. public class DefaultSpringErrorHandler implements ErrorHandler { private final LoggingExceptionHandler handler; private final boolean logStackTrace; public DefaultSpringErrorHandler(Class owner, LoggingLevel level, boolean logStackTrace) { this.handler = new LoggingExceptionHandler(owner, level); this.logStackTrace = logStackTrace; } @Override public void handleError(Throwable throwable) { if (logStackTrace) { handler.handleException(Execution of JMS message listener failed, throwable); } else { handler.handleException(Execution of JMS message listener failed. Caused by: [ + throwable.getMessage() + ], null); } } } I double you set the jms configure option errorHandlerLogStackTrace to be false. You can get the full stack trace if you set the option to true. -- Willem Jiang Red Hat, Inc. Web: http://www.redhat.com Blog: http://willemjiang.blogspot.com(http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com(http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem
Re: Camel swallows Error
2.12.2 于 2014/2/12 11:31, Willem Jiang 写道: The default value is true, BTW, which version of Camel are you using? -- Willem Jiang Red Hat, Inc. Web: http://www.redhat.com Blog: http://willemjiang.blogspot.com(http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com(http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem
Re: Problem with tracing streams (and stream caching)
Thanks for the tip! I tried upgrading to the latest version of JDK 7 (1.7.0_51). Unfortunately this had no effect on the problem. BR, Joni On 11.2.2014 23:36, Christian Müller wrote: First of all, you should upgrade to a more recent Java version. Best, Christian
Re: Camel Stomp Component with Spring DSL
Thanks for the response. Yes, it seems to work with the proper libraries after all. Appreciate the help. -- View this message in context: http://camel.465427.n5.nabble.com/Camel-Stomp-Component-with-Spring-DSL-tp5747056p5747139.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Converter not getting called
camel version 2.11.0. In logs i can see Caused by: org.apache.camel.RuntimeCamelException Caused by: java.lang.IllegalAccessException a On Wed, Feb 12, 2014 at 3:59 AM, Christian Mueller [via Camel] ml-node+s465427n5747146...@n5.nabble.com wrote: Which version do you use? What's the result if you execute: template.requestBodyAndHeader(direct:aa,null,ab,header); 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 Tue, Feb 11, 2014 at 5:35 PM, yagyesh [hidden email]http://user/SendEmail.jtp?type=nodenode=5747146i=0 wrote: Hi All, I am using camel to call a restful webservice. I am calling the requestBodyandheader method of producerTemplate and expecting a response of type JSONarray template.requestBodyAndHeader(direct:aa,null,ab,header,JSONArray.class); A converter is also defined to manipulate the response. But i am not getting any result ,in logs converter is loaded but it is not getting called . The converter has been already added to classpath. Can anybody help me to indicate the possible causes of this issue? -- View this message in context: http://camel.465427.n5.nabble.com/Converter-not-getting-called-tp5747122.html Sent from the Camel - Users mailing list archive at Nabble.com. -- If you reply to this email, your message will be added to the discussion below: http://camel.465427.n5.nabble.com/Converter-not-getting-called-tp5747122p5747146.html To unsubscribe from Converter not getting called, click herehttp://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=5747122code=eWFneWEuYmh1QGdtYWlsLmNvbXw1NzQ3MTIyfC0xODEwMTI1Mzcz . NAMLhttp://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewerid=instant_html%21nabble%3Aemail.namlbase=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespacebreadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml -- View this message in context: http://camel.465427.n5.nabble.com/Converter-not-getting-called-tp5747122p5747157.html Sent from the Camel - Users mailing list archive at Nabble.com.