GenericFileMessage creates body from file multiples times
Hi all, using the file component I encountered a behaviour that doesn't seem right to me... but maybe it's an intended behaviour. Basically the issue shows when I have a route that reads the contents of a file using the file component and then the message body goes to null. At this point, any subsequent call to getBody (for instance a log(${body}) will cause the file to be read again, and put in the body. This behaviour is caused by the GenericFileMessage method createBody() (invoked by the MessageSupport.getBody() when the body is null) that, for the sake of lazy file loading, loads the file again every time it is invoked. This means that I cannot have an empty body, for any reason, in a route initiated by a file component. This seems wrong to me as null body can have valid meaning in a camel route. It this an intended behaviour? I created a test class for this issue that you can get here: TestGhostFileBody.java http://camel.465427.n5.nabble.com/file/n5765116/TestGhostFileBody.java . Let me know if you have problems getting it. Thanks, A. -- View this message in context: http://camel.465427.n5.nabble.com/GenericFileMessage-creates-body-from-file-multiples-times-tp5765116.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: parallelProcessing with multicast
You need to be aware that multicast is sending a copy of the same incoming message. So the filter is either true or false for all the messages as they are from the same copy. So in one case they are all odd, and in another case they are all even. And then they process about the same time and the order may appear as the same. If you want one of them to sleep for 1 sec and not the other you need to change your code. On Wed, Apr 1, 2015 at 2:38 PM, Christophe Pache chpa...@gmail.com wrote: Thanks Claus for your answer! I did test but did not succeed into making it work as I wanted to (change the order of received message). Following your advice, I've just added the streaming configuration to the multicast eip such as following, is that correct? val croute = new org.apache.camel.builder.RouteBuilder { override def configure(): Unit = { from(direct:input).multicast().parallelProcessing().streaming(). to(direct:even, direct:odd).end() from(direct:odd).filter(body.isEqualTo(1)).to(mock:output) from(direct:even).filter(body.isEqualTo(0)). process(new Processor { override def process(exchange: Exchange): Unit = { Thread.sleep(1000) } } ). to(mock:output) } } -- View this message in context: http://camel.465427.n5.nabble.com/parallelProcessing-with-multicast-tp5765146p5765149.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: parallelProcessing with multicast
You need to enable streaming mode to have out of order aggregation - even for multicast. The work is done in parallel, but in non streaming mode the aggregation happens in fixed order. On Wed, Apr 1, 2015 at 1:52 PM, Christophe Pache chpa...@gmail.com wrote: Hello everyone I have tried to test the parallel processing with Camel. The split was easy and worked out of the box. I have some surprises and I'm wondering whenever I'm understanding correctly the expected behaviour with the multicast. In the Code below, I try to send messages to two routes. The even route takes more time than the odd one. I would like to get the odd number I'm sending before the even number. I was expecting the odd number to be processed faster than the other, am I correct? I'm currently getting the exchange in the same order I sent, is it the expected behavior? Thanks and have a nice day Christophe I'm using camel 2.12: val croute = new org.apache.camel.builder.RouteBuilder { override def configure(): Unit = { from(direct:input).multicast().parallelProcessing(). to(direct:even, direct:odd).end() from(direct:odd).filter(body.isEqualTo(1)).process(new Processor { override def process(exchange: Exchange): Unit = { println(exchange.getIn.getBody) } }).to(mock:output) from(direct:even).filter(body.isEqualTo(0)). process(new Processor { override def process(exchange: Exchange): Unit = { println(exchange.getIn.getBody) Thread.sleep(1000) //or to avoid side effects on the Thread: (1 to 100).foreach(x = scala.util.Random.nextDouble()) } } ). to(mock:output) } } //. val producer = camelContext.createProducerTemplate() List(0, 1, 0, 1, 0, 1, 0, 1, 0, 1).foreach(x = producer.sendBody(direct:input, x)) -- View this message in context: http://camel.465427.n5.nabble.com/parallelProcessing-with-multicast-tp5765146.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: parallelProcessing with multicast
Thanks Claus for your answer! I did test but did not succeed into making it work as I wanted to (change the order of received message). Following your advice, I've just added the streaming configuration to the multicast eip such as following, is that correct? val croute = new org.apache.camel.builder.RouteBuilder { override def configure(): Unit = { from(direct:input).multicast().parallelProcessing().streaming(). to(direct:even, direct:odd).end() from(direct:odd).filter(body.isEqualTo(1)).to(mock:output) from(direct:even).filter(body.isEqualTo(0)). process(new Processor { override def process(exchange: Exchange): Unit = { Thread.sleep(1000) } } ). to(mock:output) } } -- View this message in context: http://camel.465427.n5.nabble.com/parallelProcessing-with-multicast-tp5765146p5765149.html Sent from the Camel - Users mailing list archive at Nabble.com.
Apache Camel 2.15.1 released
The Camel community announces the immediate availability of the new patch release Camel 2.15.1. This release contains a total of 55 fixes applied in the few weeks by the community on the Camel master branch. The artifacts are published and ready for you to download[1] either from the Apache mirrors or from the Central Maven repository. For more details please take a look at the release notes[2][3]. Many thanks to all who made this release possible. [1]http://camel.apache.org/download.html [2]https://cwiki.apache.org/confluence/display/CAMEL/Camel+2.15.1+Release [3]https://issues.apache.org/jira/secure/ReleaseNote.jspa?version=12329441styleName=HtmlprojectId=12311211 On behalf of the Camel PMC, -- Willem Jiang Red Hat, Inc. Web: http://www.redhat.com Blog: http://willemjiang.blogspot.com (English) http://jnn.iteye.com (Chinese) Twitter: willemjiang Weibo: 姜宁willem
parallelProcessing with multicast
Hello everyone I have tried to test the parallel processing with Camel. The split was easy and worked out of the box. I have some surprises and I'm wondering whenever I'm understanding correctly the expected behaviour with the multicast. In the Code below, I try to send messages to two routes. The even route takes more time than the odd one. I would like to get the odd number I'm sending before the even number. I was expecting the odd number to be processed faster than the other, am I correct? I'm currently getting the exchange in the same order I sent, is it the expected behavior? Thanks and have a nice day Christophe I'm using camel 2.12: val croute = new org.apache.camel.builder.RouteBuilder { override def configure(): Unit = { from(direct:input).multicast().parallelProcessing(). to(direct:even, direct:odd).end() from(direct:odd).filter(body.isEqualTo(1)).process(new Processor { override def process(exchange: Exchange): Unit = { println(exchange.getIn.getBody) } }).to(mock:output) from(direct:even).filter(body.isEqualTo(0)). process(new Processor { override def process(exchange: Exchange): Unit = { println(exchange.getIn.getBody) Thread.sleep(1000) //or to avoid side effects on the Thread: (1 to 100).foreach(x = scala.util.Random.nextDouble()) } } ). to(mock:output) } } //. val producer = camelContext.createProducerTemplate() List(0, 1, 0, 1, 0, 1, 0, 1, 0, 1).foreach(x = producer.sendBody(direct:input, x)) -- View this message in context: http://camel.465427.n5.nabble.com/parallelProcessing-with-multicast-tp5765146.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: parallelProcessing with multicast
An incident that is necessary to call a method .end() from(...) .filter() .to(myprocess) .to(mock.out) .end(); Your account is perceived as from(...) .filter() .to(myprocess) .end() .to(mock.out); -- View this message in context: http://camel.465427.n5.nabble.com/parallelProcessing-with-multicast-tp5765146p5765154.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: parallelProcessing with multicast
Thanks, You are true. Sorry, I should have pasted the code where I send exchanges again. List(0, 1, 0, 1, 0, 1, 0, 1, 0, 1).foreach(x =sendBody(direct:input, x)) I'm sending 10 exchanges. I hope I'll receive 10 in the end and I'm not expecting aggregation in fact. I've controlled each sub route sends 5 exchanges to the final mock endpoint. I receive 10 exchanges but this is just the order which interests me on this case. From what I understand, this is the aggregation of results that I should make parallel to get the odd results faster than the even one. I'm fine with that, I would just find a way to be sure the processing (in the sub routes) is done in parallel. I've had a look to MultiCastParallelAndStreamCachingTest.java https://github.com/apache/camel/blob/master/camel-core/src/test/java/org/apache/camel/processor/MultiCastParallelAndStreamCachingTest.java but did not find tests that validate it yet. My latest try was to print iteratively in both sub route to prove the print may occur at the same time, but did not succeed: val croute = new org.apache.camel.builder.RouteBuilder { override def configure(): Unit = { from(direct:input).multicast().parallelProcessing().streaming(). to(direct:even, direct:odd).end() from(direct:odd).filter(body.isEqualTo(1)). process(new Processor { override def process(exchange: Exchange): Unit = { (1 to 10).foreach(x = { Thread.sleep(100) println(odd) }) } } ).to(mock:output) from(direct:even).filter(body.isEqualTo(0)). process(new Processor { override def process(exchange: Exchange): Unit = { (1 to 10).foreach(x = { Thread.sleep(100) println(even) }) } } ). to(mock:output) } } -- View this message in context: http://camel.465427.n5.nabble.com/parallelProcessing-with-multicast-tp5765146p5765151.html Sent from the Camel - Users mailing list archive at Nabble.com.
How to handle two dimensional arrays
Hi everyone, We have a Camel Processor which can return an Object[][], but how do one deal with the result if each of the Objects is a message you want to further handle downstream? Any help is greatly appreciated. Regards Divan Mostert | Head of iO Development C24.biz M: +264 81 383 2924 E: divan.most...@c24.bizmailto:wayne.mei...@c24.biz
Re: parallelProcessing with multicast
Thanks, Alexey I added the end and then it worked. Well, Claus was true also: Now, I've understood the parallel processing is only on one exchange in one EIP at a time. My sample works, thanks guys!!! have a nice day Le 01. 04. 15 15:47, alexey-s [via Camel] a écrit : An incident that is necessary to call a method .end() from(...) .filter() .to(myprocess) .to(mock.out) .end(); Your account is perceived as from(...) .filter() .to(myprocess) .end() .to(mock.out); If you reply to this email, your message will be added to the discussion below: http://camel.465427.n5.nabble.com/parallelProcessing-with-multicast-tp5765146p5765154.html To unsubscribe from parallelProcessing with multicast, click here http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=5765146code=Y2hwYWNoZUBnbWFpbC5jb218NTc2NTE0NnwtMTU5MDMwMjIzOQ==. NAML http://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/parallelProcessing-with-multicast-tp5765146p5765157.html Sent from the Camel - Users mailing list archive at Nabble.com.
Errorhandler - Documentation Error?
Hi I have used following in my camel context camel:errorHandler id=deadLetterErrorHandler type=DeadLetterChannel deadLetterUri=log:dead camel:redeliveryPolicy maximumRedeliveries=2 redeliveryDelay=1000 logHandled=true asyncDelayedRedelivery=true handled=true/ /camel:errorHandler But when I validate, I get error as *cvc-complex-type.3.2.2: Attribute 'handled' is not allowed to appear in element 'camel:errorHandler'.* I was following documentation at http://camel.apache.org/error-handler.html. Is there something wrong in this documentation? It says deadLetterErrorHandler supports handled / continued features? Or is it something wrong in my above code? Cheers Reji - Reji Mathews Sr. Developer - Middleware Integration / SOA ( Open Source - Apache Camel Jboss Fuse ESB | Mule ESB ) LinkedIn - http://in.linkedin.com/pub/reji-mathews/31/9a2/40a Twitter - reji_mathews -- View this message in context: http://camel.465427.n5.nabble.com/Errorhandler-Documentation-Error-tp5765158.html Sent from the Camel - Users mailing list archive at Nabble.com.
camel-swagger in karaf? not yet....
With the release of 2.15.1 fixing a bug that prevented 2.15 from working in an OSGi environment, figured I'd give camel-swagger feature a try... 2015-04-01 09:52:38,672 | ERROR | qtp3964738-67| FeaturesPlugin | 88 - org.apache.karaf.webconsole.features - 3.0.3 | Can't install feature camel-swagger/2.15.1 java.lang.IllegalStateException: Can't install feature camel-swagger/2.15.1: Could not start bundle mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.swagger-core/1.3.12_1 in feature(s) camel-swagger-2.15.1: Unresolved constraint in bundle org.apache.servicemix.bundles.swagger-core [111]: Unable to resolve 111.0: missing requirement [111.0] osgi.wiring.package; ((osgi.wiring.package=scala.reflect.api)(version=2.10.0)(!(version=3.0.0))) Vanilla Karaf 3.0.3 Am I missing something or should I file a bug? Thanks! Ed
Marshal with quote in CSV
I'm creating csv file using Camel Bindy. using 2.12 version. In bindy model I have used @CsvRecord(separator = , , quote = \ ) when i open csv file values are coming without quotes but I need all the values with double quotes. ABC,TEST,CG,QEQE -- View this message in context: http://camel.465427.n5.nabble.com/Marshal-with-quote-in-CSV-tp5765160.html Sent from the Camel - Users mailing list archive at Nabble.com.
Calling NTLM protected service from camel cxf component
Hi I am having trouble calling an NTLM protected service from my route. When my route sends data to endpoint rsClient below it looks as if the conduit config is not applied. I see the following in the logs: 20150401 10:21:18,929 EDT DEBUG http.HTTPConduit [Camel (camel) thread #0 - JmsConsumer[OUTBOUND]] *No Trust Decider configured* for Conduit '{http://myserviceurl:20010/myservice}WebClient.http-conduit' 20150401 10:21:18,929 EDT DEBUG http.HTTPConduit [Camel (camel) thread #0 - JmsConsumer[OUTBOUND]] *No Auth Supplier configured* for Conduit '{http://myserviceurl:20010/myservice}WebClient.http-conduit' beans xmlns=http://www.springframework.org/schema/beans; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:cxf=http://camel.apache.org/schema/cxf; xmlns:context=http://www.springframework.org/schema/context; xmlns:http=http://cxf.apache.org/transports/http/configuration; xmlns:sec=http://cxf.apache.org/configuration/security; xsi:schemaLocation= http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://camel.apache.org/schema/cxf http://camel.apache.org/schema/cxf/camel-cxf.xsd http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/configuration/http-conf.xsd http://cxf.apache.org/configuration/security http://cxf.apache.org/schemas/configuration/security.xsd; http:conduit name=*.http-conduit http:client AllowChunking=false MaxRetransmits=11 Connection=Keep-Alive ReceiveTimeout=6 CacheControl=No-Cache / http:authorization sec:UserNameDomainName\\${user.username}/sec:UserName sec:Password${user.password}/sec:Password sec:AuthorizationNTLM/sec:Authorization /http:authorization /http:conduit cxf:rsClient id=rsClient address=${endpoint.url} serviceClass=com.myresouce.Resource loggingFeatureEnabled=true / /beans -- View this message in context: http://camel.465427.n5.nabble.com/Calling-NTLM-protected-service-from-camel-cxf-component-tp5765161.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: camel-swagger in karaf? not yet....
Hi See the known issue section at http://camel.apache.org/camel-2150-release.html On Wed, Apr 1, 2015 at 4:24 PM, Ed Welch e...@edjusted.com wrote: With the release of 2.15.1 fixing a bug that prevented 2.15 from working in an OSGi environment, figured I'd give camel-swagger feature a try... 2015-04-01 09:52:38,672 | ERROR | qtp3964738-67| FeaturesPlugin | 88 - org.apache.karaf.webconsole.features - 3.0.3 | Can't install feature camel-swagger/2.15.1 java.lang.IllegalStateException: Can't install feature camel-swagger/2.15.1: Could not start bundle mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.swagger-core/1.3.12_1 in feature(s) camel-swagger-2.15.1: Unresolved constraint in bundle org.apache.servicemix.bundles.swagger-core [111]: Unable to resolve 111.0: missing requirement [111.0] osgi.wiring.package; ((osgi.wiring.package=scala.reflect.api)(version=2.10.0)(!(version=3.0.0))) Vanilla Karaf 3.0.3 Am I missing something or should I file a bug? Thanks! Ed -- Claus Ibsen - Red Hat, Inc. Email: cib...@redhat.com Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen hawtio: http://hawt.io/ fabric8: http://fabric8.io/
Re: camel-swagger in karaf? not yet....
And if I learn to search Jira properly, I find the issue now too :/ https://issues.apache.org/jira/browse/CAMEL-8568 Thanks Claus On Wed, 1 Apr 2015 16:42:40 +0200, Claus Ibsen claus.ib...@gmail.com wrote: Hi See the known issue section at http://camel.apache.org/camel-2150-release.html On Wed, Apr 1, 2015 at 4:24 PM, Ed Welch e...@edjusted.com wrote: With the release of 2.15.1 fixing a bug that prevented 2.15 from working in an OSGi environment, figured I'd give camel-swagger feature a try... 2015-04-01 09:52:38,672 | ERROR | qtp3964738-67| FeaturesPlugin | 88 - org.apache.karaf.webconsole.features - 3.0.3 | Can't install feature camel-swagger/2.15.1 java.lang.IllegalStateException: Can't install feature camel-swagger/2.15.1: Could not start bundle mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.swagger-core/1.3.12_1 in feature(s) camel-swagger-2.15.1: Unresolved constraint in bundle org.apache.servicemix.bundles.swagger-core [111]: Unable to resolve 111.0: missing requirement [111.0] osgi.wiring.package; ((osgi.wiring.package=scala.reflect.api)(version=2.10.0)(!(version=3.0.0))) Vanilla Karaf 3.0.3 Am I missing something or should I file a bug? Thanks! Ed -- 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: Errorhandler - Documentation Error?
Hi You have maybe mis-read the page, there is no handled=true on that page However there is a logHandled=true On Wed, Apr 1, 2015 at 4:05 PM, contactreji contactr...@gmail.com wrote: Hi I have used following in my camel context camel:errorHandler id=deadLetterErrorHandler type=DeadLetterChannel deadLetterUri=log:dead camel:redeliveryPolicy maximumRedeliveries=2 redeliveryDelay=1000 logHandled=true asyncDelayedRedelivery=true handled=true/ /camel:errorHandler But when I validate, I get error as *cvc-complex-type.3.2.2: Attribute 'handled' is not allowed to appear in element 'camel:errorHandler'.* I was following documentation at http://camel.apache.org/error-handler.html. Is there something wrong in this documentation? It says deadLetterErrorHandler supports handled / continued features? Or is it something wrong in my above code? Cheers Reji - Reji Mathews Sr. Developer - Middleware Integration / SOA ( Open Source - Apache Camel Jboss Fuse ESB | Mule ESB ) LinkedIn - http://in.linkedin.com/pub/reji-mathews/31/9a2/40a Twitter - reji_mathews -- View this message in context: http://camel.465427.n5.nabble.com/Errorhandler-Documentation-Error-tp5765158.html Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen - Red Hat, Inc. Email: cib...@redhat.com Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen hawtio: http://hawt.io/ fabric8: http://fabric8.io/
Problem Adding ActiveMQ Broker URL to Camel Context Using Java DSL Type Project
I'm trying to add the correct tcp:// connection url to the camel context in a standalone/Java DSL camel app and am using a boot() method that was pulled from example code on the camel site. In my boot() method I'm trying to add the correct URL to the camel context but it's not getting added. When the code runs its still looking for a broker on localhost instead of the broker server I passed. How do I get the URL to be picked up in the context so my Java DSL route can connect to the correct server? @SuppressWarnings(static-access) public void boot() throws Exception { // create a Main instance main = new Main(); // enable hangup support so you can press ctrl + c to terminate the JVM main.enableHangupSupport(); ActiveMQComponent amq = new ActiveMQComponent(); main.getOrCreateCamelContext().addComponent( activemq, amq.activeMQComponent(tcp://ourbrokerserver.workplace.com:61616)); //ActiveMQComponent amq = new ActiveMQComponent(); // add routes main.addRouteBuilder(new EtlProducerRouteBuilder()); // run until you terminate the JVM System.out.println(Starting Camel. Use ctrl + c to terminate the JVM.\n); main.run(); }
Apache Camel-Mina2 ExchangePattern
I am trying to build a prototype using Apache Camel-Mina2 component. We have our own protocol implementation on TCP and I need to intercept Client - Server messages using a proxy Component. Existing - TCP Client TCP Server New - TCP Client Proxy Server - TCP Server One of the issue in our protocol is that each Request is not guaranteed a reply from the server, so some requests will be sent on the channel with an optional response. However some requests will also get back a response. Protocol Semantics : Hi Hello How Are You -- Are You okay - -Yes As you can see messages with are from client to server and are responses from Server ( on a single stream /line). Now given the above problem, Camel-Mina2 works on a InOut message exchange pattern. The ExchangePattern Enumeration also has an InOptionalOut use case. Any suggestions how I can configure my endpoints? I would like to know if it is possible to make use of an InOptionalOut exchange pattern. So essentially not worry about the response for certain types of messages. Can I handle this programmatically - Read the Message Body and decide if a Request needs a Response or just needs to be written out ? Sample implementation is as below: SimpleRegistry reg = new SimpleRegistry(); reg.put(ProtocolCodec, new ProtocolCodec()); CamelContext context = new DefaultCamelContext(reg); context.addRoutes(new RouteBuilder() { @Override public void configure() throws Exception { // TODO Auto-generated method stub from(mina2:tcp://localhost:9888?sync=truecodec=#ProtocolCodecdisconnectOnNoReply=false). to(mina2:tcp://localhost:9889?sync=truecodec=#ProtocolCodecdisconnectOnNoReply=falseclientMode=true); } }); context.start(); -- View this message in context: http://camel.465427.n5.nabble.com/Apache-Camel-Mina2-ExchangePattern-tp5765184.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Apache Camel-Mina2 ExchangePattern
Current Camel-Mina2 producer just wait for the response when the endpoint sync option is true, it doesn’t support to set the reply mode dynamically. BTW, can you tell if Message exchange pattern by just looking up the message content? -- Willem Jiang Red Hat, Inc. Web: http://www.redhat.com Blog: http://willemjiang.blogspot.com (English) http://jnn.iteye.com (Chinese) Twitter: willemjiang Weibo: 姜宁willem On April 2, 2015 at 1:03:58 PM, itsavvy.ankur (iamtheone.an...@gmail.com) wrote: I am trying to build a prototype using Apache Camel-Mina2 component. We have our own protocol implementation on TCP and I need to intercept Client - Server messages using a proxy Component. Existing - TCP Client TCP Server New - TCP Client Proxy Server - TCP Server One of the issue in our protocol is that each Request is not guaranteed a reply from the server, so some requests will be sent on the channel with an optional response. However some requests will also get back a response. Protocol Semantics : Hi Hello How Are You -- Are You okay - -Yes As you can see messages with are from client to server and are responses from Server ( on a single stream /line). Now given the above problem, Camel-Mina2 works on a InOut message exchange pattern. The ExchangePattern Enumeration also has an InOptionalOut use case. Any suggestions how I can configure my endpoints? I would like to know if it is possible to make use of an InOptionalOut exchange pattern. So essentially not worry about the response for certain types of messages. Can I handle this programmatically - Read the Message Body and decide if a Request needs a Response or just needs to be written out ? Sample implementation is as below: SimpleRegistry reg = new SimpleRegistry(); reg.put(ProtocolCodec, new ProtocolCodec()); CamelContext context = new DefaultCamelContext(reg); context.addRoutes(new RouteBuilder() { @Override public void configure() throws Exception { // TODO Auto-generated method stub from(mina2:tcp://localhost:9888?sync=truecodec=#ProtocolCodecdisconnectOnNoReply=false). to(mina2:tcp://localhost:9889?sync=truecodec=#ProtocolCodecdisconnectOnNoReply=falseclientMode=true); } }); context.start(); -- View this message in context: http://camel.465427.n5.nabble.com/Apache-Camel-Mina2-ExchangePattern-tp5765184.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Problem Adding ActiveMQ Broker URL to Camel Context Using Java DSL Type Project
Hi, You should call the bind method instead of main.getOrCreateCamelContext() to add the configured the ActiveMQComponent like this. main.bind( activemq, amq.activeMQComponent(tcp://ourbrokerserver.workplace.com:61616)); main.getOrCreateCamelContext() just create a new camel map per call. -- Willem Jiang Red Hat, Inc. Web: http://www.redhat.com Blog: http://willemjiang.blogspot.com (English) http://jnn.iteye.com (Chinese) Twitter: willemjiang Weibo: 姜宁willem On April 1, 2015 at 11:55:49 PM, Wilkerson, Daniel (dwilker...@fullsail.com) wrote: I'm trying to add the correct tcp:// connection url to the camel context in a standalone/Java DSL camel app and am using a boot() method that was pulled from example code on the camel site. In my boot() method I'm trying to add the correct URL to the camel context but it's not getting added. When the code runs its still looking for a broker on localhost instead of the broker server I passed. How do I get the URL to be picked up in the context so my Java DSL route can connect to the correct server? @SuppressWarnings(static-access) public void boot() throws Exception { // create a Main instance main = new Main(); // enable hangup support so you can press ctrl + c to terminate the JVM main.enableHangupSupport(); ActiveMQComponent amq = new ActiveMQComponent(); main.getOrCreateCamelContext().addComponent( activemq, amq.activeMQComponent(tcp://ourbrokerserver.workplace.com:61616)); //ActiveMQComponent amq = new ActiveMQComponent(); // add routes main.addRouteBuilder(new EtlProducerRouteBuilder()); // run until you terminate the JVM System.out.println(Starting Camel. Use ctrl + c to terminate the JVM.\n); main.run(); }
Re: Apache Camel-Mina2 ExchangePattern
Hi Willem, Thanks for your response. I can check the message body for the two command headers that just need to be written out but not expect a reply. I think the underlying implementation for Mina2Producer will block my use case. I cannot do sync=false and with sync=true the Mina2Producer implementation always checks for a response within a specific timeout. May be need to write my own implementation? Any ideas of doing this out of the box ? Thanks. On 2 Apr 2015 11:24, Willem.Jiang [via Camel] ml-node+s465427n5765186...@n5.nabble.com wrote: Current Camel-Mina2 producer just wait for the response when the endpoint sync option is true, it doesn’t support to set the reply mode dynamically. BTW, can you tell if Message exchange pattern by just looking up the message content? -- Willem Jiang Red Hat, Inc. Web: http://www.redhat.com Blog: http://willemjiang.blogspot.com (English) http://jnn.iteye.com (Chinese) Twitter: willemjiang Weibo: 姜宁willem On April 2, 2015 at 1:03:58 PM, itsavvy.ankur ([hidden email] http:///user/SendEmail.jtp?type=nodenode=5765186i=0) wrote: I am trying to build a prototype using Apache Camel-Mina2 component. We have our own protocol implementation on TCP and I need to intercept Client - Server messages using a proxy Component. Existing - TCP Client TCP Server New - TCP Client Proxy Server - TCP Server One of the issue in our protocol is that each Request is not guaranteed a reply from the server, so some requests will be sent on the channel with an optional response. However some requests will also get back a response. Protocol Semantics : Hi Hello How Are You -- Are You okay - -Yes As you can see messages with are from client to server and are responses from Server ( on a single stream /line). Now given the above problem, Camel-Mina2 works on a InOut message exchange pattern. The ExchangePattern Enumeration also has an InOptionalOut use case. Any suggestions how I can configure my endpoints? I would like to know if it is possible to make use of an InOptionalOut exchange pattern. So essentially not worry about the response for certain types of messages. Can I handle this programmatically - Read the Message Body and decide if a Request needs a Response or just needs to be written out ? Sample implementation is as below: SimpleRegistry reg = new SimpleRegistry(); reg.put(ProtocolCodec, new ProtocolCodec()); CamelContext context = new DefaultCamelContext(reg); context.addRoutes(new RouteBuilder() { @Override public void configure() throws Exception { // TODO Auto-generated method stub from(mina2:tcp://localhost:9888?sync=truecodec=#ProtocolCodecdisconnectOnNoReply=false). to(mina2:tcp://localhost:9889?sync=truecodec=#ProtocolCodecdisconnectOnNoReply=falseclientMode=true); } }); context.start(); -- View this message in context: http://camel.465427.n5.nabble.com/Apache-Camel-Mina2-ExchangePattern-tp5765184.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/Apache-Camel-Mina2-ExchangePattern-tp5765184p5765186.html To unsubscribe from Apache Camel-Mina2 ExchangePattern, click here http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=5765184code=aWFtdGhlb25lLmFua3VyQGdtYWlsLmNvbXw1NzY1MTg0fC01MTEzNTA1MDg= . NAML http://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/Apache-Camel-Mina2-ExchangePattern-tp5765184p5765187.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: camel-swagger in karaf? not yet....
Ok, I've spent the bulk of my day on this, and have met with some success. There are a few other gotcha's trying to get swagger to run from karaf. (some issues were fought based on my application, for example, i was using guava 18, however swagger brings with it guava 15 creating some dependency chain nightmares...) The first real issue was with the RBAC setup in newer karaf versions. The DefaultCamelSwaggerServlet tries to execute dumpRestsAsXml and karaf will not allow it. To fix this I created etc/jmx.acl.org.apache.camel.context.cfg with contents: dumpRestsAsXml = * This should probably go into the camel-swagger feature? Second problem, my application has multiple camel servlets, and the class mentioned above essentially just picks the last one it enumerates, unless the camelId init-param is set on the servlet config. So to get DefaultCamelSwaggerServlet to pick the correct mbean to invoke dumpRestAsXml, I had to add this to my web.xml inside the DefaultCamelSwaggerServlet definition: init-param param-namecamelId/param-name param-valueelnk-jhm-main/param-value /init-param where elnk-jhm-main is the name of my camel context containing my rest routes NOTE: the quotes were required here. camelId is currently not documented on the wiki page, and it seems like DefaultCamelSwaggerServlet should probably be modified so that it strips the quotes when doing the .equals on camelId, so that the param-value doesn't need quotes. I got all this working, and was a little surprised to just see a json output (was expecting the swagger web ui). So i built and ran the camel tomcat servlet example which has swagger configured, and upon snooping around that project realized you still need to do a bunch of additional work to actually include the swagger ui into your project (all done in the pom.xml of that example project) This is fine, and apparent to me now, but my expectation going into this was more along the lines of once I had the camel-swagger stuff configured in my servlet, bam, i would have swagger running. It might be worth updating the wiki to mention the pom.xml configs for downloading/extracting/installing swagger are required still. All in all I made good progress, I'm willing to either help with the documentation updates or the karaf feature config if any help is needed. please let me know! Thanks, Ed On Wed, 1 Apr 2015 16:42:40 +0200, Claus Ibsen claus.ib...@gmail.com wrote: Hi See the known issue section at http://camel.apache.org/camel-2150-release.html On Wed, Apr 1, 2015 at 4:24 PM, Ed Welch e...@edjusted.com wrote: With the release of 2.15.1 fixing a bug that prevented 2.15 from working in an OSGi environment, figured I'd give camel-swagger feature a try... 2015-04-01 09:52:38,672 | ERROR | qtp3964738-67| FeaturesPlugin | 88 - org.apache.karaf.webconsole.features - 3.0.3 | Can't install feature camel-swagger/2.15.1 java.lang.IllegalStateException: Can't install feature camel-swagger/2.15.1: Could not start bundle mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.swagger-core/1.3.12_1 in feature(s) camel-swagger-2.15.1: Unresolved constraint in bundle org.apache.servicemix.bundles.swagger-core [111]: Unable to resolve 111.0: missing requirement [111.0] osgi.wiring.package; ((osgi.wiring.package=scala.reflect.api)(version=2.10.0)(!(version=3.0.0))) Vanilla Karaf 3.0.3 Am I missing something or should I file a bug? Thanks! Ed -- 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/
kafka producer - multiple brokers
Please excuse my lack of experience with Kafka, but I understood that for redundancy purposes, a cluster would generally contain multiple brokers and that a producer woudl try to connect to any of a list of them. If that's true, how might I tell Camel about the availability of multiple brokers. I only see an opportunity to put a single broker in the URI (192.168.0.1:9092 in this case) ? For example if myblueprint contains... to uri=kafka:192.168.0.1:9092?producerType=syncamp;zookeeperHost=192.168.0.2amp;zookeeperPort=2181amp;topic=testamp;partitioner=camel.myPartitioneramp;serializerClass=kafka.serializer.DefaultEncoderamp;keySerializerClass=kafka.serializer.StringEncoder / Many thanks Alan -- View this message in context: http://camel.465427.n5.nabble.com/kafka-producer-multiple-brokers-tp5765174.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Calling NTLM protected service from camel cxf component
Hi there, sec:UserNameDomainName\\${user.username}/sec:UserName You should use single slash here. sec:UserNameDomainName\${user.username}/sec:UserName What OS are you using to run you camel route? win/*nix? In case of Windows who started your app? What user does your application work on behalf of? Is this user (who started the app) domain user? Hi I am having trouble calling an NTLM protected service from my route. When my route sends data to endpoint rsClient below it looks as if the conduit config is not applied. I see the following in the logs: 20150401 10:21:18,929 EDT DEBUG http.HTTPConduit [Camel (camel) thread #0 - JmsConsumer[OUTBOUND]] *No Trust Decider configured* for Conduit '{http://myserviceurl:20010/myservice}WebClient.http-conduit' 20150401 10:21:18,929 EDT DEBUG http.HTTPConduit [Camel (camel) thread #0 - JmsConsumer[OUTBOUND]] *No Auth Supplier configured* for Conduit '{http://myserviceurl:20010/myservice}WebClient.http-conduit' beans xmlns=http://www.springframework.org/schema/beans; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:cxf=http://camel.apache.org/schema/cxf; xmlns:context=http://www.springframework.org/schema/context; xmlns:http=http://cxf.apache.org/transports/http/configuration; xmlns:sec=http://cxf.apache.org/configuration/security; xsi:schemaLocation= http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://camel.apache.org/schema/cxf http://camel.apache.org/schema/cxf/camel-cxf.xsd http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/configuration/http-conf.xsd http://cxf.apache.org/configuration/security http://cxf.apache.org/schemas/configuration/security.xsd; http:conduit name=*.http-conduit http:client AllowChunking=false MaxRetransmits=11 Connection=Keep-Alive ReceiveTimeout=6 CacheControl=No-Cache / http:authorization sec:UserNameDomainName\\${user.username}/sec:UserName sec:Password${user.password}/sec:Password sec:AuthorizationNTLM/sec:Authorization /http:authorization /http:conduit cxf:rsClient id=rsClient address=${endpoint.url} serviceClass=com.myresouce.Resource loggingFeatureEnabled=true / /beans -- View this message in context: http://camel.465427.n5.nabble.com/Calling-NTLM-protected-service-from-camel-cxf-component-tp5765161.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Calling NTLM protected service from camel cxf component
Hi Surgey Thanks for the response. I am running on a tomcat instance on a linux server. The user is a windows user which is setup on our Windows Domain controller. I did try updating the http:authorization (within the http:conduit) element to include an AuthorizationType: http:authorization sec:UserNameDomainName\${tod.user.username}/sec:UserName sec:Password${user.password}/sec:Password *sec:AuthorizationTypeNegotiate/sec:AuthorizationType * sec:AuthorizationNTLM/sec:Authorization /http:authorization I am now getting the following exception: *java.lang.RuntimeException: No LoginModules configured for NTLM*. I am confused by this as I am only the client calling the NTLM protected service Thanks Joe -- View this message in context: http://camel.465427.n5.nabble.com/Calling-NTLM-protected-service-from-camel-cxf-component-tp5765161p5765179.html Sent from the Camel - Users mailing list archive at Nabble.com.