Re: Accessing an exchange header value in the Java DSL
On Fri, Apr 29, 2011 at 7:58 AM, Claus Ibsen claus.ib...@gmail.com wrote: 2011/4/28 Magnus Palmér magnus.palmer.w...@gmail.com: Hi, I've spent several hours trying to find out what I suspect to be a trivial thing. I want to access the value of a header on the exchange to allow creation of dynamic URI to my enrich. This is how I set the header: *.setHeader(Exchange.**HTTP_URI, simple( http4://localhost:9984/products/${header.EAN}))* This will override the URI and gives me a dynamic URI when using: *.to(http4://localhost:9984/)* But now I would like to use: *.enrich( dynamic-uri-from-header, **new** SomeAggregationStrategy())* I just can't seem to get how to access the headervalue as a String. Trying for instance with header(Exchange.HTTP_URI). or with converting a simple expression into a string value. What am I missing? Reading the information about the EIP on the website http://camel.apache.org/content-enricher.html There is a red warning box which explains about this. As well as page 72 in the Camel in Action book. Instead of enrich you can use recipient list EIP as it allows you to use a dynamic uri and also aggregate at the same time. BTW: There is a JIRA ticket to improve the Content Enricher EIP to allow to access data from the current Exchange so it can use dynamic URIs and whatnot. But the problem is currently due the PollingConsumer API that dont offer options and thus we need to either adjust this API or come up with some other means. Voting on JIRA tickets you would like to see resolved is a way for the community to help us prioritize the tickets. -- Brgds, Magnus Palmér +46736845680 -- Claus Ibsen - FuseSource Email: cib...@fusesource.com Web: http://fusesource.com CamelOne 2011: http://fusesource.com/camelone2011/ Twitter: davsclaus Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/ -- Claus Ibsen - FuseSource Email: cib...@fusesource.com Web: http://fusesource.com CamelOne 2011: http://fusesource.com/camelone2011/ Twitter: davsclaus Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/
Re: Accessing an exchange header value in the Java DSL
Thanks, didn't think it was related to the enrich itself so missed that. Quite a big red box in the book. recipient list with aggregationstrategy did the trick. I'll have a look at JIRA. 2011/4/29 Claus Ibsen claus.ib...@gmail.com On Fri, Apr 29, 2011 at 7:58 AM, Claus Ibsen claus.ib...@gmail.com wrote: 2011/4/28 Magnus Palmér magnus.palmer.w...@gmail.com: Hi, I've spent several hours trying to find out what I suspect to be a trivial thing. I want to access the value of a header on the exchange to allow creation of dynamic URI to my enrich. This is how I set the header: *.setHeader(Exchange.**HTTP_URI, simple( http4://localhost:9984/products/${header.EAN}))* This will override the URI and gives me a dynamic URI when using: *.to(http4://localhost:9984/)* But now I would like to use: *.enrich( dynamic-uri-from-header, **new** SomeAggregationStrategy())* I just can't seem to get how to access the headervalue as a String. Trying for instance with header(Exchange.HTTP_URI). or with converting a simple expression into a string value. What am I missing? Reading the information about the EIP on the website http://camel.apache.org/content-enricher.html There is a red warning box which explains about this. As well as page 72 in the Camel in Action book. Instead of enrich you can use recipient list EIP as it allows you to use a dynamic uri and also aggregate at the same time. BTW: There is a JIRA ticket to improve the Content Enricher EIP to allow to access data from the current Exchange so it can use dynamic URIs and whatnot. But the problem is currently due the PollingConsumer API that dont offer options and thus we need to either adjust this API or come up with some other means. Voting on JIRA tickets you would like to see resolved is a way for the community to help us prioritize the tickets. -- Brgds, Magnus Palmér +46736845680 -- Claus Ibsen - FuseSource Email: cib...@fusesource.com Web: http://fusesource.com CamelOne 2011: http://fusesource.com/camelone2011/ Twitter: davsclaus Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/ -- Claus Ibsen - FuseSource Email: cib...@fusesource.com Web: http://fusesource.com CamelOne 2011: http://fusesource.com/camelone2011/ Twitter: davsclaus Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/ -- -- Brgds, Magnus Palmér +46736845680
HTTP request
Hello, I like to request some data from a soap service and after receiving the response I like to convert the received data in another route. But I not understand how to use the http component to send a http request to the server. Is this the right way to do that? route id=Webservice autoStartup=true from uri=direct:requestWebservice / setBodyconstant![CDATA[?xml version=1.0 encoding=utf-8? soap:Envelope xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:xsd=http://www.w3.org/2001/XMLSchema; xmlns:soap=http://schemas.xmlsoap.org/soap/envelope/; soap:Body / /soap:Envelope]]/constant/setBody setHeader headerName=Content-Type constanttext/xml;/constant /setHeader setHeader headerName=CamelHttpMethod constantPOST/constant /setHeader to uri=http://myserver.com?authUsername=myuseramp;authPassword=myPasswordamp;authMethod=Basic; / to uri=file://d:/opt/output / /route Regards, Michael
Re: Question about Dynamic Router
On Thu, Apr 28, 2011 at 9:54 AM, Alexandre DUTRA alex...@gmail.com wrote: Sorry, I guess attachments aren't allowed here. Please follow the link below to see the test case and the patch: https://github.com/adutra/camel-dynamic-router The problem is that your logic in the nextStep method is flawed. In the first unit test you do not have any STEP header, so the nextStep method keep returning mock:step1a,mock:step1b in an endless loop. To fix this you must provide a STEP header so that its not null. eg you can have a STEP_0. Also your logic does not allow to advance in the steps. So if you provide STEP_1 then it cannot advanced to STEP_2 as the header is not changed. That's not Camel's fault. The contract states that Camel will keep invoking the nextStep method until null is returned. On Thu, Apr 28, 2011 at 7:36 AM, Claus Ibsen claus.ib...@gmail.com wrote: On Thu, Apr 28, 2011 at 12:58 AM, Alexandre DUTRA alex...@gmail.com wrote: I deeply thank you for the interest you manifested for my question. Unfortunately, your test case does not really correspond to the scenario I had in mind. I have attached a new test case that describes what I've been trying to achieve with a dynamic router - without success so far. I dont see the new test case. As you will see, the tests will fail. To fix them, I suggest you apply the attached patch to org.apache.camel.processor.DynamicRouter. The patch describes the behaviour I was initially expecting (and that I feel some other users were expecting as well), and which differs from the current implementation. Think of it as a state machine that, given a message in a given state, predicts what is the next step the message should go through. Please tell me if it is worth opening a JIRA issue to go further in the discussion. Yes we should open JIRA ticket if we discover a bug etc. Thats allow us to keep track of the changes and why we do these. So if you see a bug open a JIRA and attach your unit test and patch. And remember to grant access to Apache when attaching the files, otherwise we can't accept your patches (its a copyright thing) Alexandre Dutra On Wed, Apr 27, 2011 at 11:22 PM, Claus Ibsen claus.ib...@gmail.com wrote: Hi I just created an unit test http://svn.apache.org/viewvc?rev=1097245view=rev And it works fine. It resembles the situation with the 3 calls - 1st call = 2 endpoints - 2nd call = 1 endpoint - 3rd call = null If you look in the code Camel wraps the result of the invocation in an iterator. That iterator knows to handle if there are multiple endpoints separated by comma current = ObjectHelper.createIterator(routingSlip, uriDelimiter); On Wed, Apr 27, 2011 at 10:32 PM, Claus Ibsen claus.ib...@gmail.com wrote: The intent is that it should stop when a null is retuned. And if it doesn't then its a bug. Please create a JIRA, and if possible attach an unit test which demonstrates the issue. On Wed, Apr 27, 2011 at 8:40 PM, Alexandre DUTRA alex...@gmail.com wrote: Thank you for your reply. All I was saying is that returning null immediately after returning a list of endpoints is redundant; the list of endpoints is self-sufficient and null should only be used in cases where a message arrives, and has absolutely nowhere to go. But let me illustrate the point with a small scenario based on your own example: Instant T1: A message is presented for the first time to the router which decides to send it to A and B. Instant T2: After some time, the same message comes back to the router for further processing, and given the routing slip etc. the router decides to send it to C. Instant T3: After some more time, the message comes back again to the router and it decides the message has gone through all steps and should not be processed anymore. To implement such a scenario with the current dynamic router, the router's rule engine would be called 5 times in total with the following answers: [T1] go to A and B [T1] null [T2] go to C [T2] null [T3] null (=don't go anywhere else, it's finished for good) Although I understand that this way of doing things might be useful in some situations, I was just pointing out that it is rather counter-intuitive, not to mention that it is not fully compliant with the original definition of a dynamic router. People (maybe naively) expect only 3 invocations: [T1] go to A and B [T2] go to C [T3] null My suggestion for the DynamicRoutingSlipIterator class achieves this goal. Alexandre Dutra On Wed, Apr 27, 2011 at 8:01 PM, Claus Ibsen claus.ib...@gmail.com wrote: It keep going back until it gets a null. Regardless if you return a single endpoint or multiple endpoints separated by comma. eg 1st return is a,b eg 2nd return is c eg 3rd return is null To stop you must return null. On Wed, Apr 27, 2011 at 7:25 PM, adutra alex...@gmail.com wrote: According to the documentation, the Dynamic Router should return null
java aop
-- View this message in context: http://camel.465427.n5.nabble.com/java-aop-tp4358108p4358108.html Sent from the Camel - Users mailing list archive at Nabble.com.
camel aop deprecated - what alternative exist
Hi, Since Camel 2.0, the component camel-aop is deprecated. I try to figure out which alternative we have to add a pointcut into a camel route ex : all my camel routes require that we update the status of the message processed into the DB before to publish this message into the queue. To achieve that, we can add manually the bean to be called for that purpose into the camel route but that we would be better if I can define a pointcut before the last processor (in this case the JMS producer) to modify the camel route created at runtime Is the interceptor the way to go ? Regards, Charles -- View this message in context: http://camel.465427.n5.nabble.com/camel-aop-deprecated-what-alternative-exist-tp4358118p4358118.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: error handling on Http POST from ActiveMQ to PHP application
Welcome to the Camel community. The WARN message WARN | Execution of JMS message listener failed, and no ErrorHandler has been set. Is in fact not about the Camel error handler. Its about JMS exception listener you can set on the Activemq/JMS component http://camel.apache.org/jms Yes I think the WARN message could be refined to better reflect this. Its this interface from the JMS spec http://download.oracle.com/javaee/5/api/javax/jms/ExceptionListener.html -Claus Ibsen - FuseSource Email: cib...@fusesource.com Web: http://fusesource.com Twitter: davsclaus Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/-- View this message in context: http://camel.465427.n5.nabble.com/error-handling-on-Http-POST-from-ActiveMQ-to-PHP-application-tp4347185p4358125.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: error handling on Http POST from ActiveMQ to PHP application
What version of ActiveMQ and Camel are you using? -Claus Ibsen - FuseSource Email: cib...@fusesource.com Web: http://fusesource.com Twitter: davsclaus Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/-- View this message in context: http://camel.465427.n5.nabble.com/error-handling-on-Http-POST-from-ActiveMQ-to-PHP-application-tp4347185p4358133.html Sent from the Camel - Users mailing list archive at Nabble.com.
Question on RemoveClassTypeInterceptor in Camel Cxf's Payload mode
I would like to understand the CxfPayload instantiation for the CXF to Camel direction and the purpose of org.apache.camel.component.cxf.interceptors.RemoveClassTypeInterceptor that gets inserted into the CXF interceptor chain by Camel under the payload mode. I think there is potentially some case in which some change is required. As I see, this interceptor removes the type information from the MessagePartInfo object to affect how the payload object is instantiated later, more concretely to enforce the use of DOM that is used in Camel's CxfPayload. This interceptor is inserted after the DocLiteralInInterceptor, which is instantiating the payload object in some form. So for the very first call, it may not necessarily enforce this condition (e.g., when the type is the plain javax.xml.transform.Source, the StaxSource object gets instantiated instead). And this currently leads to a payload transfer error. For the subsequent calls, the DOM based object gets instantiated as the type information is removed in the first call and the payloads get correctly transferred. Initially, I thought I could just move RemoveClassTypeInterceptor in front of DocLiteralInInterceptor so that the type information is removed before the first instantiation takes place. But I noticed that this doesn't work because RemoveClassTypeInterceptor needs the binding operation information which is set by DocLiteralInInterceptor in the exchange context. So, to solve this situation, it seems that we need to modify CxfDefaultBinding to accept the Source in its getPayloadBodyElements method so that the DOM based payload gets created from a non-DOMSource based Source like StaxSource. With this change, I could see the payload gets correctly transferred from CXF to Camel also for the first call. As this problem only occurs when you have the Source based service method (e.g., one extending ProviderSource), I am not sure if this issue is already known or unknown. Or I may be missing something totally. Could someone comment on this? If my description is not clear, I can provide a simple test case to illustrate this issue. Thanks for your advice. Regards, Aki
Re: HTTP request
Hi, You can put the request into the message body instead of using setBody DSL. Here is the code snippet. template.send(direct:requestWebservice, new Processor() { public void process(Exchange exchange) throws Exception { exchange.getIn().setBody(?xml version=\1.0\ encoding=\utf-8\? ); } }); On 4/29/11 3:23 PM, Michael Prieß wrote: Hello, I like to request some data from a soap service and after receiving the response I like to convert the received data in another route. But I not understand how to use the http component to send a http request to the server. Is this the right way to do that? route id=Webservice autoStartup=true from uri=direct:requestWebservice / setBodyconstant![CDATA[?xml version=1.0 encoding=utf-8? soap:Envelope xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:xsd=http://www.w3.org/2001/XMLSchema; xmlns:soap=http://schemas.xmlsoap.org/soap/envelope/; soap:Body / /soap:Envelope]]/constant/setBody setHeader headerName=Content-Type constanttext/xml;/constant /setHeader setHeader headerName=CamelHttpMethod constantPOST/constant /setHeader to uri=http://myserver.com?authUsername=myuseramp;authPassword=myPasswordamp;authMethod=Basic; / to uri=file://d:/opt/output / /route Regards, Michael -- Willem -- FuseSource Web: http://www.fusesource.com Blog:http://willemjiang.blogspot.com (English) http://jnn.javaeye.com (Chinese) Twitter: willemjiang Connect at CamelOne May 24-26 The Open Source Integration Conference http://camelone.com
Re: error handling on Http POST from ActiveMQ to PHP application
Hi I have reproduced the issue with the latest release. And created a ticket to track the bug fix https://issues.apache.org/jira/browse/CAMEL-3913 Thanks for reporting. On Fri, Apr 29, 2011 at 10:09 AM, davsclaus cib_re...@yahoo.dk wrote: What version of ActiveMQ and Camel are you using? -Claus Ibsen - FuseSource Email: cib...@fusesource.com Web: http://fusesource.com Twitter: davsclaus Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/-- View this message in context: http://camel.465427.n5.nabble.com/error-handling-on-Http-POST-from-ActiveMQ-to-PHP-application-tp4347185p4358133.html Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen - FuseSource Email: cib...@fusesource.com Web: http://fusesource.com CamelOne 2011: http://fusesource.com/camelone2011/ Twitter: davsclaus Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/
Re: error handling on Http POST from ActiveMQ to PHP application
Hi The workaround is to add, just before the end of the route setExchangePattern pattern=InOnly/ eg to uri=http://localhost/mail/index/receive/ setExchangePattern pattern=InOnly/ /route On Fri, Apr 29, 2011 at 10:59 AM, Claus Ibsen claus.ib...@gmail.com wrote: Hi I have reproduced the issue with the latest release. And created a ticket to track the bug fix https://issues.apache.org/jira/browse/CAMEL-3913 Thanks for reporting. On Fri, Apr 29, 2011 at 10:09 AM, davsclaus cib_re...@yahoo.dk wrote: What version of ActiveMQ and Camel are you using? -Claus Ibsen - FuseSource Email: cib...@fusesource.com Web: http://fusesource.com Twitter: davsclaus Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/-- View this message in context: http://camel.465427.n5.nabble.com/error-handling-on-Http-POST-from-ActiveMQ-to-PHP-application-tp4347185p4358133.html Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen - FuseSource Email: cib...@fusesource.com Web: http://fusesource.com CamelOne 2011: http://fusesource.com/camelone2011/ Twitter: davsclaus Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/ -- Claus Ibsen - FuseSource Email: cib...@fusesource.com Web: http://fusesource.com CamelOne 2011: http://fusesource.com/camelone2011/ Twitter: davsclaus Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/
Re: HTTP request
I would even propose to use: template = camelContext.createProducerTemplate(); template.sendBody(direct:requestWebservice, ?xml version=\1.0\ encoding=\utf-8\? ); Christian Am 29.04.2011 10:38, schrieb Willem Jiang: Hi, You can put the request into the message body instead of using setBody DSL. Here is the code snippet. template.send(direct:requestWebservice, new Processor() { public void process(Exchange exchange) throws Exception { exchange.getIn().setBody(?xml version=\1.0\ encoding=\utf-8\? ); } }); On 4/29/11 3:23 PM, Michael Prieß wrote: Hello, I like to request some data from a soap service and after receiving the response I like to convert the received data in another route. But I not understand how to use the http component to send a http request to the server. Is this the right way to do that? route id=Webservice autoStartup=true from uri=direct:requestWebservice / setBodyconstant![CDATA[?xml version=1.0 encoding=utf-8? soap:Envelope xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:xsd=http://www.w3.org/2001/XMLSchema; xmlns:soap=http://schemas.xmlsoap.org/soap/envelope/; soap:Body / /soap:Envelope]]/constant/setBody setHeader headerName=Content-Type constanttext/xml;/constant /setHeader setHeader headerName=CamelHttpMethod constantPOST/constant /setHeader to uri=http://myserver.com?authUsername=myuseramp;authPassword=myPasswordamp;authMethod=Basic; / to uri=file://d:/opt/output / /route Regards, Michael -- Christian Schneider CXF and Camel Architect SOPERA - The Application Integration Division of Talend http://www.talend.com
Re: Inside Out of OSGI
Hi, A few remarks regrading to your code : 1) JNDI is not supported as such on OSGI platform. You can enable this feature using apache Aries project - jndi but it will not work with Camel. Nevertheless, if you use one of the camel registry provided out of the box and not specificallly jndi, you can create your camelContext and camel will setup the registry according to the container where it is deployed 2) Create camelContext. I suggest that you instantiate your camelContext using a Spring XML file with camelContext. In this case, your camel project is portable between ServiceMix or java standalone using camel:run Regards, Charles-- View this message in context: http://camel.465427.n5.nabble.com/Inside-Out-of-OSGI-tp4347446p4358473.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: camel aop deprecated - what alternative exist
On Fri, Apr 29, 2011 at 10:02 AM, Charles Moulliard cmoulli...@gmail.com wrote: Hi, Since Camel 2.0, the component camel-aop is deprecated. I try to figure out which alternative we have to add a pointcut into a camel route ex : all my camel routes require that we update the status of the message processed into the DB before to publish this message into the queue. To achieve that, we can add manually the bean to be called for that purpose into the camel route but that we would be better if I can define a pointcut before the last processor (in this case the JMS producer) to modify the camel route created at runtime Is the interceptor the way to go ? Yeah you can use an interceptors for that. And you can limit based on endpoint uri, so the interceptor only triggers for JMS endpoints etc. Or whatever. Regards, Charles -- View this message in context: http://camel.465427.n5.nabble.com/camel-aop-deprecated-what-alternative-exist-tp4358118p4358118.html Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen - FuseSource Email: cib...@fusesource.com Web: http://fusesource.com CamelOne 2011: http://fusesource.com/camelone2011/ Twitter: davsclaus Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/
Re: error handling on Http POST from ActiveMQ to PHP application
davsclaus wrote: Welcome to the Camel community. The WARN message WARN | Execution of JMS message listener failed, and no ErrorHandler has been set. Is in fact not about the Camel error handler. Its about JMS exception listener you can set on the Activemq/JMS component http://camel.apache.org/jms Yes I think the WARN message could be refined to better reflect this. Its this interface from the JMS spec http://download.oracle.com/javaee/5/api/javax/jms/ExceptionListener.html I'm a bit confused through your response... I think the warning: Execution of JMS message listener failed, and no ErrorHandler has been set. has nothing to do with the ExceptionListener of the standard JMS-API but with the spring's own proprietary abstraction org.springframework.util.Errorhandler. This warning comes through AbstractMessageListenerContainer.invokeErrorHandler() method invocation while consuming the jms messages. Question: what about org.apache.camel.component.jms.JmsMessageListenerContainer setting such a Errorhandler on it's own (a default one), or that org.apache.camel.component.jms.JmsConfiguration would expose a setter/getter API, so that we (camel-users) can inject a Errorhandler from outside while working with the jms endpoints. Note: Spring provides already 3 implementations of the Errorhandler interface (LoggingErrorHandler, PropagatingErrorHandler and MessagePublishingErrorHandler)-- View this message in context: http://camel.465427.n5.nabble.com/error-handling-on-Http-POST-from-ActiveMQ-to-PHP-application-tp4347185p4358624.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Inside Out of OSGI
Charles, thanks for you reply. I do have a few follow up questions: Since JNDI is not available in Camel OSGI, I am starting to think I am heading in the wrong direction. I want to be able to determine which queues go to which class/function at runtime. Can that be done anymore? If I gave you a class, function name queue, how should I configure that at runtime? Thanks, Steve -- View this message in context: http://camel.465427.n5.nabble.com/Inside-Out-of-OSGI-tp4347446p4358674.html Sent from the Camel - Users mailing list archive at Nabble.com.
WS-Notification
I have a web service that will send out notifications when a specific event occurs. Does camel have the ability to accept and process WS-Notification messages? Thanks
Re: Question on RemoveClassTypeInterceptor in Camel Cxf's Payload mode
Hi, I noticed that CxfConsumerProviderTest did something similar to what I am doing, but it strangely did not encounter this issue. Then, I noticed that this test case was implicitly using the POJO mode and not the PAYLOAD mode. When I added the dataFormat parameter in the endpoint URL (i.e., adding dataFormat=PAYLOAD), the control went into the payload extraction code for the PAYLOAD mode that I was talking about and this resulted in the described payload extraction issue. I suppose this test case should be using the PAYLOAD mode, no? In that case, we should add the dataFormat=PAYLOAD in the endpoint URL. If no one says otherwise, I can create a jira ticket and attach this change and the suggested patch in CxfDefaultBinding to fix this issue. Regards, Aki 2011/4/29 Aki Yoshida elak...@googlemail.com: I would like to understand the CxfPayload instantiation for the CXF to Camel direction and the purpose of org.apache.camel.component.cxf.interceptors.RemoveClassTypeInterceptor that gets inserted into the CXF interceptor chain by Camel under the payload mode. I think there is potentially some case in which some change is required. As I see, this interceptor removes the type information from the MessagePartInfo object to affect how the payload object is instantiated later, more concretely to enforce the use of DOM that is used in Camel's CxfPayload. This interceptor is inserted after the DocLiteralInInterceptor, which is instantiating the payload object in some form. So for the very first call, it may not necessarily enforce this condition (e.g., when the type is the plain javax.xml.transform.Source, the StaxSource object gets instantiated instead). And this currently leads to a payload transfer error. For the subsequent calls, the DOM based object gets instantiated as the type information is removed in the first call and the payloads get correctly transferred. Initially, I thought I could just move RemoveClassTypeInterceptor in front of DocLiteralInInterceptor so that the type information is removed before the first instantiation takes place. But I noticed that this doesn't work because RemoveClassTypeInterceptor needs the binding operation information which is set by DocLiteralInInterceptor in the exchange context. So, to solve this situation, it seems that we need to modify CxfDefaultBinding to accept the Source in its getPayloadBodyElements method so that the DOM based payload gets created from a non-DOMSource based Source like StaxSource. With this change, I could see the payload gets correctly transferred from CXF to Camel also for the first call. As this problem only occurs when you have the Source based service method (e.g., one extending ProviderSource), I am not sure if this issue is already known or unknown. Or I may be missing something totally. Could someone comment on this? If my description is not clear, I can provide a simple test case to illustrate this issue. Thanks for your advice. Regards, Aki
SMPP How to receive delivery receipt from smsc as producer?
hello, I'm new to camel and smpp, currently I'm working on a project that requires smpp to send and receive sms from an smsc, i'm making a simulation using smsc from logica. i was using camel-smpp as a producer to send messaage to smsc, here is my routing: from(file:data/inbox).process(messageProcessor) .to(smpp://pavel@localhost:6006?password=wpsdenquireLinkTimer=3000transactionTimer=5000systemType=producer).process(deliveryReceiptProcessor) it will consume file from data/inbox folder, parse it's content (with the first processor) and compose as sms and send to smsc. I've succeeded this far, and then i realized that smsc was sending delivery receipt a few moment after sending submit_sm_resp (which contain messageId assigned by smsc), there's some information i need from this delivery receipt like message status and delivered time. so i was using the second processor to process this delivery receipt, but it can't receive it, it only receive submit_sm_resp as i mentioned above, and then I read camel doc that camel automatically bind as transmitter to smsc when set as producer, and so it can only receipve resp from smsc. is there someway to receive that delivery receipt as a producer? i tried to set both producer and consumer, the routing look like this: from(file:data/inbox).process(messageProcessor) .to(smpp://pavel@localhost:6006?password=wpsdenquireLinkTimer=3000transactionTimer=5000systemType=producer) .from(smpp://pavel@localhost:6006?password=wpsdenquireLinkTimer=3000transactionTimer=5000systemType=producer).process(deliveryReceiptProcessor) but it doesn't work, I notice there's two smpp session connected to smsc (as transmitter and another as receiver), when the producer send message, the smsc reply with submit_sm_resp and also sending delivery receipt, but none of those endpoint receive that. am i doing wrong? how i supposed to set the routing? ps:sorry if my english is bad -- View this message in context: http://camel.465427.n5.nabble.com/SMPP-How-to-receive-delivery-receipt-from-smsc-as-producer-tp4359338p4359338.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Question about Dynamic Router
Also your logic does not allow to advance in the steps. So if you provide STEP_1 then it cannot advanced to STEP_2 as the header is not changed. Well, that was by design. I thought it was the application responsibility to increment steps and that the dynamic router should only be a tiny wrapper around a rule engine or state machine or whatever else that predicts the next thing to do, *without* actually doing it. In my test case, it would mean that the endpoints mock:step1a, mock:step1b etc. would receive the message, increment the step, transform it in some meaningful way and then send the message back to the dynamic router: step 0 - dynamic router - mock:step1a+mock:step1b - transform + increment step 1 - dynamic router - mock:step2 etc. etc. But I guess it simply was not designed to work that way. I think I can cope with a custom processor + recipient list instead. Thank you anyway. On Fri, Apr 29, 2011 at 9:41 AM, Claus Ibsen claus.ib...@gmail.com wrote: On Thu, Apr 28, 2011 at 9:54 AM, Alexandre DUTRA alex...@gmail.com wrote: Sorry, I guess attachments aren't allowed here. Please follow the link below to see the test case and the patch: https://github.com/adutra/camel-dynamic-router The problem is that your logic in the nextStep method is flawed. In the first unit test you do not have any STEP header, so the nextStep method keep returning mock:step1a,mock:step1b in an endless loop. To fix this you must provide a STEP header so that its not null. eg you can have a STEP_0. Also your logic does not allow to advance in the steps. So if you provide STEP_1 then it cannot advanced to STEP_2 as the header is not changed. That's not Camel's fault. The contract states that Camel will keep invoking the nextStep method until null is returned. On Thu, Apr 28, 2011 at 7:36 AM, Claus Ibsen claus.ib...@gmail.com wrote: On Thu, Apr 28, 2011 at 12:58 AM, Alexandre DUTRA alex...@gmail.com wrote: I deeply thank you for the interest you manifested for my question. Unfortunately, your test case does not really correspond to the scenario I had in mind. I have attached a new test case that describes what I've been trying to achieve with a dynamic router - without success so far. I dont see the new test case. As you will see, the tests will fail. To fix them, I suggest you apply the attached patch to org.apache.camel.processor.DynamicRouter. The patch describes the behaviour I was initially expecting (and that I feel some other users were expecting as well), and which differs from the current implementation. Think of it as a state machine that, given a message in a given state, predicts what is the next step the message should go through. Please tell me if it is worth opening a JIRA issue to go further in the discussion. Yes we should open JIRA ticket if we discover a bug etc. Thats allow us to keep track of the changes and why we do these. So if you see a bug open a JIRA and attach your unit test and patch. And remember to grant access to Apache when attaching the files, otherwise we can't accept your patches (its a copyright thing) Alexandre Dutra On Wed, Apr 27, 2011 at 11:22 PM, Claus Ibsen claus.ib...@gmail.com wrote: Hi I just created an unit test http://svn.apache.org/viewvc?rev=1097245view=rev And it works fine. It resembles the situation with the 3 calls - 1st call = 2 endpoints - 2nd call = 1 endpoint - 3rd call = null If you look in the code Camel wraps the result of the invocation in an iterator. That iterator knows to handle if there are multiple endpoints separated by comma current = ObjectHelper.createIterator(routingSlip, uriDelimiter); On Wed, Apr 27, 2011 at 10:32 PM, Claus Ibsen claus.ib...@gmail.com wrote: The intent is that it should stop when a null is retuned. And if it doesn't then its a bug. Please create a JIRA, and if possible attach an unit test which demonstrates the issue. On Wed, Apr 27, 2011 at 8:40 PM, Alexandre DUTRA alex...@gmail.com wrote: Thank you for your reply. All I was saying is that returning null immediately after returning a list of endpoints is redundant; the list of endpoints is self-sufficient and null should only be used in cases where a message arrives, and has absolutely nowhere to go. But let me illustrate the point with a small scenario based on your own example: Instant T1: A message is presented for the first time to the router which decides to send it to A and B. Instant T2: After some time, the same message comes back to the router for further processing, and given the routing slip etc. the router decides to send it to C. Instant T3: After some more time, the message comes back again to the router and it decides the message has gone through all steps and should not be processed anymore. To implement such a scenario with the current dynamic router, the router's rule engine would be called 5 times in total with the following answers: [T1] go to A
tcp monitor?
Hi all... Can someone recommend a decent package for tcp activity monitoring? I'm looking to observe the dialog between Camel Mail/Javamail and a POP3 server. Apache TCPMon seems to be too SOAP/Axis oriented. On a side note, should there perhaps be a Resources page for this, localhost-able apps for testing, that sort of thing? Don
Re: Question about Dynamic Router
On Fri, Apr 29, 2011 at 8:45 PM, Alexandre DUTRA alex...@gmail.com wrote: Also your logic does not allow to advance in the steps. So if you provide STEP_1 then it cannot advanced to STEP_2 as the header is not changed. Well, that was by design. I thought it was the application responsibility to increment steps and that the dynamic router should only be a tiny wrapper around a rule engine or state machine or whatever else that predicts the next thing to do, *without* actually doing it. In my test case, it would mean that the endpoints mock:step1a, mock:step1b etc. would receive the message, increment the step, transform it in some meaningful way and then send the message back to the dynamic router: step 0 - dynamic router - mock:step1a+mock:step1b - transform + increment step 1 - dynamic router - mock:step2 etc. etc. If you build a test that does this then it do that, eg that's what the other test does. Although they dont increment a header, they just rely on the SLIP_ENDPOINT header that Camel provides. But I guess it simply was not designed to work that way. It is designed that way. Its your test that is flawed. You need to return null in the dynamic router when you want to terminate. Simple as that. I think I can cope with a custom processor + recipient list instead. Thank you anyway. On Fri, Apr 29, 2011 at 9:41 AM, Claus Ibsen claus.ib...@gmail.com wrote: On Thu, Apr 28, 2011 at 9:54 AM, Alexandre DUTRA alex...@gmail.com wrote: Sorry, I guess attachments aren't allowed here. Please follow the link below to see the test case and the patch: https://github.com/adutra/camel-dynamic-router The problem is that your logic in the nextStep method is flawed. In the first unit test you do not have any STEP header, so the nextStep method keep returning mock:step1a,mock:step1b in an endless loop. To fix this you must provide a STEP header so that its not null. eg you can have a STEP_0. Also your logic does not allow to advance in the steps. So if you provide STEP_1 then it cannot advanced to STEP_2 as the header is not changed. That's not Camel's fault. The contract states that Camel will keep invoking the nextStep method until null is returned. On Thu, Apr 28, 2011 at 7:36 AM, Claus Ibsen claus.ib...@gmail.com wrote: On Thu, Apr 28, 2011 at 12:58 AM, Alexandre DUTRA alex...@gmail.com wrote: I deeply thank you for the interest you manifested for my question. Unfortunately, your test case does not really correspond to the scenario I had in mind. I have attached a new test case that describes what I've been trying to achieve with a dynamic router - without success so far. I dont see the new test case. As you will see, the tests will fail. To fix them, I suggest you apply the attached patch to org.apache.camel.processor.DynamicRouter. The patch describes the behaviour I was initially expecting (and that I feel some other users were expecting as well), and which differs from the current implementation. Think of it as a state machine that, given a message in a given state, predicts what is the next step the message should go through. Please tell me if it is worth opening a JIRA issue to go further in the discussion. Yes we should open JIRA ticket if we discover a bug etc. Thats allow us to keep track of the changes and why we do these. So if you see a bug open a JIRA and attach your unit test and patch. And remember to grant access to Apache when attaching the files, otherwise we can't accept your patches (its a copyright thing) Alexandre Dutra On Wed, Apr 27, 2011 at 11:22 PM, Claus Ibsen claus.ib...@gmail.com wrote: Hi I just created an unit test http://svn.apache.org/viewvc?rev=1097245view=rev And it works fine. It resembles the situation with the 3 calls - 1st call = 2 endpoints - 2nd call = 1 endpoint - 3rd call = null If you look in the code Camel wraps the result of the invocation in an iterator. That iterator knows to handle if there are multiple endpoints separated by comma current = ObjectHelper.createIterator(routingSlip, uriDelimiter); On Wed, Apr 27, 2011 at 10:32 PM, Claus Ibsen claus.ib...@gmail.com wrote: The intent is that it should stop when a null is retuned. And if it doesn't then its a bug. Please create a JIRA, and if possible attach an unit test which demonstrates the issue. On Wed, Apr 27, 2011 at 8:40 PM, Alexandre DUTRA alex...@gmail.com wrote: Thank you for your reply. All I was saying is that returning null immediately after returning a list of endpoints is redundant; the list of endpoints is self-sufficient and null should only be used in cases where a message arrives, and has absolutely nowhere to go. But let me illustrate the point with a small scenario based on your own example: Instant T1: A message is presented for the first time to the router which decides to send it to A and B. Instant T2: After some time, the same message comes back to the
Re: tcp monitor?
http://www.wireshark.org/ wireshark -Ben O'Day IT Consultant -http://benoday.blogspot.com -- View this message in context: http://camel.465427.n5.nabble.com/tcp-monitor-tp4359515p4359644.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: tcp monitor?
Hi Donald, And what about java.net tcpmon? http://java.net/projects/tcpmon/sources/svn/show/trunk/www?rev=69 Works like a charm for me. cheers, Łukasz On 29 April 2011 20:54, Donald Whytock dwhyt...@gmail.com wrote: Hi all... Can someone recommend a decent package for tcp activity monitoring? I'm looking to observe the dialog between Camel Mail/Javamail and a POP3 server. Apache TCPMon seems to be too SOAP/Axis oriented. On a side note, should there perhaps be a Resources page for this, localhost-able apps for testing, that sort of thing? Don
weblogic +apache camel
Hello, I am planning to use camel as routing/process engine within weblogic to orchestrate beans and other logical components Is there best practise/tutorial available how to do it ? I have to do it in app context not web context Any help is much appreciated Thanks
Re: SMPP How to receive delivery receipt from smsc as producer?
Hello viezz! You need a ';' between your 'to()' and 'from()' statement. I also recommend to use different systemType values to differentiate between the producer and consumer (as in the test from the link). This link should be helpful for you [1]. [1] https://svn.apache.org/repos/asf/camel/trunk/components/camel-smpp/src/test/java/org/apache/camel/component/smpp/integration/SmppComponentIntegrationTest.java Cheers, Christian On Fri, Apr 29, 2011 at 7:54 PM, viezz viezz.l...@gmail.com wrote: hello, I'm new to camel and smpp, currently I'm working on a project that requires smpp to send and receive sms from an smsc, i'm making a simulation using smsc from logica. i was using camel-smpp as a producer to send messaage to smsc, here is my routing: from(file:data/inbox).process(messageProcessor) .to(smpp://pavel@localhost :6006?password=wpsdenquireLinkTimer=3000transactionTimer=5000systemType=producer).process(deliveryReceiptProcessor) it will consume file from data/inbox folder, parse it's content (with the first processor) and compose as sms and send to smsc. I've succeeded this far, and then i realized that smsc was sending delivery receipt a few moment after sending submit_sm_resp (which contain messageId assigned by smsc), there's some information i need from this delivery receipt like message status and delivered time. so i was using the second processor to process this delivery receipt, but it can't receive it, it only receive submit_sm_resp as i mentioned above, and then I read camel doc that camel automatically bind as transmitter to smsc when set as producer, and so it can only receipve resp from smsc. is there someway to receive that delivery receipt as a producer? i tried to set both producer and consumer, the routing look like this: from(file:data/inbox).process(messageProcessor) .to(smpp://pavel@localhost :6006?password=wpsdenquireLinkTimer=3000transactionTimer=5000systemType=producer) .from(smpp://pavel@localhost :6006?password=wpsdenquireLinkTimer=3000transactionTimer=5000systemType=producer).process(deliveryReceiptProcessor) but it doesn't work, I notice there's two smpp session connected to smsc (as transmitter and another as receiver), when the producer send message, the smsc reply with submit_sm_resp and also sending delivery receipt, but none of those endpoint receive that. am i doing wrong? how i supposed to set the routing? ps:sorry if my english is bad -- View this message in context: http://camel.465427.n5.nabble.com/SMPP-How-to-receive-delivery-receipt-from-smsc-as-producer-tp4359338p4359338.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: tcp monitor?
Checked out Wireshark...looks sophisticated, but can't monitor localhost. Java.net tcpmon works with localhost. It doesn't interlace the dialog packets, but it does the job. Thanks all... Don On Fri, Apr 29, 2011 at 4:04 PM, Łukasz Budnik lukasz.bud...@gmail.com wrote: Hi Donald, And what about java.net tcpmon? http://java.net/projects/tcpmon/sources/svn/show/trunk/www?rev=69 Works like a charm for me. cheers, Łukasz On 29 April 2011 20:54, Donald Whytock dwhyt...@gmail.com wrote: Hi all... Can someone recommend a decent package for tcp activity monitoring? I'm looking to observe the dialog between Camel Mail/Javamail and a POP3 server. Apache TCPMon seems to be too SOAP/Axis oriented. On a side note, should there perhaps be a Resources page for this, localhost-able apps for testing, that sort of thing? Don
Migration from Spring-DM to Blueprint. How to test?
Hello list! We are planing to migrate from ServiceMix 4.2.0-fuse-02-00 to 4.3.1-fuse-01-09 and from Camel 2.2.0-fuse-02-00 to Camel 2.6.0-fuse-01-09. We also thinking about to migrate from Spring-DM to Blueprint. At present, each of our projects contains three Spring configuration files: - src/main/resources/META-INF/spring/bundle-context.xml - src/main/resources/META-INF/spring/bundle-context-osgi.xml - src/test/resources/META-INF/spring/bundle-context-test.xml bundle-context.xml contains the route definition and all bean definitions. bundle-context-osgi.xml looks up some beans from the OSGI registry (e.g. ActiveMQ connection factory) and the OSGI Config service configuration (osgix:cm-properties). bundle-context-test.xml replaces the bundle-context-osgi.xml in our unit tests and provides plain Spring bean definitions for the services we look up from the OSGI service registry when deployed into ServiceMix. But when we migrate to Blueprint, we depend on OSGI and I'm not sure if it's possible to test our routes in the way we do it at present, using the CamelTestSupport oder CamelSpringTestSupport. I know we also have CamelOSGITestSupport, but it's more complex and less lightweight. Do I miss something? Has anyone a sample test which use Blueprint and not depend on PAX Exam? Thanks in advance, Christian
Possible Memory Leak when JMX is enabled
All: Our production servers are experiencing a fairly severe memory leak - it takes about 12 days to get the dreaded OutOfMemoryExceptions. We use linux (CentOS 5.x) Sun 1.6.0_22 JDK Camel 2.4.0 ActiveMQ 5.3.1 JBoss 4.2.1.GA (I know! It's old.) I've attached two screenprints from the Eclipse Memory Analyzer Tool (MAT). The first, ShortestPath, shows at the bottom the DefaultManagementAgent as part of the problem; while at the top you'll see EDU.oswego.cs.dl.util.concurrent.ConcurrentReaderHashMap$Entry. I'm not sure which is the real culprit. Something else: when I go to the JMX console in JBoss I do not see anything at all related to Camel. No endpoints, nothing! So, naturally I disabled JMX in Camel and the problem appears to have gone away. Before I disabled JMX in Camel (the default/example configurations have this enabled by default) I did nothing with respect to: -Dorg.apache.camel.jmx.usePlatformMBeanServer=True Or, by adding a jmxAgent element inside the camelContext element in Spring configuration: camelContext id=camel xmlns=http://camel.apache.org/schema/spring; jmxAgent id=agent usePlatformMBeanServer=true/ ... /camelContext However, since this is true by default, I'm confused as to why nothing Camel related was showing up in the JMX console. Any thoughts, comments, advice would be welcome. TIA, Mike L. (aka patzerbud)
Re: SMPP How to receive delivery receipt from smsc as producer?
hello Christian, thank you for your reply, but I'm still experiencing the same problem, I don't know if I'm still not quite understand about camel routing, but I've changed my routing after I read the source from you given link. here's my new route: from(file:data/inbox).process(messageProcessor) .to(smpp://pavel@localhost :6006?password=wpsdenquireLinkTimer=3000transactionTimer=5000systemType=producer); from(smpp://pavel@localhost :6006?password=wpsdenquireLinkTimer=3000transactionTimer=5000systemType=consumer).process(deliveryReceiptProcessor) (smsc is running on localhost port 6006) but still I can't receive the delivery receipt from smsc, it can only receipt submit_sm_resp. the second route doesn't receive anything from smsc, first I thought that smsc will send the delivery receipt and my application will receive it from the second route, but it didn't. I can see in the log that it make two different smpp session to smsc, one as producer and another as consumer, but the smsc seems to be sending the delivery receipt to the first smpp session (the producer), because it was the one sending the submit_sm to smsc. from the documentation I read there are some headers from smpp consumer that can can be used to request data from smsc, but i didn't know how to do it since the smpp consumer bind as receiver to smsc, so it can only receive message. -- View this message in context: http://camel.465427.n5.nabble.com/SMPP-How-to-receive-delivery-receipt-from-smsc-as-producer-tp4359338p4360614.html Sent from the Camel - Users mailing list archive at Nabble.com.