Re: typesafe endpoint configuration approach
Hi Willem, is there an example of how to define the Endpoint in the pure Java way,? Didn't find one. regards Christian Schäfer Willem.Jiang [via Camel] ml-node+s465427n5743397...@n5.nabble.com schrieb am 2:34 Montag, 18.November 2013: Hi, I’m not a not a big fan of this type safe endpoint configuration. As the endpoints are different from each other, you cannot define a unified fluent API for all the endpoints. But Camel does support to define the Endpoint in the pure Java way, but it is not as easy as using the URI to setup the endpoint. BTW, the good part of URI is we can build the endpoint from Java, Spring or Blueprint without change any thing. -- 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 Sunday, November 17, 2013 at 8:10 PM, ChristianSchaefer wrote: Hello there, after working with a camel for some months I wondered from time to time if there is a possibility to define endpoints a bit more typesafe way because writing URI strings is prone to typos/property-mismatch and (imho) not really supported by an IDE. Furthermore the developing includes writing code, reading the doc to get that property's name and pasting it in the code. As I didn't find anything like that except (http://camel.465427.n5.nabble.com/Endpoint-URI-typesafety-td5733594.htm), I had an idea to write the consumer config as the following file copy example demonstrates. (adapted from the camel in action book example in chapter 1): *from(new FileConsumerTemplate(data/inbox) .setNoop(true) .setRecursive(true) .get()) .log(going to copy file..) .to(file:data/outbox);* This way one could use endpoint specific template classes which implement methods for the specific properties (enabling IDE auto suggestion) where one could also put the camel documentation at. Have a look at the complete working example code (quickly hacked so there are surely some points to optimize.) http://pastebin.com/JvMQ3wpG http://pastebin.com/Vn3z3sRc http://pastebin.com/Zjs3Jrp3 (Alternatively the complete package in a zip: https://dl.dropboxusercontent.com/u/34369176/typesafeProdCons.zip) Tell/write me what you think please . -- View this message in context: http://camel.465427.n5.nabble.com/typesafe-endpoint-configuration-approach-tp5743391.html Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com). If you reply to this email, your message will be added to the discussion below:http://camel.465427.n5.nabble.com/typesafe-endpoint-configuration-approach-tp5743391p5743397.html To unsubscribe from typesafe endpoint configuration approach, click here. NAML -- View this message in context: http://camel.465427.n5.nabble.com/typesafe-endpoint-configuration-approach-tp5743391p5743407.html Sent from the Camel - Users mailing list archive at Nabble.com.
Message headers getting lost while using NMR
My Integration application is divided into two camel contexts. I am using NMR to have integration between these two camel contexts. The flow is as follows and I am using *INOnly* Message Exchange Pattern 1 CamelContext1-Route - NMR - CamelContext2-Route 2 CamelContext2-Route set some *new headers* in the input message 3 CamelContext2-Route returns the control back 4 CamelContext1-Route uses the header set by CamelContextx2-Route The problem I am facing is that the headers get lost from the input message when the control returns back to the CamelContext1-Route after step 3 completion. Can anyone suggest how this problem can be resolved. -- View this message in context: http://camel.465427.n5.nabble.com/Message-headers-getting-lost-while-using-NMR-tp5743356.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Composed Message Processor
Thank you so much :) -- View this message in context: http://camel.465427.n5.nabble.com/Composed-Message-Processor-tp5743165p5743410.html Sent from the Camel - Users mailing list archive at Nabble.com.
Camel and Testing
Hi, I've splitted my camel context with using routecontext. Everything is okay except for my unit tests doesn't work after this operation. I'm using annonation based testing. What can be problem? -- View this message in context: http://camel.465427.n5.nabble.com/Camel-and-Testing-tp5743411.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Parallel file processing with Camel
Hi No there is no xml example. But its fairly easy to do as well. Java and XML is very the same. So for threads in XML just do from threads -- configure threads herre -- ... insert stuff here /threads /route On Sat, Nov 16, 2013 at 6:24 PM, piyushbhatt bhattpiy...@gmail.com wrote: Hi Claus, Is it available as part of XML configuration ? If yes can you point me to some example Regards Piyush -- View this message in context: http://camel.465427.n5.nabble.com/Parallel-file-processing-with-Camel-tp5742049p5743378.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
Re: Simple way of calling WS under Tomcat - whole url?
Thank you for clarification. I was lost and relative path in from... element made me think to much ;p You are perfectly right in destination the whole url works like a charm. Sorry for such a silly question. -- View this message in context: http://camel.465427.n5.nabble.com/Simple-way-of-calling-WS-under-Tomcat-whole-url-tp5743382p5743417.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Message headers getting lost while using NMR
HI Neeraj, What header you are setting in you camel message? Header value must be a Serializable object. Cheers, Brad -- View this message in context: http://camel.465427.n5.nabble.com/Message-headers-getting-lost-while-using-NMR-tp5743356p5743416.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Camel and Testing
Hi You need to provide more details, to get better help. You can take a look at this page which have some bullets what you can do http://camel.apache.org/support On Mon, Nov 18, 2013 at 9:24 AM, bilalalp syme...@gmail.com wrote: Hi, I've splitted my camel context with using routecontext. Everything is okay except for my unit tests doesn't work after this operation. I'm using annonation based testing. What can be problem? -- View this message in context: http://camel.465427.n5.nabble.com/Camel-and-Testing-tp5743411.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
CXF, X509, signatures
Hello, I've to setup a webservice client for an existing WSDL. Client requests have to get signed (WSHandlerConstants.ACTION - WSHandlerConstants.SIGNATURE). Thing is there are a multitude of external webservice endpoints the requests need to get send to. And I have to use a couple of different certificates on the client side to sign the requests. Think of an m:n relationship like certificates a, b and c each being used to send requests to server 1, 2, 3 ... The remote server's URL and the certificate to use for signing are known on my application's side of course. I know the dynamic router EIP but doubt if it was clever to create endpoints for each combination of certificate and server. I assume this may go up above one thousand. Is there any viable setup to implement this with Camel or am I better off creating a Java client? Regards, mdo -- View this message in context: http://camel.465427.n5.nabble.com/CXF-X509-signatures-tp5743423.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: after setting trigger.repeatCount=1 then also going to infinite scheduler
Hi repeatCount is for the simple trigger, not for cron. So if you want something to only trigger one time, then remove the cron On Fri, Nov 15, 2013 at 6:05 PM, ishwar panjariish...@gmail.com wrote: hi. after setting repeatcount=1 then also my scheduler is continuously running.. i dont know where i made mistake. this is my code. public class Schedule { public String SayService(String msg) { return (msg); } public static void main(String args[])throws Exception { CamelContext context = new DefaultCamelContext(); context.addRoutes(new RouteBuilder() { public void configure() { from(quartz2://myGroup/myTimerName?cron=0+0+*+*+*+?trigger.repeatCount=1).bean(new Schedule(), SayService('dd')); } }); context.start(); } } i dont know why this running continuous.even after setting repeat=1. -- View this message in context: http://camel.465427.n5.nabble.com/after-setting-trigger-repeatCount-1-then-also-going-to-infinite-scheduler-tp5743361.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
Re: Is there interest in a second RabbitMQ component/consumer/endpoint?
Hi I dont think its a good idea to create a 2nd component. Instead improve/fix make the the existing component better. We love contributions http://camel.apache.org/contributing.html On Fri, Nov 15, 2013 at 7:49 PM, Christian Posta christian.po...@gmail.com wrote: not sure what the rest of the community thinks... but i would say at least put it on github :) would it be possible to just auto-default to the opinionated config settings in the current component? On Fri, Nov 15, 2013 at 10:28 AM, Alex Sherwin alex.sher...@gmail.com wrote: I found the RabbitMQ support shipped in 2.12 to be pretty sub-par for a bunch of reasons: - host/port must be configured in the URI - vhost must be configured in the URI - autoDelete cannot be specified separately for the Exchange/Queue - durability cannot be specified separately for the Exchange/Queue - poor options around ack/nack (autoAck is the only exposed option, which seems dangerous to me and CAMEL-6767https://issues.apache.org/jira/browse/CAMEL-6767 only addresses a current bug... which isn't taking exchange.isFailed() into account) - no options around redelivery on exchange failures I would think that all of those should probably be addressed in the current RabbitMQComponent/RabbitMQEndpoint/RabbitMQConsumer classes However, to make using RabbitMQ as a viable option for a classic queue use case, which is all I wanted to do, even fixing all of the above still left the URI's feeling quite heavy.. mainly because the standard AMQP practices around routing keys and anonymous queue bindings make perfect sense, unless, you just want durable non-autodeleted named queues So I created RabbitMQQueueComponent/Consumer/Endpoint implementations which make it behave like one may expect for regular queueing. You configure the one-time settings (host/port, defaults for durability etc on the component) and then you can just create routes like this: from(rabbitmq:exchange?queue=from queue).to(rabbitmq:exchange?queue=to queue) The component/endpoints/consumers take care of the creating matching routing keys, creating appropriate exchanges/queues/bindings using the AMQP client etc to make it act like classic queues I implemented everything mentioned above, but it would be competing with the existing RabbitMQ components (because, rightfully so, the default implementation would want to have AMQP semantics) So my question is just... is there any interest to have contributed components for RabbitMQ that have very opinionated default AMQP settings and behaviors -- Alexander Sherwin -- Christian Posta http://www.christianposta.com/blog twitter: @christianposta -- 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
Re: Import xml fragments of camel routes?
Hi No you cannot do this. You can though have routes in seperate xml files and use routeContext http://camel.apache.org/configuring-camel.html Though routeContext doesn't allow to use onException and the likes from camelContext On Fri, Nov 15, 2013 at 10:03 PM, dunnlow dunn...@yahoo.com wrote: I am using Spring 3.1 with Camel 10.1. I am working to support multiple environments with my camel/spring XML configuration (using a combination of camel and spring properties and distinct xml files). I have a common.xml file that holds routes (some are quite large) that are common between the environments. In some cases however there is a slight difference in the route (just a a few extra choice blocks for example). I'd like to import those choice blocks into my main common.xml file (similar to using routeContext but for just the fragment of the route). Is this possible? If so, how? Thanks! -- View this message in context: http://camel.465427.n5.nabble.com/Import-xml-fragments-of-camel-routes-tp5743369.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
Re: domain locks up on transactional file splits
If you use the Camel splitter, then you can run in streaming mode On Fri, Nov 15, 2013 at 9:54 PM, javamonkey79 javamonke...@gmail.com wrote: We're running camel 2.11 and AMQ 5.8 on glassfish red hat OS. We have a route which reads in somewhat large files (20 mb) and has to split them up. The current route reads the file in from SFTP to AMQ, then splits the file up sending each message to a JMS queue. The problem is, that the domain sometimes locks up. No out of memory errors or exceptions, it just stops working. The process is alive, but nothing is going on. It seems to be memory related, as local tests show that it is using 1gb of heap prior to committing the messages. Should it really be using that much memory? Is there a pattern for transactionally splitting up large messages? Thanks! -- View this message in context: http://camel.465427.n5.nabble.com/domain-locks-up-on-transactional-file-splits-tp5743368.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
Re: Camel properties component not being resolved when configuring data source
If you use spring, then all the bean is spring's property placeholder that handles that. And spring uses ${ } syntax. So change property name=username value={{datasource.stg.username}}/ To use ${ } All inside camelContext is Camel. And uses {{ }} syntax. See also http://camel.apache.org/how-do-i-use-spring-property-placeholder-with-camel-xml.html On Sat, Nov 16, 2013 at 2:45 PM, Joao Vicente joao.diogo.vice...@gmail.com wrote: I am having some trouble getting a data source setup using Camel properties component. So, I have a db.properties that contains configuration for my datasource (showing only url for brevity) My route builder seems to be able to resolve the property, but the data source does not seem to do so. The evidence for this is shown in the console output below. I wonder could anyone shed some light to why this could be happening? db.properties datasource.stg.url=jdbc:oracle:thin:... camel-context.xml ... bean id=properties class=org.apache.camel.component.properties.PropertiesComponent property name=location value=classpath:db.properties/ /bean bean id=auditDataSourceStg class=org.apache.commons.dbcp.BasicDataSource property name=driverClassName value=oracle.jdbc.driver.OracleDriver/ property name=url value={{datasource.stg.url}}/ property name=username value={{datasource.stg.username}}/ property name=password value={{datasource.stg.password}}/ property name=initialSize value=5 / property name=maxActive value=10 / /bean ... MyRouteBuilder.java ... public void configure() { from(fromQueryBuilder) .log([queryyBuilder] url:{{datasource.stg.url}}) Console output 2013-11-16 13:20:15,609 [queryBuilder] INFO route1 - [queryBuilder] url:jdbc:oracle:thin:... Cannot create JDBC driver of class 'oracle.jdbc.driver.OracleDriver' for connect URL '{{datasource.stg.url}}' -- View this message in context: http://camel.465427.n5.nabble.com/Camel-properties-component-not-being-resolved-when-configuring-data-source-tp5743375.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
null expression for setting body to null?
I would like to set the body to null using xml and would like do something as simple as setBodysimple${null}/simple/setBody I experimented with this idea and added this null-expression to the simple expression builder so that this expression works. But I was not sure if there is already another way to do this without introducing this expression. I know a workaround to set the body to null by using something non-existent (e.g., ${header.ugly}), but that is ugly. So if there is no other way, I would like to add this simple expression to camel. regards, aki
Re: onCompletion not triggerd in testing
I found out the problem which was making my test not reach the onComplete syncProcessor but I am having another issue now. Inside the processor I use producer.sendBody(buildDurableSubscription(register), holder);, where producer is created in the context.xml with camel:template id=producer / and return consumer.receiveBodyNoWait(buildDurableSubscription(register), SettlementHolder.class);, where the consumer is created with camel:consumerTemplate id=consumer/ to put an exchange on a persistent queue, so that in case of power failure or any other reason I can have the exchange after a restart, and then to receive it back and process it after onCompletion. The problem is that sometimes the first time when the consumer.receiveBodyNoWait is invoked it returns null, but if I invoke it twice the second invocation will return the pending exchange. This is the logging: first invocation returns null: 12:56:54.628 [Camel (camelContextTransactionToDBPublisher) thread #2 - OnCompletion] DEBUG org.apache.camel.impl.ConsumerCache - Endpoint[activemq://queue:masterDataExport.transactionToDBPublisher.synchronizedSettlement.register1] 12:56:54.631 [Camel (camelContextTransactionToDBPublisher) thread #2 - OnCompletion] DEBUG o.a.activemq.ActiveMQMessageConsumer - remove: ID:pc-clucutar-63598-1384772199184-2:1:1:3, *lastDeliveredSequenceId:0* second invocation returns the object: 12:57:05.134 [Camel (camelContextTransactionToDBPublisher) thread #2 - OnCompletion] DEBUG org.apache.camel.impl.ConsumerCache - Endpoint[activemq://queue:masterDataExport.transactionToDBPublisher.synchronizedSettlement.register1] 12:57:05.138 [Camel (camelContextTransactionToDBPublisher) thread #2 - OnCompletion] DEBUG o.a.activemq.ActiveMQMessageConsumer - remove: ID:pc-clucutar-63598-1384772199184-2:1:1:4, *lastDeliveredSequenceId:55* Even though I can see that the queueSize = 1 in JConsole, the retrieve operation doesn't retrieve anything and the queueSize doesn't change. The second call retrieves the exchange and queueSize becomes 0. Any idea? -- View this message in context: http://camel.465427.n5.nabble.com/onCompletion-not-triggerd-in-testing-tp5743163p5743434.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: onCompletion not triggerd in testing
receiveNoWait does not guarantee a message will be received. You would need to use the one with a timeout value, to have client poll server for new messages. On Mon, Nov 18, 2013 at 12:23 PM, cristisor cristisor...@yahoo.com wrote: I found out the problem which was making my test not reach the onComplete syncProcessor but I am having another issue now. Inside the processor I use producer.sendBody(buildDurableSubscription(register), holder);, where producer is created in the context.xml with camel:template id=producer / and return consumer.receiveBodyNoWait(buildDurableSubscription(register), SettlementHolder.class);, where the consumer is created with camel:consumerTemplate id=consumer/ to put an exchange on a persistent queue, so that in case of power failure or any other reason I can have the exchange after a restart, and then to receive it back and process it after onCompletion. The problem is that sometimes the first time when the consumer.receiveBodyNoWait is invoked it returns null, but if I invoke it twice the second invocation will return the pending exchange. This is the logging: first invocation returns null: 12:56:54.628 [Camel (camelContextTransactionToDBPublisher) thread #2 - OnCompletion] DEBUG org.apache.camel.impl.ConsumerCache - Endpoint[activemq://queue:masterDataExport.transactionToDBPublisher.synchronizedSettlement.register1] 12:56:54.631 [Camel (camelContextTransactionToDBPublisher) thread #2 - OnCompletion] DEBUG o.a.activemq.ActiveMQMessageConsumer - remove: ID:pc-clucutar-63598-1384772199184-2:1:1:3, *lastDeliveredSequenceId:0* second invocation returns the object: 12:57:05.134 [Camel (camelContextTransactionToDBPublisher) thread #2 - OnCompletion] DEBUG org.apache.camel.impl.ConsumerCache - Endpoint[activemq://queue:masterDataExport.transactionToDBPublisher.synchronizedSettlement.register1] 12:57:05.138 [Camel (camelContextTransactionToDBPublisher) thread #2 - OnCompletion] DEBUG o.a.activemq.ActiveMQMessageConsumer - remove: ID:pc-clucutar-63598-1384772199184-2:1:1:4, *lastDeliveredSequenceId:55* Even though I can see that the queueSize = 1 in JConsole, the retrieve operation doesn't retrieve anything and the queueSize doesn't change. The second call retrieves the exchange and queueSize becomes 0. Any idea? -- View this message in context: http://camel.465427.n5.nabble.com/onCompletion-not-triggerd-in-testing-tp5743163p5743434.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
Re: null expression for setting body to null?
What is the use-case for setting the body as null ? On Mon, Nov 18, 2013 at 11:59 AM, Aki Yoshida elak...@gmail.com wrote: I would like to set the body to null using xml and would like do something as simple as setBodysimple${null}/simple/setBody I experimented with this idea and added this null-expression to the simple expression builder so that this expression works. But I was not sure if there is already another way to do this without introducing this expression. I know a workaround to set the body to null by using something non-existent (e.g., ${header.ugly}), but that is ugly. So if there is no other way, I would like to add this simple expression to camel. 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
Re: onCompletion not triggerd in testing
Thank you for pointing that out for me, now the test is working. Still, I find it weird that the consumer is not retrieving anything even though JConsole shows that the QueueSize 0. -- View this message in context: http://camel.465427.n5.nabble.com/onCompletion-not-triggerd-in-testing-tp5743163p5743439.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: null expression for setting body to null?
One use case is for a request-response scenario using a jaxws provider (at camel-cosnumer) and when you want to return a null to this endpoint so that it can return an HTTP 202 response to the caller instead of returning some xml data which was in the body (i.e., using the rule described in jaws spec) Jaxws spec 5.1.1 Invocation A Provider based service instance’s invoke method is called for each message received for the service. When an invoke method returns null, it is considered that no response needs to be sent by service. regards, aki 2013/11/18 Claus Ibsen claus.ib...@gmail.com: What is the use-case for setting the body as null ? On Mon, Nov 18, 2013 at 11:59 AM, Aki Yoshida elak...@gmail.com wrote: I would like to set the body to null using xml and would like do something as simple as setBodysimple${null}/simple/setBody I experimented with this idea and added this null-expression to the simple expression builder so that this expression works. But I was not sure if there is already another way to do this without introducing this expression. I know a workaround to set the body to null by using something non-existent (e.g., ${header.ugly}), but that is ugly. So if there is no other way, I would like to add this simple expression to camel. 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
Re: null expression for setting body to null?
Hi Yeah we could add that ${null} function to the simple language. Then we dont introduce a new DSL which likely is overkill for a not so often use-case. On Mon, Nov 18, 2013 at 2:35 PM, Aki Yoshida elak...@gmail.com wrote: One use case is for a request-response scenario using a jaxws provider (at camel-cosnumer) and when you want to return a null to this endpoint so that it can return an HTTP 202 response to the caller instead of returning some xml data which was in the body (i.e., using the rule described in jaws spec) Jaxws spec 5.1.1 Invocation A Provider based service instance’s invoke method is called for each message received for the service. When an invoke method returns null, it is considered that no response needs to be sent by service. regards, aki 2013/11/18 Claus Ibsen claus.ib...@gmail.com: What is the use-case for setting the body as null ? On Mon, Nov 18, 2013 at 11:59 AM, Aki Yoshida elak...@gmail.com wrote: I would like to set the body to null using xml and would like do something as simple as setBodysimple${null}/simple/setBody I experimented with this idea and added this null-expression to the simple expression builder so that this expression works. But I was not sure if there is already another way to do this without introducing this expression. I know a workaround to set the body to null by using something non-existent (e.g., ${header.ugly}), but that is ugly. So if there is no other way, I would like to add this simple expression to camel. 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 -- 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
Re: null expression for setting body to null?
hi claus, thanks. regards, aki 2013/11/18 Claus Ibsen claus.ib...@gmail.com: Hi Yeah we could add that ${null} function to the simple language. Then we dont introduce a new DSL which likely is overkill for a not so often use-case. On Mon, Nov 18, 2013 at 2:35 PM, Aki Yoshida elak...@gmail.com wrote: One use case is for a request-response scenario using a jaxws provider (at camel-cosnumer) and when you want to return a null to this endpoint so that it can return an HTTP 202 response to the caller instead of returning some xml data which was in the body (i.e., using the rule described in jaws spec) Jaxws spec 5.1.1 Invocation A Provider based service instance’s invoke method is called for each message received for the service. When an invoke method returns null, it is considered that no response needs to be sent by service. regards, aki 2013/11/18 Claus Ibsen claus.ib...@gmail.com: What is the use-case for setting the body as null ? On Mon, Nov 18, 2013 at 11:59 AM, Aki Yoshida elak...@gmail.com wrote: I would like to set the body to null using xml and would like do something as simple as setBodysimple${null}/simple/setBody I experimented with this idea and added this null-expression to the simple expression builder so that this expression works. But I was not sure if there is already another way to do this without introducing this expression. I know a workaround to set the body to null by using something non-existent (e.g., ${header.ugly}), but that is ugly. So if there is no other way, I would like to add this simple expression to camel. 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 -- 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
CXF route in blueprint with policy and sts
Hi there I've created a simple route in blueprint from cxf endpoint to another cxf endpoint. When I deploy this in Karaf the bundle stays in GracePeriod and the following exception is logged: 2013-11-18 16:06:36,556 | INFO | Thread-842 | BlueprintContainerImpl | container.BlueprintContainerImpl 303 | 7 - org.apache.aries.blueprint.core - 1.1.0 | Bundle route1 is waiting for namespace handlers [http://cxf.apache.org/blueprint/policy] This is a snippet of my blueprint definition: blueprint xmlns=http://www.osgi.org/xmlns/blueprint/v1.0.0; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:p=http://cxf.apache.org/blueprint/policy; xmlns:wsp=http://www.w3.org/ns/ws-policy; xmlns:cxfcamel=http://camel.apache.org/schema/blueprint/cxf; xmlns:cxf=http://cxf.apache.org/blueprint/core; xsi:schemaLocation= http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd http://cxf.apache.org/blueprint/policy http://cxf.apache.org/schemas/blueprint/policy.xsd http://www.w3.org/ns/ws-policy http://www.w3.org/2007/02/ws-policy.xsd http://cxf.apache.org/blueprint/core http://cxf.apache.org/schemas/blueprint/core.xsd http://camel.apache.org/schema/blueprint/cxf http://camel.apache.org/schema/cxf/camel-cxf-2.12.0-blueprint.xsd http://camel.apache.org/schema/blueprint http://camel.apache.org/schema/blueprint/camel-blueprint.xsd; cxf:bus cxf:features cxf:logging / /cxf:features /cxf:bus cxfcamel:cxfEndpoint id=proxyCRMEndpoint wsdlURL=wsdl/CRMServiceProxy.wsdl xmlns:ns=http://services.talend.org/CRMService; endpointName=ns:CRMServicePortProxy serviceName=ns:CRMServiceProviderProxy cxfcamel:features p:policies wsp:PolicyReference URI=classpath:/ut.policy / /p:policies /cxfcamel:features cxfcamel:properties entry key=schema-validation-enabled value=false / entry key=ws-security.ut.validator value=org.apache.cxf.ws.security.trust.STSTokenValidator / entry key=ws-security.sts.client bean class=org.apache.cxf.ws.security.trust.STSClient argument ref=cxf/ property name=wsdlLocation value=http://localhost:8040/services/SecurityTokenService/UT?wsdl/ property name=serviceName value={http://docs.oasis-open.org/ws-sx/ws-trust/200512/}SecurityTokenService/ property name=endpointName value={http://docs.oasis-open.org/ws-sx/ws-trust/200512/}UT_Port/ property name=tokenType value=http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV2.0/ /bean /entry /cxfcamel:properties /cxfcamel:cxfEndpoint I've found several namespace for cxf schemas. In CXF there is one for spring, one for blueprint, for some there is a counterpart in camel and as well one for camel blueprint. This is a little bit confusing. For CXF there are several schemas in Camel: http://camel.apache.org/schema/blueprint/cxf/camel-cxf.xsd http://camel.apache.org/schema/cxf/camel-cxf.xsd http://camel.apache.org/schema/cxf/camel-cxf-2.12.0-blueprint.xsd Which is the right one to use and which do I have to use for policy to resolve the issue with the namespace handler? Thanks a lot Oli
Re: Import xml fragments of camel routes?
Claus, Bummer, ok thank you. Also, thank you for the comment about lack of onexception handling. That is an important limitation (for me) that I didn't catch in the documentation. I'd like to recommend adding it (and any other limitations on routeContext) - perhaps here: http://camel.apache.org/how-do-i-import-routes-from-other-xml-files.html Thank you again. -J -- View this message in context: http://camel.465427.n5.nabble.com/Import-xml-fragments-of-camel-routes-tp5743369p5743446.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: RouteBuilder from exposing as a ChoiceDefinition rather than a RouteDefinition
finally figured it out. first, because a ChoiceDefinition will compile just fine, but throw an exception at runtime, set the from to a local RouteDefinition variable - this way, the editor/compiler will complain. (note: the cast is needed because when you use .end() or .filter() it returns a ProcessorDefinition or Capture - both of which *can* be cast to a RouteDefinition) a couple of rules I found about .choice: 1) only use .endChoice() after a .multicast() (or other complex pattern) that is within a .when() or at the end of an .otherwise(). 2) use .end() at the final end of the .choice() here is my final complicated example from the original question that works: Thank you Claus for ultimately pointing me in the right direction!!! -- View this message in context: http://camel.465427.n5.nabble.com/RouteBuilder-from-exposing-as-a-ChoiceDefinition-rather-than-a-RouteDefinition-tp5743309p5743447.html Sent from the Camel - Users mailing list archive at Nabble.com.
Memory issue while using the spliter EIP
Hi, I have a memory issue with the splitter. I have a big table with millions of records in a sql server database 2008. What I'm trying to do is : setBody simpleselect * from myBigTable/simple /setBody to uri=jdbc:myDataSource / split streaming=true stopOnException=true simple${body}/simple log message=Split line : ${body} / /split I'm getting an out of memory issue. I tried to use the property statement.fetchSize=10amp;statement.fetchDirection=1000 in the DataSource Bean configuration. However it's still not working. It seems that the fetchsize is not set by the apache jdbc component. Best Wishest! Cyrille Eloundou Barclays-Global Technology Java Solution architect work:201 499 2921 cell: 646 522 1567 cell private: 347 978 5022 ___ This message is for information purposes only, it is not a recommendation, advice, offer or solicitation to buy or sell a product or service nor an official confirmation of any transaction. It is directed at persons who are professionals and is not intended for retail customer use. Intended for recipient only. This message is subject to the terms at: www.barclays.com/emaildisclaimer. For important disclosures, please see: www.barclays.com/salesandtradingdisclaimer regarding market commentary from Barclays Sales and/or Trading, who are active market participants; and in respect of Barclays Research, including disclosures relating to specific issuers, please see http://publicresearch.barclays.com. ___
Re: Memory issue while using the spliter EIP
Hi I am not sure but maybe the fetchXXX options is only hints to the JDBC driver. As it may return the full data instead. So if you have millions of rows in the database table you get them all. You may write some SQL that is SQL server specific to tell it to only return first X rows. Each RDBMS usually have some custom SQL for that. Oracle has rownum etc. On Mon, Nov 18, 2013 at 5:02 PM, cyrille.eloun...@barclays.com wrote: Hi, I have a memory issue with the splitter. I have a big table with millions of records in a sql server database 2008. What I'm trying to do is : setBody simpleselect * from myBigTable/simple /setBody to uri=jdbc:myDataSource / split streaming=true stopOnException=true simple${body}/simple log message=Split line : ${body} / /split I'm getting an out of memory issue. I tried to use the property statement.fetchSize=10amp;statement.fetchDirection=1000 in the DataSource Bean configuration. However it's still not working. It seems that the fetchsize is not set by the apache jdbc component. Best Wishest! Cyrille Eloundou Barclays-Global Technology Java Solution architect work:201 499 2921 cell: 646 522 1567 cell private: 347 978 5022 ___ This message is for information purposes only, it is not a recommendation, advice, offer or solicitation to buy or sell a product or service nor an official confirmation of any transaction. It is directed at persons who are professionals and is not intended for retail customer use. Intended for recipient only. This message is subject to the terms at: www.barclays.com/emaildisclaimer. For important disclosures, please see: www.barclays.com/salesandtradingdisclaimer regarding market commentary from Barclays Sales and/or Trading, who are active market participants; and in respect of Barclays Research, including disclosures relating to specific issuers, please see http://publicresearch.barclays.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
Re: camel:proxy (CamelProxyFactoryBean) and CamelBeanMethodName
Continue to discover and try new things. I've also determined that my unit test works when the proxy and export beans are in different Spring applicationContext(s). So, still not sure why my real-world test fails (when the proxy and export beans are in different web applications). -- View this message in context: http://camel.465427.n5.nabble.com/camel-proxy-CamelProxyFactoryBean-and-CamelBeanMethodName-tp5743359p5743451.html Sent from the Camel - Users mailing list archive at Nabble.com.
RE: Memory issue while using the spliter EIP
Thank you for your help Claus! Apache camel is a wonderful framework. Best Wishest! Cyrille Eloundou Barclays-Global Technology Java Solution architect work:201 499 2921 cell: 646 522 1567 cell private: 347 978 5022 -Original Message- From: Claus Ibsen [mailto:claus.ib...@gmail.com] Sent: Monday, November 18, 2013 11:38 AM To: users@camel.apache.org Subject: Re: Memory issue while using the spliter EIP Hi I am not sure but maybe the fetchXXX options is only hints to the JDBC driver. As it may return the full data instead. So if you have millions of rows in the database table you get them all. You may write some SQL that is SQL server specific to tell it to only return first X rows. Each RDBMS usually have some custom SQL for that. Oracle has rownum etc. On Mon, Nov 18, 2013 at 5:02 PM, cyrille.eloun...@barclays.com wrote: Hi, I have a memory issue with the splitter. I have a big table with millions of records in a sql server database 2008. What I'm trying to do is : setBody simpleselect * from myBigTable/simple /setBody to uri=jdbc:myDataSource / split streaming=true stopOnException=true simple${body}/simple log message=Split line : ${body} / /split I'm getting an out of memory issue. I tried to use the property statement.fetchSize=10amp;statement.fetchDirection=1000 in the DataSource Bean configuration. However it's still not working. It seems that the fetchsize is not set by the apache jdbc component. Best Wishest! Cyrille Eloundou Barclays-Global Technology Java Solution architect work:201 499 2921 cell: 646 522 1567 cell private: 347 978 5022 ___ This message is for information purposes only, it is not a recommendation, advice, offer or solicitation to buy or sell a product or service nor an official confirmation of any transaction. It is directed at persons who are professionals and is not intended for retail customer use. Intended for recipient only. This message is subject to the terms at: www.barclays.com/emaildisclaimer. For important disclosures, please see: www.barclays.com/salesandtradingdisclaimer regarding market commentary from Barclays Sales and/or Trading, who are active market participants; and in respect of Barclays Research, including disclosures relating to specific issuers, please see http://publicresearch.barclays.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 ___ This message is for information purposes only, it is not a recommendation, advice, offer or solicitation to buy or sell a product or service nor an official confirmation of any transaction. It is directed at persons who are professionals and is not intended for retail customer use. Intended for recipient only. This message is subject to the terms at: www.barclays.com/emaildisclaimer. For important disclosures, please see: www.barclays.com/salesandtradingdisclaimer regarding market commentary from Barclays Sales and/or Trading, who are active market participants; and in respect of Barclays Research, including disclosures relating to specific issuers, please see http://publicresearch.barclays.com. ___
Re: Exposing a Remote Web Service written in Axis2
Hi, Thanks a lot. it worked. Can I apply Content Based Routing rules if I use jetty for proxy ? -- View this message in context: http://camel.465427.n5.nabble.com/Exposing-a-Remote-Web-Service-written-in-Axis2-tp5743186p5743454.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Help with properites resolution
Any pointers on this issue Piyush -- View this message in context: http://camel.465427.n5.nabble.com/Help-with-properites-resolution-tp5743374p5743452.html Sent from the Camel - Users mailing list archive at Nabble.com.
hawtio camel route layout/UI question.
We use spring DSL for our camel route definitions. I just integrated hawtio with our dev environment and it is awesome.. As part part of our route definition, we added id attribute to each of our node to give a meaningful business name. However, in the layout diagram, for each node (to's) it shows the uri and not what we defined in the id attribute. But in the left side navigation it shows the actual id attribute value. Can you please help me understand or point us in the direction to show the meaningful names in the camel layout diagram instead of uris e.g. to id=MyBusinessRules uri=drools:node1/theNewRule/ In left side navigation under camel context shows : MyBusinessRules but in the camel layout shows drools:node1/theNewRul. I would like to see MyBusinessRule in the diagram as well.. -- View this message in context: http://camel.465427.n5.nabble.com/hawtio-camel-route-layout-UI-question-tp5743455.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: hawtio camel route layout/UI question.
Perhaps you should send this email to their mailing list: http://hawt.io/community/index.html On Mon, Nov 18, 2013 at 2:22 PM, arparikh21 ashish.par...@cbeyond.net wrote: We use spring DSL for our camel route definitions. I just integrated hawtio with our dev environment and it is awesome.. As part part of our route definition, we added id attribute to each of our node to give a meaningful business name. However, in the layout diagram, for each node (to's) it shows the uri and not what we defined in the id attribute. But in the left side navigation it shows the actual id attribute value. Can you please help me understand or point us in the direction to show the meaningful names in the camel layout diagram instead of uris e.g. to id=MyBusinessRules uri=drools:node1/theNewRule/ In left side navigation under camel context shows : MyBusinessRules but in the camel layout shows drools:node1/theNewRul. I would like to see MyBusinessRule in the diagram as well.. -- View this message in context: http://camel.465427.n5.nabble.com/hawtio-camel-route-layout-UI-question-tp5743455.html Sent from the Camel - Users mailing list archive at Nabble.com.
hawtio camel route layout/UI question.
We use spring DSL for our camel route definitions. I just integrated hawtio with our dev environment and it is awesome.. As part part of our route definition, we added id attribute to each of our node to give a meaningful business name. However, in the layout diagram, for each node (to's) it shows the uri and not what we defined in the id attribute. But in the left side navigation it shows the actual id attribute value. Can you please help me understand or point us in the direction to show the meaningful names in the camel layout diagram instead of uris e.g. to id=MyBusinessRules uri=drools:node1/theNewRule/ In left side navigation under camel context shows : MyBusinessRules but in the camel layout shows drools:node1/theNewRul. I would like to see MyBusinessRule in the diagram as well.. -- View this message in context: http://camel.465427.n5.nabble.com/hawtio-camel-route-layout-UI-question-tp5743457.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: hawtio camel route layout/UI question.
Hi You can reach out to the hawtio community at http://hawt.io/community/index.html The hawtio project loves the github way of communicating. And I think your suggest of being able to see the id in the Camel diagram is a good idea. Maybe allow people to configure this what they prefer to see. the id or the url etc. Fell free to log a github issue with your idea https://github.com/hawtio/hawtio/issues On Mon, Nov 18, 2013 at 8:22 PM, arparikh21 ashish.par...@cbeyond.net wrote: We use spring DSL for our camel route definitions. I just integrated hawtio with our dev environment and it is awesome.. As part part of our route definition, we added id attribute to each of our node to give a meaningful business name. However, in the layout diagram, for each node (to's) it shows the uri and not what we defined in the id attribute. But in the left side navigation it shows the actual id attribute value. Can you please help me understand or point us in the direction to show the meaningful names in the camel layout diagram instead of uris e.g. to id=MyBusinessRules uri=drools:node1/theNewRule/ In left side navigation under camel context shows : MyBusinessRules but in the camel layout shows drools:node1/theNewRul. I would like to see MyBusinessRule in the diagram as well.. -- View this message in context: http://camel.465427.n5.nabble.com/hawtio-camel-route-layout-UI-question-tp5743455.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
Re: Import xml fragments of camel routes?
On Mon, Nov 18, 2013 at 4:31 PM, dunnlow dunn...@yahoo.com wrote: Claus, Bummer, ok thank you. Also, thank you for the comment about lack of onexception handling. That is an important limitation (for me) that I didn't catch in the documentation. I'd like to recommend adding it (and any other limitations on routeContext) - perhaps here: http://camel.apache.org/how-do-i-import-routes-from-other-xml-files.html Thank you again. -J Good idea. I added a info notice on that page. -- View this message in context: http://camel.465427.n5.nabble.com/Import-xml-fragments-of-camel-routes-tp5743369p5743446.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
Re: Camel properties component not being resolved when configuring data source
Willem and Claus Thanks so much for your help. I am updating the post with working code. Kind regards, Joao db.properties datasource.stg.url=jdbc:oracle:thin:... camel-context.xml ... bean id=bridgePropertyPlaceholder class=org.apache.camel.spring.spi.BridgePropertyPlaceholderConfigurer property name=location value=classpath:db.properties/ /bean bean id=auditDataSourceStg class=org.apache.commons.dbcp.BasicDataSource property name=driverClassName value=oracle.jdbc.driver.OracleDriver/ property name=url value=${datasource.stg.url}/ property name=username value=${datasource.stg.username}/ property name=password value=${datasource.stg.password}/ property name=initialSize value=5 / property name=maxActive value=10 / /bean ... MyRouteBuilder.java ... public void configure() { from(fromQueryBuilder) .log([queryyBuilder] url:{{datasource.stg.url}}) Console output 2013-11-16 13:20:15,609 [queryBuilder] INFO route1 - [queryBuilder] url:jdbc:oracle:thin:... Cannot create JDBC driver of class 'oracle.jdbc.driver.OracleDriver' for connect URL jdbc:oracle:thin:... -- View this message in context: http://camel.465427.n5.nabble.com/Camel-properties-component-not-being-resolved-when-configuring-data-source-tp5743375p5743467.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: typesafe endpoint configuration approach
My proposed guess wasn't meant/thought as a replacement for the the string URI configuration of camel. I just thought that it could be a helpful addon especially for Java DSL users. Sure, the endpoint templates would require implementation for each endpoint type because they are different in some aspects. However, referring to the feedback a contribution is not really wanted in this case. -- View this message in context: http://camel.465427.n5.nabble.com/typesafe-endpoint-configuration-approach-tp5743391p5743469.html Sent from the Camel - Users mailing list archive at Nabble.com.
Splitting up XML into 2 XMLs
Hi, I need to split up a XML into 2 XMLs.. Example:parent.xml Route Account number../number /Account Person name../name /Person /Route it needs to split up to 2 xmls like below child1.xml Route Account number.../number /Account child2.xml Route Person../Person /Route Please help me on this and am new to camel...i tried to understand other posts in the forum ,but am confused Thanks in advance!!! -- View this message in context: http://camel.465427.n5.nabble.com/Splitting-up-XML-into-2-XMLs-tp5743468.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Splitting up XML into 2 XMLs
Hi, It not like one split operation, it is more like transformation first, and then splitting the xml base on the Route -- 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 Tuesday, November 19, 2013 at 7:10 AM, cameluser2013 wrote: Hi, I need to split up a XML into 2 XMLs.. Example:parent.xml Route Account number../number /Account Person name../name /Person /Route it needs to split up to 2 xmls like below child1.xml Route Account number.../number /Account child2.xml Route Person../Person /Route Please help me on this and am new to camel...i tried to understand other posts in the forum ,but am confused Thanks in advance!!! -- View this message in context: http://camel.465427.n5.nabble.com/Splitting-up-XML-into-2-XMLs-tp5743468.html Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).
JPA enpoint to CSV enpoint working but only 1 row
Hi all, I have written a route that executes a JPA named query and then marshall's the object into csv... private void configureCsvExportRoute () throws Exception { from(END_POINT_JPA_ITEM_EXPORT) .marshal() .csv() .to(END_POINT_FILE_ITEM_EXPORT); } It works fine however the query picks up about 100 rows but I'm only left with 1 row in the csv. When having a look at the output in the console I can see that the csv is being overwritten for each row. How can I achieve all the rows being created in the csv? Do I have to use an aggregator? If so what would it look like. thanks -- View this message in context: http://camel.465427.n5.nabble.com/JPA-enpoint-to-CSV-enpoint-working-but-only-1-row-tp5743483.html Sent from the Camel - Users mailing list archive at Nabble.com.