Re: restlet usage
And remember we love contributions http://camel.apache.org/contributing.html So if you get some hands on experience with the component and how to use it. Then feel free to provide feedback either here in the forum or signup for edit rights to the wiki pages. On Wed, Jan 21, 2009 at 4:15 PM, nojonojo n0...@yahoo.com wrote: Thanks much - not sure why I didn't notice that. I had been using restlet 1.0.11 instead of 1.1.1. Understood about the documentation. It's better to have something working with sparse documentation than to have it well documented and not working! P.Budzik wrote: nojonojo wrote: I'm possibly interested in working with camel-restlet (2.0, since it doesn't exist before then). First off, is there any documentation besides that on http://camel.apache.org/restlet.html the restlet component page ? I'm having two problems. The first is conceptual - the page that I linked above really doesn't describe how camel integrates with Restlet, it just shows a trivial Hello, world! level example. I can probably figure it out if I can get things working in general, but more documentation there would be helpful. This component is really fresh stuff delivered recently however I'm glad to see folks being interested in it. You're right, the documentation is sparse. I was going to extend that, but as usual there was no time :) I assure you anyway it works in a real project not only for hello world. You can count at least on me and William for working out your problem. Secondly, I can't get a (simpler) Hello world sample to work. At this point, I'm not interested in the authentication part. The following is the class that I'm using: Being new to Camel, I really don't know where to start. Seems that you have some dependency problem. Look at the excerpt from my libs: classpathentry kind=var path=M2_REPO/com/noelios/restlet/com.noelios.restlet/1.1.1/com.noelios.restlet-1.1.1.jar/ classpathentry kind=var path=M2_REPO/com/noelios/restlet/com.noelios.restlet.ext.simple/1.1.1/com.noelios.restlet.ext.simple-1.1.1.jar/ classpathentry kind=var path=M2_REPO/org/restlet/org.restlet/1.1.1/org.restlet-1.1.1.jar/ Do your versions match with that? It looks like the binding class is calling Form.getValuesMap() and the one on the classpath has a different signature. -- View this message in context: http://www.nabble.com/restlet-usage-tp21572086s22882p21585150.html Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: Using Camel without lock-in? swap out ESB later?
On Wed, Jan 21, 2009 at 9:39 PM, hanasaki hanasaki-nab...@hanaden.com wrote: Any way to use Camel and later continue its use but swap out the ESB (servicemix) for another vendor? sonic? tibco? MQ? ActiveMQ? Yes Camel is light weight and designed to be embedded into an existing container, whatever type the container is. Camel can integrate with JMS brokers using standard JMS. It can run inside a J2EE container, web container, OSGi container, etc. etc. You might find a bit of informiton you need at the FAQ http://camel.apache.org/faq.html Thank you. -- View this message in context: http://www.nabble.com/Using-Camel-without-lock-in---swap-out-ESB-later--tp21591743s22882p21591743.html Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: How to expose a CXF WebService as an Endpoint with DSL ?
Hi Maybe part 5 of this tutorial can help you a bit http://camel.apache.org/tutorial-example-reportincident.html Its exposing a POJO webservice in pure Java On Fri, Jan 23, 2009 at 12:43 PM, Guillaume Renault guillaume.rena...@bull.net wrote: Hi list, Thx for the answer Willem. However, i did read the wiki page before, and analysed the example, but finally didn't really found what i was looking for. Here are some questions that i'm still asking :-) : (BTW, i'm using java to configure Camel, and not spring) In the example of CXF, you're using two ways to declare the service. One way is to declare a jxws endpoint. the second way is to use the Busfactory, given an xml configuration file. As i'm not using Spring, i guess that the right way is to use the jaxws endpoint ? however, if so, we need annotations on the serviceClass ... How to expose a simple POJO then ? Is the cxf component configured by default in Camel ? i mean, if i get the component cxf from the context, will it return a CxfComponent or null ? and if i get it, i can create an Endpoint with the right properties, just setting the serviceClass and the URI ... ? When Camel deploys a webservice just knowing the class that contains the service, what's the address of the webservice ? which context does it provides (in the case of a POJO, otherwise annotations are here to set this ...)? Do you have an example of a POJO exposed as a WS somewhere, in JAVA ? Don't hesitate to correct me if i did understand something in a wrong way. As soon as it'll be clear for me, i'll try to provide a very simple example and some doc :) The other things work fine, and it's really easy to set some route. Regards, Guillaume Hi, Please see my comments in the mail. Guillaume Renault wrote: Hi Camel users, I'm a new user, and you may hear from me sometime ;) i'm trying to use CXF as an access point on Camel. some questions are crossing my mind: 1. Is it possible to just have annotated classes (Interface + implementation) and let Camel exposes it as a webservice, without any more information ? is it even possible to give Camel a simple POJO without any annotation ? Yes, Current camel-cxf component can support both annotated classes and POJO without any annotation. camel-cxf will check the SEI (Service Endpoint Interface), if it has the @WebService annotation, camel-cxf will use the JAXWS frontend API to publish the service or create a proxy of the web services, if it hasn't any annotation camel-cxf will use simple front end API to those things. 2. If yes, what is the right procedure ? I'm not using spring, and i'm working in an OSGi environment, as i'm integrating Camel into JOnAS 5.1.X. Please take go through the camel-cxf wiki page[1][2] first. Do i need to first declare a CxfComponent, and then create an Endpoint, and give it the service class ? No, you just need to use a URI to specify the CXF endpoint, the Spring configuration is not required. Do i need to just use the following : Object implementor = new SayHello(); String address = http://cxf.apache.org/transports/jms;; Endpoint endpoint = Endpoint.publish(address, implementor); Or maybe something else ... ? No, you don't need to create the endpoint yourself. camel-cxf component will take care of that. You can find more information in the cxf exmaple[2]. Btw, i'll have to talk with you about Camel on OSGi, i did have to do some extends to make it correctly works ;) , but it will come latter. Please shot if you find anything wrong :) Regards, Guillaume -- Guillaume Renault - BULL Service BULL - Architect of an Open World Email : guillaume.rena...@bull.net Tel : +334 76 29 71 09 Office : B1-295 Web : http://jasmine.ow2.org (\ _ /) (='.'=) ()-() [1]http://camel.apache.org/cxf.html [2]http://camel.apache.org/cxf-example.html Willem -- Guillaume Renault - BULL Service BULL - Architect of an Open World Email : guillaume.rena...@bull.net Tel : +334 76 29 71 09 Office : B1-295 Web : http://jasmine.ow2.org web : http://jonas.ow2.org (\ _ /) (='.'=) ()-() -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: sql component with no parameters
Hi I believe Roman have fixed it. Could you try again? On Fri, Jan 23, 2009 at 5:22 PM, nojonojo n0...@yahoo.com wrote: First of all, I'm using the 2.0 snapshot. The following yields a NullPointerException when I hit http://localhost:8080/users: from(restlet:http://localhost:8080/users?restletMethod=GET;).to( sql:select usertext from user?dataSourceRef=camelDB); The NPE occurs at at org.apache.camel.component.sql.SqlProducer$1.doInPreparedStatement(SqlProducer.java:48) - it's pretty clear that it's trying to bind parameters to a PreparedStatement despite the fact that there aren't any. The hack to get it to work is: from(restlet:http://localhost:8080/users?restletMethod=GET;).setBody( constant()).to( sql:select usertext from user where # 'blahblahblah'?dataSourceRef=camelDB); Thanks. cmoulliard wrote: What do you mean by 'no binding parameters' ? Can you provide an example of what you would like to do and the route please ? nojonojo wrote: From observing behavior and looking at the code of SqlProducer, it doesn't seem like it's possible to use a query with no binding parameters (and thus no body) with the SQL component. Is this true, or is there something that I'm missing? -- View this message in context: http://www.nabble.com/sql-component-with-no-parameters-tp21591819s22882p21627566.html Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: Problem when deploying part 5 of Tutorial-Example-ReportIncident on Tomcat
Hi Willem Jiang is the CXF export and he is celebrating chinese new year at the moment. Thanks for the hints about adding the cxf imports to the -config file. Can you hit the URL for the webservice, and see what happens http://localhost:2/part-five/webservices/incident It could be just the .wsdl not being able to be loaded and displayed. On Tue, Jan 27, 2009 at 1:55 PM, cmoulliard cmoulli...@gmail.com wrote: Hi, Can you provide the tomcat stack trace error generated when the web service has been called please ? Charles O. Baujard wrote: Hi, I'm currently playing with the Tutorial-Example-ReportIncident. I have a problem when I try to deploy the war generated by maven on Tomcat. I managed to make Tomcat start properly after having add the following brbr code lt;import resource=classpath:META-INF/cxf/cxf.xml/gt;br lt;import resource=classpath:META-INF/cxf/cxf-extension-soap.xml/gt;br lt;import resource=classpath:META-INF/cxf/cxf-servlet.xml/gt;brbr /code to the camel-config.xml file. When I access the services url, I got a page listing the web service deployed : !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd;HTMLHEADLINK type=text/css rel=stylesheet href=/part-five/webservices/?stylesheet=1meta http-equiv=content-type content=text/html; charset=UTF-8titleCXF - Service list/title/headbodyAvailable services:br /table cellpadding=1 cellspacing=1 border=1 width=100%trtdReportIncidentEndpointulliReportIncident/li/ul/tdtdEndpoint address: http://localhost:2/part-five/webservices/incidentbr /Wsdl: http://localhost:2/part-five/webservices/incident?wsdl {http://reportincident.example.camel.apache.org}ReportIncidentEndpointService br /Target namespace: http://reportincident.example.camel.apache.org/td/tr/table/body/html but then when I click the url to obtain the wsdl, it fails, the message on the server side being : Can't find the request for http://localhost:2/part-five/webservices/incident's Observer It seems the service is not correctly deployed. Has anybody already tried to deploy this war on Tomcat ? Any pointer to solve this problem ? Cheers, Olivier - Charles Moulliard SOA Architect My Blog : http://cmoulliard.blogspot.com/ http://cmoulliard.blogspot.com/ -- View this message in context: http://www.nabble.com/Problem-when-deploying-part-5-of-Tutorial-Example-ReportIncident-on-Tomcat-tp21586670s22882p21683882.html Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: Few queries about camel
On Tue, Feb 3, 2009 at 12:41 PM, Nivetha Shri nivis...@gmail.com wrote: Hi All Will camel support only xml messages or will it support object messages too? Yes in Camel message payloads can be anything. Exchange.setBody(Object body) Will camel support routing to components on different machines? Yes some of the components can send/receive data over the network. - camel-jms - camel-mina - camel-http - camel-rmi - camel-cxf and many more Can someone provide me the links which explains on these two topics. Any help will be really of great use. Check out the documentation, and see some of the examples and tutorials http://camel.apache.org/tutorials.html http://camel.apache.org/examples.html And maybe the FAQ: http://camel.apache.org/faq.html Thanks and Regards Nivi Shri -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: Sometimes exceptions are not getting handled
On Wed, Feb 4, 2009 at 1:51 PM, Manish K Bafna manish.ba...@headstrong.com wrote: Hi, I have added onException clause in the route. But sometimes it is not getting called. Can't identify the exact scenario in which this block is not getting executed. Any hints or issues around it. Thanks, Manish. Hi In Camel 1.6 the onException strategy for picking up how and when to handle an exception has been much improved. It doesnt really look down the exception tree to find caused by's so that could affect. What is you route? Which onException have you defined? ***The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review,retransmission,dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.*** -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: Write routing condition in xml config file
On Wed, Feb 4, 2009 at 11:39 AM, mta38 mtaraud@orange-ftgroup.com wrote: Hi all, Is someone can say me how to test a header exchange value in a xml config file. For example, if the header TEST exists in my IN message and its value is 10, I want to do the following: route from uri=… choice when In.header.TEST==10 to uri=…/ /when … /choice /route Any help are welcome, See this wiki page: http://camel.apache.org/content-based-router.html The $ notation will get the header. So you should do: xpath$TEST = '10'/xpath Otherwise you can try some of the other languages http://camel.apache.org/languages.html ... that can do = comparison, such as EL. http://camel.apache.org/el.html And the xpath is documented here: http://camel.apache.org/xpath.html Best regards Mta38 -- View this message in context: http://www.nabble.com/Write-routing-condition-in-xml-config-file-tp21828008s22882p21828008.html Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: What jar is ca.uhn.hl7v2.parser.Parser in?
Hi Its a dependency in the camel-hl7 component http://camel.apache.org/hl7.html The .jar is from the HAPI library http://hl7api.sourceforge.net/ If you are using maven it should really be able to auto download those .jars. On Thu, Feb 5, 2009 at 5:22 PM, yesnid ns...@pelco.com wrote: Hello All, I am getting a Class Not found Exception for: ca.uhn.hl7v2.parser.Parser what jar is this in? Thank you, Nick -- View this message in context: http://www.nabble.com/What-jar-is-ca.uhn.hl7v2.parser.Parser-in--tp21855318s22882p21855318.html Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: Mina consuming endpoint with sync - how to override?
Chris I added an unit test to the camel-mina component in trunk. You can see it online from the source link on the camel site. It uses a camel mina producer to start the test, so that is why its a try .. catch in that test with the null body. There is another unit test using plain java socket for starting the test. You can combine these two and you should have what you need with skipping responses for some exchanges. On Thu, Feb 5, 2009 at 8:33 AM, Claus Ibsen claus.ib...@gmail.com wrote: Hi What version of Camel are you using? Does it not help just setting the body to null? The code in trunk will not write anything back, but just close the session. And log a WARN. On Thu, Feb 5, 2009 at 5:17 AM, huntc hu...@mac.com wrote: Hi there, I have a consuming mina: endpoint with sync=true set on it. In my use case I have some messages coming in that require a response, and some that do not. Unfortunately where I do not want to return a message Camel is still expecting that I should and throws an ExchangeTimedOutException. How can I tell Camel that despite stating sync=true, for a given exchange it should not expect a response? I have tried a few things including the invocation of a Processor that closes the Mina session after the InOnly endpoint (exchange.getSession().close()). Here's my route currently: from( mina:tcp://0.0.0.0:11010?codec=ilvCodecFactoryamp;lazySessionCreation=trueamp;sync=true) .choice().when(body().isNotNull()).to( direct:logFingerprintEvent).otherwise() .throwFault( Unknown notification sent by fingerprint reader); from(direct:logFingerprintEvent) .choice() .when(body().isInstanceOf(ControlOKEvent.class)) .to( activemq-sender:queue:...?exchangePattern=InOut) .when(body().isInstanceOf(ControlFailedEvent.class)) .to( activemq-sender:queue:...?exchangePattern=InOnly) .otherwise() .throwFault( Unhandled notification sent by fingerprint reader); Thanks for any help. Kind regards, Christopher -- View this message in context: http://www.nabble.com/Mina-consuming-endpoint-with-sync---how-to-override--tp21845069s22882p21845069.html Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: Routing of SOAP messages from a web service consumer to a web service provider
://localhost:9000/SoapContext/SoapPort; wsdlURL=testutils/hello_world.wsdl serviceClass=org.apache.hello_world_soap_http.Greeter endpointName=s:SoapPort serviceName=s:SOAPService xmlns:s=http://apache.org/hello_world_soap_http; / camelContext id=camel xmlns=http://activemq.apache.org/camel/schema/spring; route from uri=cxf:routerEndpoint / to uri=cxf:serviceEndpoint / /route /camelContext /beans ... I get the following output when running C:\iona\fuse-mediation-router-1.3.0.0\examples\camel-example-springmvn:camel run: ... [pache.camel.spring.Main.main()] Main ERROR Failed: org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 40 in XML document from file [C:\iona\fuse-mediation-router-1.3.0.0\examples\camel-example-spring\target\classes\META-INF\spring\camel-context .xml] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'cxf:cxfEndpoint'. Thank you very much. Best regards, Mirko -- View this message in context: http://www.nabble.com/Routing-of-SOAP-messages-from-a-web-service-consumer-to-a-web-service-provider-tp15136171s22882p21871080.html Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: Classloading leak in camel-jaxb component
Hi Chris I have commtied a quick fix for the is in 1.x. Do you mind trying out by checking out the source and build a camel-jaxb component? Hadrian is working in on closing on a 1.6.0 release and would be great to have this tested in your environment before we cut the 1.6.0 release. On Sat, Feb 7, 2009 at 2:06 AM, Hadrian Zbarcea hzbar...@gmail.com wrote: Christopher, Thanks for catching this and pointing it out. We'll be looking into it and hopefully it will make the upcoming 1.6 release. I assume you are using camel-1.5. Would it be possible to attach a quick test and save us a bit of time? Hadrian On Feb 6, 2009, at 3:09 PM, Christopher Hammack wrote: We recently discovered an issue in the camel-jaxb component which has caused a serious issue in our environment: after several days of uptime, we have millions of classes loaded in the permgen space. We were passing around an object between bean components which was annotated with @XmlRootElement, and even though the types matched between the output of one bean component and the input of the next bean component, the object was being transformed using jaxb (possibly a bug there as well). Anyhow, each time this happens, this piece of code from JaxbConverter executes: protected static JAXBContext createJaxbContext(Object value) throws JAXBException { if (value == null) { throw new IllegalArgumentException(Cannot convert from null value to JAXBSource); } JAXBContext context = JAXBContext.newInstance(value.getClass()); return context; } However, each time when a JAXBContext is created, the JAXB package generates several on the fly classes which are not reused between JAXBContexts. This is documented here: https://jaxb.dev.java.net/issues/show_bug.cgi?id=581 This results, in our case, in millions of classes named XXX_JaxbXducedAccessor_avail and XXX$JaxbAccessorF_YYY being loaded into permgen and never collected. After some period of time, permgen space will fill and the jvm will crash. Creating a JAXBContext in this way is not safe. Also, it's not clear why passing an object between two bean components would invoke a JAXB serialization in the first place. Thanks. -- View this message in context: http://www.nabble.com/Classloading-leak-in-camel-jaxb-component-tp21879801s22882p21879801.html Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: Resequencer based on XML Message header element (MessageId)
Hi Could you paste the stacktrace with the class cast exception? On Wed, Feb 11, 2009 at 5:00 AM, sailaja p spind...@progress.com wrote: Hi, I am also getting the same exception (java.lang.ClassCastException) when I ran the Spring XML with Resquencer Pattern. I had even tried by adding the convertBodyTo tag with type=java.lang.Long as suggested by Martin. But still I am getting the same ClassCastException. Below is the Spring XML File I used. I am using Camel 1.5. beans xmlns=http://www.springframework.org/schema/beans; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation= http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://activemq.apache.org/camel/schema/spring http://activemq.apache.org/camel/schema/spring/camel-spring.xsd;camelContext id=camelroute xmlns=http://activemq.apache.org/camel/schema/spring; route xmlns=http://activemq.apache.org/camel/schema/spring; from uri=file:///D:/TeamCity/workspace/Sampel/EIP/Sender?autoCreate=falseamp;noop=true id=Camel_File_2/ resequencer id=Camel_Resequencer_4 xpath/Sample/test/xpath convertBodyTo type=java.lang.Long/convertBodyTo to uri=file:///D:/TeamCity/workspace/Sampel/EIP id=Camel_File_6/ stream-config timeout=3000 capacity=3/ /resequencer /route /camelContext/beans Am I missing something, please let me know. Please help me in resolving the problem. Regards, Sailaja. rmunjuluri wrote: Hello, I am trying of the Resequencer EIP in camel and sending simple XML messages with in random order. [java] INFO [ActiveMQOnewaySender] Sending (0)- MessageId1/MessageId [java] INFO [ActiveMQOnewaySender] Sending (1)- MessageId6/MessageId [java] INFO [ActiveMQOnewaySender] Sending (2)- MessageId7/MessageId [java] INFO [ActiveMQOnewaySender] Sending (3)- MessageId4/MessageId [java] INFO [ActiveMQOnewaySender] Sending (4)- MessageId8/MessageId [java] INFO [ActiveMQOnewaySender] Sending (5)- MessageId2/MessageId [java] INFO [ActiveMQOnewaySender] Sending (6)- MessageId5/MessageId [java] INFO [ActiveMQOnewaySender] Sending (7)- MessageId0/MessageId [java] INFO [ActiveMQOnewaySender] Sending (8)- MessageId3/MessageId [java] INFO [ActiveMQOnewaySender] Sending (9)- MessageId9/MessageId As per my understanding I should be able to receive the messages at the other end in a resequenced order. the issue I have is I didnt find any samples XPATH expressions I could use to set in the camel route. I came across the jbi.Message based resequence expressions but not for XML messages. Is it possible at all to resequence based on XML message headers flowing in ServiceMix? or didnt I look at the right place for the a sample that does this? thanx -ram -- View this message in context: http://www.nabble.com/Resequencer-based-on-XML-Message-header-element-%28MessageId%29-tp17454593s22882p21947981.html Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: NoBeanAvailableException: No bean available for endpoint
Hi Looks a bit odd. Could you show your spring configuration and the routes as well? What version of Camel are you using? And how do you run it? Is Camel deployed inside some container? On Wed, Feb 11, 2009 at 12:36 PM, selezovikj semir.elezo...@gmail.com wrote: These are the log messages that are missing in the machine where the msgParser bean is not created: org.springframework.beans.factory.support.DefaultListableBeanFactory DEBUG - Creating shared instance of singleton bean 'msgParser' org.springframework.beans.factory.support.DefaultListableBeanFactory DEBUG - Creating instance of bean 'msgParser' org.springframework.beans.factory.support.DefaultListableBeanFactory DEBUG - Eagerly caching bean 'msgParser' to allow for resolving potential circular references org.springframework.beans.factory.support.DefaultListableBeanFactory DEBUG - Finished creating instance of bean 'msgParser' As it seems, an instance of the msgParser bean can not be created. I can not see any error here. Looks like it COULD create a bean. selezovikj wrote: I have an application that routes messages from a jms queue to a bean that handles the message. I ran this application on one machine with the following routing: from uri=jms:queue:LoggingQueue/ to uri=bean:msgParser/ This worked fine. However, when running the same application on another machine, I get the following error: org.apache.camel.component.bean.NoBeanAvailableException: No bean available for endpoint: msgParser LogginQueue is the queue to which messages are sent using the JMSAppender of log4j. What could be the possible reasons for this ? Any firewall issues that might affect this ? -- View this message in context: http://www.nabble.com/NoBeanAvailableException%3A-No-bean-available-for-endpoint-tp21952684s22882p21953053.html Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: content router question
Hi Yeah I think Hadrian is on top of this, he need to email the Nabble guys about the Camel move. On Wed, Feb 11, 2009 at 2:26 PM, Jon Anstey jans...@gmail.com wrote: Hmmm looks like my response to this question didn't make it to the old mail list. I sent to users@camel.apache.org but it looks like nabble is only showing stuff from camel-u...@activemq.apache.org On Mon, Feb 9, 2009 at 1:15 PM, Jon Anstey jans...@gmail.com wrote: Try using a bean expression in a choice route from(direct:start).choice() .when().method(myBean, bodyContainsOne).to(mock:x) .otherwise().to(mock:y); where the bean looks like static class MyBean { public static boolean bodyContainsOne(@Body String messageBody) { return messageBody.indexOf(1) = 0; } } On Mon, Feb 9, 2009 at 1:06 PM, pevgen pev...@km.ru wrote: Hello. How can I create a content router, if I want to analize a string message body. i try to explain my wish by java-like example : String messageBody = test 1; if (messageBody.indexOf(1)=0) then ... messageBody will be sent to an Endpoint1 else ...messageBody will be sent to an Endpoint2. thanks. Evgeny -- View this message in context: http://www.nabble.com/content-router-question-tp21916527s22882p21916527.html Sent from the Camel - Users mailing list archive at Nabble.com. -- Cheers, Jon http://janstey.blogspot.com/ -- Cheers, Jon http://janstey.blogspot.com/ -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: DSL and XPath
in context: http://www.nabble.com/DSL-and-XPath-tp21939519s22882p21986984.html Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: Starting camel from my own class - Camel stops when main method stops
Hi You can use ctrl + break or ctrl + \ on unix to dump the thread list when you app hangs. You can then identify what happens We fixed an issue with the Main app not being able to stop properly, that is fixed in Camel 1.6.0, with a thread waiting for a countdown latch. So try out the 1.6.0 when its released On Fri, Feb 13, 2009 at 5:47 PM, James Strachan james.strac...@gmail.com wrote: This looks like its down to daemon threads (I can never remember whether daemon on or off stops the JVM from terminating :). The easiest way to fix it might be having a loop in your main asking the user to enter 'quit' to terminate the application or something. Either that or just wait forever via an infinite loop... Object lock = new Object(); while (true) { synchronized { try { lock.wait(); } catch (Exception e) { } } } 2009/2/13 selezovikj semir.elezo...@gmail.com: I want to start Camel from my own class called Startup because I want to start other services as well. In the Startup class I do the following: // org.apache.camel.spring.Main Main camelMain = new Main(); camelMain.setApplicationContextUri(../config/jms-routing.xml); try { camelMain.start(); } catch (Exception e) { logger.error(Error starting camel, e); System.exit(-1); } Once the main method exits camel is stopped as well: 2009-02-13 10:40:03,509 [ main] TransportConnector INFO Connector tcp Started 2009-02-13 10:40:03,510 [ main] BrokerService INFO ActiveMQ JMS Message Broker (localhost, ID:semir.2e-systems.com-58933-1234518003268-0:0) started 2009-02-13 10:40:08,824 [ ActiveMQ ShutdownHook] BrokerService INFO ActiveMQ Message Broker (localhost, ID:semir.2e-systems.com-58933-1234518003268-0:0) is shutting down 2009-02-13 10:40:09,512 [ ActiveMQ ShutdownHook] TransportConnector INFO Connector tcp Stopped 2009-02-13 10:40:09,578 [ ActiveMQ ShutdownHook] BrokerService INFO ActiveMQ JMS Message Broker (localhost, ID:semir.2e-systems.com-58933-1234518003268-0:0) stopped If I put a thread sleep before the main method exits for 20 seconds ... then Camel is up on 61617 for around 20 seconds. Am I doing something wrong ? Can anybody help ? -- View this message in context: http://www.nabble.com/Starting-camel-from-my-own-class---Camel-stops-when-main-method-stops-tp21993387s22882p21993387.html Sent from the Camel - Users mailing list archive at Nabble.com. -- James --- http://macstrac.blogspot.com/ Open Source Integration http://fusesource.com/ -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: JavaBean as Splitter
Hi I created a sample at the wiki page: http://cwiki.apache.org/confluence/display/CAMEL/Splitter On Mon, Feb 16, 2009 at 11:23 AM, Claus Ibsen claus.ib...@gmail.com wrote: Hi On Mon, Feb 16, 2009 at 11:11 AM, pevgen pev...@km.ru wrote: Hello. How can I write a class-spliiter ? and how can i use this class in my spring config ? I use camel 1.5 (because it's stable release). Just create a POJO that has a method that returns something the can be iterateable, eg. return each splitted part. Eg a List, Iterator And then you can use the methodCall expression to configure the splitter to know that it should call a method on your POJO You POJO can be defined in spring XML in plain spring bean style. Behind the covers the splitter expects an Expression that it evaluated to get the something that can be iteratable I guess we could use a sample of that on the wiki page: http://camel.apache.org/splitter.html Thanks Evgeny -- View this message in context: http://www.nabble.com/JavaBean-as-Splitter-tp22034573s22882p22034573.html Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: JavaBean as Splitter
Hi On Mon, Feb 16, 2009 at 11:11 AM, pevgen pev...@km.ru wrote: Hello. How can I write a class-spliiter ? and how can i use this class in my spring config ? I use camel 1.5 (because it's stable release). Just create a POJO that has a method that returns something the can be iterateable, eg. return each splitted part. Eg a List, Iterator And then you can use the methodCall expression to configure the splitter to know that it should call a method on your POJO You POJO can be defined in spring XML in plain spring bean style. Behind the covers the splitter expects an Expression that it evaluated to get the something that can be iteratable I guess we could use a sample of that on the wiki page: http://camel.apache.org/splitter.html Thanks Evgeny -- View this message in context: http://www.nabble.com/JavaBean-as-Splitter-tp22034573s22882p22034573.html Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: How to negate a Predicate?
Hi I will add a sample to the predicate wiki page http://camel.apache.org/predicate.html But there is a hikup with the apache server right now, so here is part of the source code for an unit test: import static org.apache.camel.builder.PredicateBuilder.not; ... protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { public void configure() { // START SNIPPET: e1 from(direct:start) .choice() .when(not(header(username).regex(goofy|pluto))).to(mock:people) .otherwise().to(mock:animals) .end(); // END SNIPPET: e1 } }; } On Tue, Feb 17, 2009 at 5:01 AM, Trevv 4...@safe-mail.net wrote: Most of my uses of .when are like the first snippet below, very easy to read. But I have a few uses of .when which need to negate the Predicate, and in those places I'm using code like the second snippet below. It works well, and there are no compiler warnings, but it is NOT easy to read. How should I make this code easier to read? // take the first branch, if the regex DOES match... choice(). when(header(foo). regex(cheese|whey)) // take the first branch, if the regex DOES NOT match... choice(). when(PredicateBuilder. not(Builder. MinaExchangeheader(foo). regex(cheese|whey))) -- View this message in context: http://www.nabble.com/How-to-negate-a-Predicate--tp22049751s22882p22049751.html Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: RMI Component in camel
Hi You can check out the unit test source code http://svn.apache.org/viewvc/camel/trunk/components/camel-rmi/ I guess the rmi wiki page could use an update. http://camel.apache.org/rmi.html If you get it working and feel like it, we would love feedback/countributions on this RMI component http://camel.apache.org/contributing.html Post back the working solution/feedback and I can help update the wiki page. On Tue, Feb 17, 2009 at 11:33 AM, Nivetha Shri nivis...@gmail.com wrote: Hi All Can someone tell me how to use RMI component in Camel? It is given tat we can hit the rmi service as follows.. from(inputEndPoint).to(rmi://localhost:1099/foo) I have bound the service as follows MyImpl obj = new MyImpl (); Naming.rebind(//localhost:1099/foo, obj); Usually, in a normal client we will invoke the rmi service as follows Hello obj = (Hello)Naming.lookup(//localhost:1099/foo); message = obj.myMethod(); i.e., we would get the object from the bindings and then invoke the methods that we do need. How can we achieve the same from camel? Any pointers to articles on this? Any help would be of great use. Thanks and Regards Nivi -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: Interceptor / stop / xml configuration file
Hi You should only use the intercept tag, and then route to whatever you want to do route from uri=direct:a / intercept processRef ref=validateInterceptor/ to uri=mock:test/ stop/ /intercept to uri=direct:b/ /route But you can also route to a POJO and do what you like so you dont have to implement any Camel interfaces. intercept beanRef ref=someSpringBean/ to uri=mock:test/ stop/ /intercept On Tue, Feb 17, 2009 at 11:59 AM, mta38 mtaraud@orange-ftgroup.com wrote: Hi all, I want to use interceptor in my route. But I think I may do something wrong Here is my code route from uri=direct:a / intercept interceptor id=intercept1 ref=validateInterceptor/ to uri=mock:test/ stop/ /intercept to uri=direct:b/ /route … other routes … bean id=validateInterceptor class=com.example.interceptors.CheckMessageValidation/ My class CheckMessageValidation extends DelegateProcessor. The process method only adds a trace in a log file. When I test this route, I state that I have the expected trace in my log file, but all other routes are executed. The System does not stop after sending exchange to Mock endpoint. Can anybody can explain me what is wrong in my route. Best regards, Mta38 -- View this message in context: http://www.nabble.com/Interceptor---stop---xml-configuration-file-tp22054882s22882p22054882.html Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: Redeliver to end of Endpoint/Queue?
Hi On Wed, Feb 18, 2009 at 4:21 AM, efender eric+nab...@fender.net wrote: After thinking about this some more, what I'd really like is to be able to consume a message at some time in the future. If an exception occurs during processing, instead of the processing thread sleeping for the delay period, the message should be re-delivered with something like a consume_time header. Then the message consumer will change its selector every time it polls, something like consume_time System.currentTimeInMillis() Thoughts anyone? Interesting idea. I am thinking that we could re use the Quartz component or eg the timer. Then you could send the Exchange to the quartz component with - The Original Exchange - The Time in the future it should be resend - URI to where to send it to Then you would be able to do something like onException(Exception.class) .handled(true) .to(bean:prepareForFutureRedelivery) .to(quartz://redeliverjob) Then the bean prepareForFutureRedelivery prepares the Exchange by - setting a special header with the future time - setting a special header with the endpoint URI it should be sent to when activated We could of course prepare such a bean/processor out of the box in Camel and have a nice DSL for it. But before hand we need to get the pieces together, we can always polish it later. Maybe we can use the timer instead of quartz or some other new component Any thoughts? -- View this message in context: http://www.nabble.com/Redeliver-to-end-of-Endpoint-Queue--tp22060777s22882p22071417.html Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: ActiveMQ DLQ
Hi You can use the exception clause to catch all exceptions and mark them as handled, and then route it to your file destination. See: http://camel.apache.org/exception-clause.html On Wed, Feb 18, 2009 at 11:53 AM, pevgen pev...@km.ru wrote: Hi. How can i save a message in my special endpoint only, and not save this message in ActiveMQ.DLQ ? my route route errorHandlerRef=deadLetterErrorHandlerNull from uri=activemq:queue:inA/ process ref=exceptionProcessor/ !-- throw new Exception(new Exception) -- to uri=activemq:queue:outA/ /route with bean id=deadLetterErrorHandlerNull class=org.apache.camel.builder.DeadLetterChannelBuilder property name=redeliveryPolicy ref=redeliveryPolicyConfigNull/ property name=defaultDeadLetterEndpointUri value=file://c:/Temp/amqtest/out/log/ /bean bean id=redeliveryPolicyConfigNull class=org.apache.camel.processor.RedeliveryPolicy property name=maximumRedeliveries value=0/ property name=delay value=0/ /bean in this configuration, i get my message (from activemq:queue:inA) and in file://c:/Temp/amqtest/out/log, and in ActiveMQ.DLQ... Thanks, Evgeny -- View this message in context: http://www.nabble.com/ActiveMQ-DLQ-tp22076339s22882p22076339.html Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: Persist messages body between different endpoints ?
On Wed, Feb 18, 2009 at 3:26 PM, cmoulliard cmoulli...@gmail.com wrote: Hi, I would like to know if a persisting (like serialization of messages) exist and can be activated easily between different endpoints ? Let's see what I'm thinking about with an example from(file=).unmarshal().to(bean=A).to(bean=B).to(bean=C).to(activemq:queue:xx) In this routing, the content of a file is unmarshaled and the objects created will go to different endpoints (bean A, B and C) encapsulated in the body of messages. If something occurs during the processing of the messages, then the messages/objects will be lost (e.g. this situation can occur in case of system crash, exception raised during process execution inside a bean) Is there a mechanism that we can use to persist java objects and restore them in case of server crash or exception (like the mechanism that we have in EJB, ...) Use persistence JMS queues. Then its the brokers job to not loose the messages. But you also have it as files and they survive server crashes :) So in your route if there is a crash in the processing in bean B then the original file is still there and when the server restarts it will read the file again. You might have to remove/cleanup some internmediate marker files that Camel leaves when it markes a file as being in progress The file is named .camelLock Regards - Charles Moulliard SOA Architect My Blog : http://cmoulliard.blogspot.com/ http://cmoulliard.blogspot.com/ -- View this message in context: http://www.nabble.com/Persist-messages-body-between-different-endpoints---tp22079859s22882p22079859.html Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: How to close Mina session ?
Hi I dont think you currently can both CLOSE a session and return a response when sync=true. Could you file a JIRA request for this? http://camel.apache.org/support.html We could introduce some special header you can add to the Message so Camel knows that it should close the session when its finished writing the response. On Fri, Feb 20, 2009 at 11:46 AM, Nicolas Bouillon nico...@bouil.org wrote: Hi, I'm new to Apache Camel and Mina. I'm writing a simple tcp sever and i'm facing a problem : i don't know how to close a Mina Endpoint Session. I use Camel 1.5.0 (available at maven official repository) The workflow is : the client send a Logout command, then the server says Bye and the _server_ close the connection. It's like and FTP server does. my route is this way configured : route from ref=myMinaEndpoint / to uri=myProcessor / /route The minaEndPoint URL is mina:tcp://localhost:1802?textline=falsesync=trueminaLogger=falsecodec=myCodec In my processor, i do in the process(Exchange exchange) method : MinaExchange minaExchange = (MinaExchange) exchange; // ... minaExchange.getOut().setBody(myResponse); and the classic request-response works well but if i add at the end if the case of a logout request minaExchange.getSession().close(); the tcp session is closed, but the response (Bye) is not sent. I got an exception on server side : 230583 [AnonymousIoService-11] WARN org.apache.camel.component.mina.MinaConsumer$ReceiveHandler - [/ 192.168.244.87:54868] Unexpected exception from exceptionCaught handler. org.apache.camel.CamelException: org.apache.camel.CamelExchangeException: Could not write body on the exchange: Exchange[Message: com.dclgroup.eurodns.epp.server.eppdatag...@109dc35] at org.apache.camel.component.mina.MinaConsumer$ReceiveHandler.exceptionCaught(MinaConsumer.java:88) at org.apache.mina.common.support.AbstractIoFilterChain$TailFilter.exceptionCaught(AbstractIoFilterChain.java:564) at org.apache.mina.common.support.AbstractIoFilterChain.callNextExceptionCaught(AbstractIoFilterChain.java:345) at org.apache.mina.common.support.AbstractIoFilterChain.access$1000(AbstractIoFilterChain.java:53) at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.exceptionCaught(AbstractIoFilterChain.java:643) at org.apache.mina.common.IoFilterAdapter.exceptionCaught(IoFilterAdapter.java:75) at org.apache.mina.common.support.AbstractIoFilterChain.callNextExceptionCaught(AbstractIoFilterChain.java:345) at org.apache.mina.common.support.AbstractIoFilterChain.access$1000(AbstractIoFilterChain.java:53) at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.exceptionCaught(AbstractIoFilterChain.java:643) at org.apache.mina.filter.executor.ExecutorFilter.processEvent(ExecutorFilter.java:224) at org.apache.mina.filter.executor.ExecutorFilter$ProcessEventsRunnable.run(ExecutorFilter.java:264) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:51) at java.lang.Thread.run(Thread.java:619) Caused by: org.apache.camel.CamelExchangeException: Could not write body on the exchange: Exchange[Message: com.dclgroup.eurodns.epp.server.eppdatag...@109dc35] at org.apache.camel.component.mina.MinaHelper.writeBody(MinaHelper.java:47) at org.apache.camel.component.mina.MinaConsumer$ReceiveHandler.messageReceived(MinaConsumer.java:131) at org.apache.mina.common.support.AbstractIoFilterChain$TailFilter.messageReceived(AbstractIoFilterChain.java:570) at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:299) at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilterChain.java:53) at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceived(AbstractIoFilterChain.java:648) at org.apache.mina.filter.codec.support.SimpleProtocolDecoderOutput.flush(SimpleProtocolDecoderOutput.java:58) at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:180) at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:299) at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilterChain.java:53) at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceived(AbstractIoFilterChain.java:648) at org.apache.mina.filter.executor.ExecutorFilter.processEvent(ExecutorFilter.java:220) ... 5 more Any help would be much appreciated. Best regards, Nicolas. -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: How to close Mina session ?
On Fri, Feb 20, 2009 at 12:13 PM, Nicolas Bouillon nico...@bouil.org wrote: I've created the JIRA issue CAMEL-1362 https://issues.apache.org/activemq/browse/CAMEL-1362 In the meanwhile, do you have any workaround hint ? You can use the Synchronization hooks on the UnitOfWork Then you need to route with a processor where you can add the hook from(mina).process(new Processor() { public void process(Exchange exchange) throws Exception { exchange.getUnitOfWork().addSynchronization(new MyMinaMaybeCloseSession()); } }).to(); And in the MyMinaMaybeCloseSession you have callbacks for onComplete, onFailure. Then you can check in the exchange if the body is that special stop command and then access the mina session and close it. On Fri, Feb 20, 2009 at 11:52, Claus Ibsen claus.ib...@gmail.com wrote: Hi I dont think you currently can both CLOSE a session and return a response when sync=true. Could you file a JIRA request for this? http://camel.apache.org/support.html We could introduce some special header you can add to the Message so Camel knows that it should close the session when its finished writing the response. -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: FileConsumer ERROR,RejectedExecutionException (from file to jms)
://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://activemq.apache.org/camel/schema/spring http://activemq.apache.org/camel/schema/spring/camel-spring.xsd; camelContext id=camel xmlns=http://activemq.apache.org/camel/schema/spring; packageorg.apache.camel.example.spring/package jmxAgent id=agent createConnector=true/ /camelContext bean id=jms class=org.apache.activemq.pool.PooledConnectionFactory destroy-method=stop property name=connectionFactory bean class=org.apache.activemq.ActiveMQConnectionFactory property name=brokerURL value=vm://localhost?broker.persistent=falseamp;broker.useJmx=true/ property name=redeliveryPolicy bean class=org.apache.activemq.RedeliveryPolicy property name=maximumRedeliveries value=0/ /bean /property /bean /property /bean bean id=jmsConfig class=org.apache.camel.component.jms.JmsConfiguration property name=connectionFactory ref=jms/ property name=transactionManager ref=jmsTransactionManager/ property name=transacted value=true/ property name=transactedInOut value=true/ property name=concurrentConsumers value=10/ /bean bean id=jmsTransactionManager class=org.springframework.jms.connection.JmsTransactionManager property name=connectionFactory ref=jms/ /bean bean id=mqseries class=org.apache.camel.component.jms.JmsComponent property name=connectionFactory ref=jms / property name=transacted value=true/ /bean bean id=PROPAGATION_REQUIRED class=org.springframework.transaction.support.TransactionTemplate property name=transactionManager ref=jmsTransactionManager/ /bean bean id=PROPAGATION_NOT_SUPPORTED class=org.springframework.transaction.support.TransactionTemplate property name=transactionManager ref=jmsTransactionManager/ property name=propagationBehaviorName value=PROPAGATION_NOT_SUPPORTED/ /bean bean id=PROPAGATION_REQUIRES_NEW class=org.springframework.transaction.support.TransactionTemplate property name=transactionManager ref=jmsTransactionManager/ property name=propagationBehaviorName value=PROPAGATION_REQUIRES_NEW/ /bean /beans Route: public void configure() { Policy requried = new SpringTransactionPolicy(bean(TransactionTemplate.class, PROPAGATION_REQUIRED)); from(file:src/data).policy(requried). unmarshal().serialization().to(jms:test.MyQueue); from(jms:test.MyQueue).marshal().serialization().to(file://target/test); errorHandler(transactionErrorHandler((SpringTransactionPolicy)requried). // notice that the builder has builder methods for chained configuration delay(1)); } I'm newbe in the Camel.. How to fix this problem? -- View this message in context: http://www.nabble.com/FileConsumer-ERROR%2CRejectedExecutionException-%28from-file-to-jms%29-tp22119097s22882p22119097.html Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: How to close Mina session ?
Ah yeah the UnitOfWork works on the processing of the exchange. So it completes just as MinaConsumer will write the reponse back to the client. I have commited a new feature into the next version in Camel. I am afraid I can not see an easy workaround. You can now set this special header and Camel will close the session afterwards exchange.getOut().setHeader(MinaConsumer.HEADER_CLOSE_SESSION_WHEN_COMPLETE, true); On Fri, Feb 20, 2009 at 1:52 PM, Nicolas Bouillon nico...@bouil.org wrote: Claus, Thanks for the tip. Howerver, it dones't seem to work. I have added the following code at the end of my process method : // add a hook to close the session after the exchange exchange.getUnitOfWork().addSynchronization(new Synchronization() { @Override public void onComplete(Exchange exchange) { MinaExchange minaExchange = (MinaExchange) exchange; System.out.println(Closing session); minaExchange.getSession().close().join(); System.out.println(Session closed); } @Override public void onFailure(Exchange exchange) { } }); But, as i can see as runtime and when debugging step by step in org.apache.camel.component.mina.MinaConsumer, the event onComplete is fired before the write to the the socket. So the problem keep the same. I've tried three ways : adding this to my process. Adding to a processor before mine, and after mine. Each time, the onComplete event is called before the MinaHelper.writeBody(session, body, exchange); Regards. Nicolas. On Fri, Feb 20, 2009 at 12:30, Claus Ibsen claus.ib...@gmail.com wrote: You can use the Synchronization hooks on the UnitOfWork Then you need to route with a processor where you can add the hook from(mina).process(new Processor() { public void process(Exchange exchange) throws Exception { exchange.getUnitOfWork().addSynchronization(new MyMinaMaybeCloseSession()); } }).to(); And in the MyMinaMaybeCloseSession you have callbacks for onComplete, onFailure. Then you can check in the exchange if the body is that special stop command and then access the mina session and close it. -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: Newbie Question #2: Transactional Client
Hi Well you gotta get some TX manager in the mix. Otherwise how would you ensure that the JMS and DB participates in the same transaction? Of couse the Camel JMS consumer will be able to rollback if there is an exception thrown, but that does still not ensure that the JMS and DB are managed in the same TX. So if you are able to store in database, but then sending to the next DB queue fails, then the message will be rolled back to the original JMS queue, but the DB is comitted. So I would advice you to learn a bit on the Spring TX stuff and NOT ROLL OUT YOUR OWN, its. harder than you think. The Spring guys have worked hard on this for many years to get it in that stellar quality it is. On Fri, Feb 20, 2009 at 5:37 PM, Tristan Koen tristan.k...@gmail.com wrote: I think I am starting to get the hang of Camel now. I have, however, run into one more problem that I would like some advice on. I have already read through the Transactional Client documentation page before anyone asks. More on that later :) My scenario is very simple. I have the following (simplified) route: from(jms:queue:A).process(new DBLogger()).process(new DBMessageFilter()).to(jms:queue:B) I receive a message and log its contents to a database. I then pass it through to a filter that extracts very specific bits of information from the message body. Finally, the modified message is added to another queue. The problem I have is that an error (such as a SQLException) could occur in DBMessageFilter(). If such an error occurs, I would want to roll-back the insert performed by DBLogger(). The way I see it, I have one of four options: 1. Use the Spring PlatformTransactionManager I would rather avoid this, because I am not (at all) familiar with the Spring Framework and would rather not code things I can't support properly. 2. Combine DBLogger and DBMessageFilter into a single class I don't want to do this, since I am looking at a general solution that I can use on a number of different routes. 3. Put an intermediate queue between DBLogger() and DBMessageFilter() This would be an enormous waste of resources and could also become very cumbersome as the number of routes grow. 4) Use DelegateProcessors. This is my favoured solution and the one I would like some comment on. Modify my route lo look like: from(jms:queue:A).intercept(new DBLogger()).process(new DBMessageFilter()).to(jms:queue:B) My DBLogger class would look something like this: public class DBLogger extends DelegateProcessor { public void process(Exchange exchange) throws Exception { // Connection conn = // conn.setAutoCommit(false); // Log message content try { processNext(exchange); catch (SQLException ex) { conn.rollback(); throw ex; // for the benefit of the Routemap finally { conn.commit(); } } Is this a valid approach, or does it have some major flaw that I am missing? Otherwise, is there a better (non-spring) way to do this. I recognise that at some point in the not-too-distant future, I am going to have to look at the Spring Framework, but I just don't have the time at present :( -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: How to close Mina session ?
On Fri, Feb 20, 2009 at 5:12 PM, Nicolas Bouillon nico...@bouil.org wrote: Thank you very much for the patch, and for the velocity ! You are welcome. Thanks for reporting. If you can test it that would be great. See download page how to use 1.6.1-SNAPSHOT version. eg = Apache SNAPSHOT maven repo and all that stuff. http://camel.apache.org/download.html Best regards On Fri, Feb 20, 2009 at 16:12, Claus Ibsen claus.ib...@gmail.com wrote: Ah yeah the UnitOfWork works on the processing of the exchange. So it completes just as MinaConsumer will write the reponse back to the client. I have commited a new feature into the next version in Camel. I am afraid I can not see an easy workaround. You can now set this special header and Camel will close the session afterwards exchange.getOut().setHeader(MinaConsumer.HEADER_CLOSE_SESSION_WHEN_COMPLETE, true); On Fri, Feb 20, 2009 at 1:52 PM, Nicolas Bouillon nico...@bouil.org wrote: Claus, Thanks for the tip. Howerver, it dones't seem to work. I have added the following code at the end of my process method : // add a hook to close the session after the exchange exchange.getUnitOfWork().addSynchronization(new Synchronization() { @Override public void onComplete(Exchange exchange) { MinaExchange minaExchange = (MinaExchange) exchange; System.out.println(Closing session); minaExchange.getSession().close().join(); System.out.println(Session closed); } @Override public void onFailure(Exchange exchange) { } }); But, as i can see as runtime and when debugging step by step in org.apache.camel.component.mina.MinaConsumer, the event onComplete is fired before the write to the the socket. So the problem keep the same. I've tried three ways : adding this to my process. Adding to a processor before mine, and after mine. Each time, the onComplete event is called before the MinaHelper.writeBody(session, body, exchange); Regards. Nicolas. On Fri, Feb 20, 2009 at 12:30, Claus Ibsen claus.ib...@gmail.com wrote: You can use the Synchronization hooks on the UnitOfWork Then you need to route with a processor where you can add the hook from(mina).process(new Processor() { public void process(Exchange exchange) throws Exception { exchange.getUnitOfWork().addSynchronization(new MyMinaMaybeCloseSession()); } }).to(); And in the MyMinaMaybeCloseSession you have callbacks for onComplete, onFailure. Then you can check in the exchange if the body is that special stop command and then access the mina session and close it. -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: DeadLetterChannel and DeadLetterChannel(Endpoint)
Hi Sounds odd. Can you show the route you are using and your configuration of the error handler? And what is the endpoint uri for ERROR_QUEUE? On Sat, Feb 21, 2009 at 5:49 PM, avermout averm...@gmail.com wrote: Hello all, I already posted such a problem on Servicemix forum, but I didn't get any response. So perhaps somebody can help me here. I use SMX3.3 and Camel1.4, and I have two different behaviors when I use: errorHandler(deadLetterChannel()) and errorHandler(deadLetterChannel(ERROR_QUEUE)) For example, I use this DSL route from(JBI_ENDPOINT_A).to(JBI_ENDPOINT_B) (In-Only messages) and I send a message to A. B causes an error. With the default deadLetterChannel, it is ok. A sends the message, error is logged, and A receives an error response. However, when I use deadLetterChannel(ERROR_QUEUE), a message is sent to the error queue, error is logged, but A never receives the error message back. Can anyone help me with this? Thanks very much Aymeric -- View this message in context: http://www.nabble.com/DeadLetterChannel-and-DeadLetterChannel%28Endpoint%29-tp22137985s22882p22137985.html Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: How to close Mina session ?
On Tue, Feb 24, 2009 at 8:12 AM, Nicolas Bouillon nico...@bouil.org wrote: Hello, I've checkouted last friday the lastest SVN version of 1.6 branch, and compiled camel-core and camel-mina (i don't success compiling whole camel parts), and installed to my local maven repository. The patch works fine. I will try to work with 1.6.1-SNAPSHOT from the official camel site. I will report if something goes wrong. Hi Thanks for the report. Glad the patch seems to work. Thanks Nicolas. On Fri, Feb 20, 2009 at 18:28, Claus Ibsen claus.ib...@gmail.com wrote: On Fri, Feb 20, 2009 at 5:12 PM, Nicolas Bouillon nico...@bouil.org wrote: Thank you very much for the patch, and for the velocity ! You are welcome. Thanks for reporting. If you can test it that would be great. See download page how to use 1.6.1-SNAPSHOT version. eg = Apache SNAPSHOT maven repo and all that stuff. http://camel.apache.org/download.html -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: Is Mina custom codec overriding text line codec
Hi Yeah there could be a problem as it looks like the mina component holds state. camel-mina has been refactored in 2.0 to be consistent with best practice for components in Camel and should not have this flaw. As a workaround could you try defining a new mina component, eg mina2 that differs from the others. bean id=mina2 class=org.apache.camel.component.mina.MinaComponent/ And then use mina2 as scheme. In Java there is a API on CamelContext to add a component if you are not using spring. Could you try this workaround, then we are sure what the problem is and know how to fix it for the next release. On Tue, Feb 24, 2009 at 8:07 AM, huntc hu...@mac.com wrote: Hi there, I think I may have found a problem: mina:tcp://0.0.0.0:8201?textline=truetextlineDelimiter=WINDOWSsync=falseminaLogger=true If I use the above while having already registered some other Mina endpoints that have their own codec, I think that the text line options become confused. In fact if I set a breakpoint in a previously registered codec then I find that the codec's decoder is invoked when I send stuff to port 8201... I've ran out of time to experiment further with this today. Meanwhile if there are any thoughts on this potential issue then please feel free to air them. %-| Kind regards, Christopher -- View this message in context: http://www.nabble.com/Is-Mina-custom-codec-overriding-text-line-codec-tp22176938p22176938.html Sent from the Camel - Users (activemq) mailing list archive at Nabble.com. -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: Interceptor
Hi You should not use the interceptor tag, only the intercept. For example: camelContext id=camel xmlns=http://camel.apache.org/schema/spring; intercept to uri=mock:middle1/ stop/ /intercept route from uri=direct:start/ to uri=mock:end/ /route /camelContext On Tue, Feb 24, 2009 at 10:33 AM, mta38 mtaraud@orange-ftgroup.com wrote: Hi all, Is somebody already using its own interceptor in a xml spring configuration file? In fact, I want to know if in the following definition of intercept, the stop really stops route execution. Cause for me; all other routes are executed. intercept interceptor id=intercept1 ref=MyInterceptor/ to uri=mock:test/ stop/ /intercept Best regards, Mta38 -- View this message in context: http://www.nabble.com/Interceptor-tp22178768p22178768.html Sent from the Camel - Users (activemq) mailing list archive at Nabble.com. -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: Is Mina custom codec overriding text line codec
Which version are you using? This is the code from the 1.x branch as I see it: protected EndpointMinaExchange createEndpoint(String uri, String remaining, Map parameters) throws Exception { if (LOG.isDebugEnabled()) { LOG.debug(Creating MinaEndpoint from uri: + uri); } setProperties(this, parameters); URI u = new URI(remaining); String protocol = u.getScheme(); // if mistyped uri then protocol can be null if (protocol != null) { if (protocol.equals(tcp)) { return createSocketEndpoint(uri, u, parameters); } else if (protocol.equals(udp) || protocol.equals(mcast) || protocol.equals(multicast)) { return createDatagramEndpoint(uri, u, parameters); } else if (protocol.equals(vm)) { return createVmEndpoint(uri, u); } } // protocol not resolved so error throw new IllegalArgumentException(Unrecognised MINA protocol: + protocol + for uri: + uri); } On Tue, Feb 24, 2009 at 10:39 AM, huntc hu...@mac.com wrote: Having delved into MinaComponent.java, I see that a configuration is copied on the creation of an endpoint i.e. MinaConfiguration config = configuration.copy(); on line 81. This configuration is created on instantiating the mina component (that should be just once right?). I'm guessing that for every Mina endpoint expressed as: from(mina:...)... there's a corresponding Endpoint instance created from that one component. Of course with Mina, one instance of an acceptor can host many socket connections. Perhaps with other transports this is not the case and that copying the configuration makes sense. However with Mina I am not sure that copying the configuration buys you much... perhaps we should instantiate the configuration each time instead of copying. That way, we're not going to carry forward previous configurations that are not applicable. Maybe I have this wrong and apologies if so. 'hope that my investigations help. Kind regards, Christopher -- View this message in context: http://www.nabble.com/Is-Mina-custom-codec-overriding-text-line-codec-tp22176938p22178853.html Sent from the Camel - Users (activemq) mailing list archive at Nabble.com. -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: Camel + ActiveMQ in Tomcat6
Hi Have you tried NOT having camel-core.jar in /lib/ext, but putting all the camel jars in the WEB-INF/lib On Tue, Feb 24, 2009 at 2:34 PM, Markus Wolf markus.w...@nmmn.com wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, I try to deploy a camel context using spring inside Tomcat6 with ActiveMQ. We have the following setup: CATALINA_HOME /lib/ext/activemq.jar /lib/ext/camel-core.jar /webapp/ROOT/WEB-INF/lib/camel-jms.jar /webapp/ROOT/WEB-INF/lib/camel-spring.jar /webapp/ROOT/WEB-INF/lib/spring-and-dependencies.jar When we start our tomcat we get a ClassNotFoundException for the org.apache.camel.component.jms.JmsComponent. And now I'm unsure how to deploy the whole thing 'the right way'. When we put activemq with camel-core into our webapp we have classloader leaks and cannot undeploy our application. When we put camel-jms into the lib/ext folder of tomcat we are forced to place the whole spring and dependencies there also. That seems wrong to me also. Can anyone give me a hint about the deployment? Thanks Markus Wolf - -- NMMN - New Media Markets Networks GmbH Geschäftsführung: Kfm. Michael Schütt Finanzamt HH-Altona UStID DE 812 699 852 HRB 71102 Hamburg HypoVereinsbank - BLZ 200 300 00 - Konto-Nr. 156 29 82 http://www.nmmn.com Tel.: +49 40 284 118 -0 Langbehnstrasse 6 Entwicklung: -720 22761 Hamburg Fax: -999 Rufen Sie uns kostenlos an: http://www.nmmn.com/call/software -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkmj91gACgkQDBHISU1oEKFSYACfUsgx01wj1UcLbQr2trc8m/Gv gVUAn22zloCis2pjVjSlLPz6fBLyqghs =7swM -END PGP SIGNATURE- -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: How to close Mina session ?
On Wed, Feb 25, 2009 at 9:34 AM, Nicolas Bouillon nico...@bouil.org wrote: Hi Claus, Correct me if i'm wrong, but the apache2 snapshot repository doesn't contains any 1.6.1-SNAPSHOT : http://people.apache.org/repo/m2-snapshot-repository/org/apache/camel/camel-mina/ Where can i find it ? I am afraid since Apache was graduated as top level project the publish of -SNAPSHOTS of 1.x stopped. I will ping some other people to see if we can get one of the servers to publish it again. You can build it yourself, see: http://camel.apache.org/building.html Regards Nicolas. On Tue, Feb 24, 2009 at 08:34, Claus Ibsen claus.ib...@gmail.com wrote: On Tue, Feb 24, 2009 at 8:12 AM, Nicolas Bouillon nico...@bouil.org wrote: Hello, I've checkouted last friday the lastest SVN version of 1.6 branch, and compiled camel-core and camel-mina (i don't success compiling whole camel parts), and installed to my local maven repository. The patch works fine. I will try to work with 1.6.1-SNAPSHOT from the official camel site. I will report if something goes wrong. Hi Thanks for the report. Glad the patch seems to work. Thanks Nicolas. On Fri, Feb 20, 2009 at 18:28, Claus Ibsen claus.ib...@gmail.com wrote: On Fri, Feb 20, 2009 at 5:12 PM, Nicolas Bouillon nico...@bouil.org wrote: Thank you very much for the patch, and for the velocity ! You are welcome. Thanks for reporting. If you can test it that would be great. See download page how to use 1.6.1-SNAPSHOT version. eg = Apache SNAPSHOT maven repo and all that stuff. http://camel.apache.org/download.html -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: Setting initial xml content for timer mesages
On Thu, Feb 26, 2009 at 5:31 AM, Hadrian Zbarcea hzbar...@gmail.com wrote: Looks like velocity is the simplest solution for your problem here. Hadrian Yeah I was about to suggest the same, Velocity, Freemarker og that StringTemplate. Can all read a template file and transform it. However you can leave the template 100% as your static XML. The camel-http component allows you to set - http method to use, and you need POST. Will default to POST since you have a body payload - set http headers from the exchange in headers. There is a setHeader XML tag you can use to set the soapaction. On Feb 25, 2009, at 8:46 AM, Claus Ibsen wrote: On Wed, Feb 25, 2009 at 1:09 PM, david_geary david_ge...@lagan.com wrote: I want to use a timer to call a web service so i need to set the xml body of the message. Im using the xml configuration so I know I can do this: route from uri=timer://myTimer?fixedRate=trueamp;period=2000/ setBody simple${in.body} World!/simple /setBody to uri= /route But how can i use this to set xml content? What's the correct syntax for this - or is there a better way to do it? Reading the content from a file would suit also. Hi There are many ways of transforming/translate a message with Camel http://camel.apache.org/message-translator.html How are you gonna call the webserivce? Are you using a webservice framework or what? -- View this message in context: http://www.nabble.com/Setting-initial-xml-content-for-timer-mesages-tp22201587p22201587.html Sent from the Camel - Users (activemq) mailing list archive at Nabble.com. -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: Restlet Component Fault Handling
On Tue, Feb 24, 2009 at 1:21 AM, tfredrich tfredr...@yahoo.com wrote: I'm utilizing the Restlet component (via a Trunk build) and am interested in better understanding error handling behavior via the exchange fault message. BTW, I appreciate your work on this component! Good stuff, indeed. In essence, I'm simply using camel-restlet to expose a JSON RESTful service with CRUD behavior. The route looks something like this: from(restlet:http://localhost:8080/people/person/{userId}?restletMethod=GET;) .intercept(new AuthenticationInterceptor()) .process(new QueryStringProcessor()) .process(new GetPersonProcessor()) .marshal(format) .process(new JsonpProcessor()); Of interest for my question is the GetPersonProcessor, which is responsible for retrieving the person object from a storage repository. When a non-existent userId is requested, the GetPersonProcessor does not return a person object and, instead sets the restlet response header to 404 (not found). After reading the Camel manual, I thought it best to set the 404 along with a fault message on the exchange, but the restlet component doesn't appear to acknowledge the fault and composes its response from the out message. So, unless I misunderstand, I have to set the 404 on the out message header (for the restlet component) and set the body on the fault message (for camel to terminate the pipeline). Now for the question: Is this the way I should be doing things? Or could/should the DefaultRestletBinding utilize the fault message to compose its response, if a fault message exists? Your feedback is much appreciated. Hi William Tam or William Jiang is the people behind the camel-restlet component and will be able to help you. Whats you current status? The fault stuff in Camel is put in Camel because of JBI. In pure camel its not really used as we use Exceptions to indicate failures. So there can be a few rough spots in the some components that does not adhere to fault. And take a look in the source code for restlet. Compare it with camel-http that should honor the fault stuff. You might find a gremlin and can point out the problem so we can fix it faster. Thanks, --Todd -- View this message in context: http://www.nabble.com/Restlet-Component-Fault-Handling-tp22173327p22173327.html Sent from the Camel - Users (activemq) mailing list archive at Nabble.com. -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: NoClassDefFoundError for unrelated classes
On Fri, Feb 27, 2009 at 6:07 AM, skappel skap...@finobra.com wrote: The Timer or Quartz components and DSL as in: from(timer://foo?period=6) appear to generate NoClassDefFoundError and ClassNotFound exceptions for unrelated components, such as Scala, Mina, Http,etc. There are also many warnings with org.apache.camel.util.ResolverUtil addIfMatching. The timers do function, and the exceptions and warnings go away if parameters in the URI are removed. How do you make this Camel happy? Hi At what level do they occur in the log? It should be DEBUG/TRACE. It would help a lot of you provided the stacktraces. What version are you using. And which classes do you have in classpath. And does it only occur at initialization or at every time event? But its odd that they go away with or without parameters? Can you show an example with warnings And an example without warnings. And which classes do you have on the classpath, or what are you maven deps. -- View this message in context: http://www.nabble.com/NoClassDefFoundError-for-unrelated-classes-tp22239685p22239685.html Sent from the Camel - Users (activemq) mailing list archive at Nabble.com. -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: NoClassDefFoundError for unrelated classes
Hi Ah yeah the uber .jar I forgot about that one. Imagine how big your classpath would be if you had to add all the .jars for all components they use :) On Fri, Feb 27, 2009 at 11:21 AM, James Strachan james.strac...@gmail.com wrote: 2009/2/27 skappel skap...@finobra.com: The Timer or Quartz components and DSL as in: from(timer://foo?period=6) appear to generate NoClassDefFoundError and ClassNotFound exceptions for unrelated components, such as Scala, Mina, Http,etc. There are also many warnings with org.apache.camel.util.ResolverUtil addIfMatching. The timers do function, and the exceptions and warnings go away if parameters in the URI are removed. How do you make this Camel happy? BTW you often get warnings when using the big uber apache-camel. If you use the individual modules from maven/ivy such as camel-quartz or camel-mina, they know their exact dependencies so you don't get ClassNotFound exceptions. If you don't use maven or ivy and want to know the dependencies of each module you want to use you can use the generated maven site to view them... http://camel.apache.org/maven/ e.g. http://camel.apache.org/maven/camel-mina/dependencies.html http://camel.apache.org/maven/camel-quartz/dependencies.html Though using your IDE/maven/ivy to resolve them removes all the manual error prone work; particularly as these dependencies typically change version with each release. -- James --- http://macstrac.blogspot.com/ Open Source Integration http://fusesource.com/ -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: Camel-quartz
On Fri, Feb 27, 2009 at 2:48 PM, gmagniez gabriel.magn...@steria.com wrote: Hi, The camel-quartz component replace the character / by , but how can i use the / in the cron expression like from trigering something every five minutes: 0/5? I've found another thread about that problem but it was not resolved. http://www.nabble.com/camel-quartz-cron-trigger-endpoint-uri-syntax-td13923344.html#a13923344 Hi Yeah I can not see the reason for this replacement unless to divide into sub paths, for each individual cron element. Do you mind creating a ticket, then we can fix it so you can use / in the URI. The only one that is reasonable to replace is the ? with $ otherwise, even thought it may still be valid URI using it. http://camel.apache.org/support.html Best regards -- View this message in context: http://www.nabble.com/Camel-quartz-tp22246214p22246214.html Sent from the Camel - Users (activemq) mailing list archive at Nabble.com. -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: Camel Routing based on bean return object
On Fri, Feb 27, 2009 at 5:22 PM, ee7arh andrew.hu...@2e-systems.com wrote: Hi, I'm getting quite into using the Camel DSL router and got quite far but now have this situation: Welcome onboard the ride. I have a bean method (myBeanMethod1()) which returns not a boolean but a real object (MyReturnObj1). This object contains an Enum return code (myReturnCode) and I want to do some routing based on this returncode. e.g. // Bean Method public MyReturnObj1 myBeanMethod1(); The definition of MyReturnObj1 is public class MyReturnObj1 { protected Enum myReturnCode; } I want to do some routing like this: from(jms:queue:queue1).to(bean:myBeanMethod1).choice() .when(myErrorCode=myReturnCode.ERRROR1).to(jms:queue:error1Queue) .when(myErrorCode=myReturnCode.ERROR2).to(jms:queue:error2Queue) .otherwise().to(jms:queue:unknownErrorQueue); Is it possible to somehow do routing based on bean which returns an object? If I set my returnCode into the JMS Header field I could use the header() method to get the values as seen in many examples on Camel website. Yes when you do routing with the content based router EIP pattern, you use the choice/when/otherwise as you do above. when and otherwise uses Predicate to evaluate true|false, if it should route it this way or continue down the other predicates. Camel have build in nice DSL sugar for these predicates, aka predicate builders and others so you can build fluent syntax. You can use a method call predicate to invoke a method on a bean, and then chain the sub predicate isEqualTo. when(method(MyPredicateBean.class, thismethod).isEqualTo(MyEnumConstant)).to(jms:xxx) But this will invoke your bean on each predicate test and if you think this operation is very expensive, then you can do as above to route it to your bean prior the choice and set the result in a header. Then the testing is just based using header(key) instead of the method call predicate. Advice greatly appreciated. Andrew -- View this message in context: http://www.nabble.com/Camel-Routing-based-on-bean-return-object-tp22249110p22249110.html Sent from the Camel - Users (activemq) mailing list archive at Nabble.com. -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: ExchangePattern.InOut ActiveMq exception
Hi Could you create a small sample application that demonstrates this? Will help while investigating. On Fri, Feb 27, 2009 at 12:59 AM, Joe White joe.wh...@recondotech.com wrote: In Camel 1.5 when using the ExchangePattern.InOut I get an exception when tearing down the activemq broker the exception occurs no matter how the thread is stopped. Is there configuration to allow the InOut pattern to work without causing exceptions when the broker is shut-down? The exception received at shutdown is below along with the spring config for the my current activemq setup. Thanks Joe 16:47:00,284 INFO [AdvisoryConsumer] (ActiveMQ Connection Worker: tcp://localhost/127.0.0.1:61616) Failed to send remove command: javax.jms.JMSException: Channel was inactive for too long: localhost/127.0.0.1:61616 javax.jms.JMSException: Channel was inactive for too long: localhost/127.0.0.1:61616 at org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport. java:62) ... org.springframework.jms.listener.AbstractJmsListeningContainer.refreshSh aredConnection(AbstractJmsListeningContainer.java:385) at org.springframework.jms.listener.SimpleMessageListenerContainer.onExcept ion(SimpleMessageListenerContainer.java:206) at org.apache.activemq.ActiveMQConnection$4.run(ActiveMQConnection.java:177 9) ... Caused by: org.apache.activemq.transport.InactivityIOException: Channel was inactive for too long: localhost/127.0.0.1:61616 at org.apache.activemq.transport.InactivityMonitor.oneway(InactivityMonitor .java:225) at org.apache.activemq.transport.TransportFilter.oneway(TransportFilter.jav a:83) at org.apache.activemq.transport.WireFormatNegotiator.oneway(WireFormatNego tiator.java:100) at org.apache.activemq.transport.MutexTransport.oneway(MutexTransport.java: 40) at org.apache.activemq.transport.ResponseCorrelator.oneway(ResponseCorrelat or.java:60) at org.apache.activemq.ActiveMQConnection.doAsyncSendPacket(ActiveMQConnect ion.java:1214) ... 10 more bean id=activemq class=org.apache.camel.component.jms.JmsComponent property name=connectionFactory bean class=org.apache.activemq.spring.ActiveMQConnectionFactory property name=brokerURL value=tcp://localhost:61616?wireFormat.maxInactivityDuration=0 / property name=closeTimeout value=0/ /bean /property /bean broker:broker useJmx=false persistent=false brokerName=localhost broker:transportConnectors broker:transportConnector name=tcp uri=tcp://localhost:61616/ /broker:transportConnectors /broker:broker -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: Camel-quartz
Hi I have created the ticket and is currently improving the quartz component. Yeah its a real bummer with the / as cron separators. I have improved it to be a URI parameter instead, only requiring to use _ as space. eg: quartz://myGroup/myTimerName?cron=0_0/5_12-18_?_*_MON-FRI quartz://myGroup/myTimerName?cron=0_0_*_*_*_? And we can use ? instead of having to use $. So its only _ as spaces. On Fri, Feb 27, 2009 at 3:58 PM, Claus Ibsen claus.ib...@gmail.com wrote: On Fri, Feb 27, 2009 at 2:48 PM, gmagniez gabriel.magn...@steria.com wrote: Hi, The camel-quartz component replace the character / by , but how can i use the / in the cron expression like from trigering something every five minutes: 0/5? I've found another thread about that problem but it was not resolved. http://www.nabble.com/camel-quartz-cron-trigger-endpoint-uri-syntax-td13923344.html#a13923344 Hi Yeah I can not see the reason for this replacement unless to divide into sub paths, for each individual cron element. Do you mind creating a ticket, then we can fix it so you can use / in the URI. The only one that is reasonable to replace is the ? with $ otherwise, even thought it may still be valid URI using it. http://camel.apache.org/support.html Best regards -- View this message in context: http://www.nabble.com/Camel-quartz-tp22246214p22246214.html Sent from the Camel - Users (activemq) mailing list archive at Nabble.com. -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: NoClassDefFoundError for unrelated classes
Hi Thanks for reporting. I created an entry in FAQ http://cwiki.apache.org/confluence/display/CAMEL/Why+do+Camel+throw+so+many+NoClassDefFoundException+on+startup On Fri, Feb 27, 2009 at 11:26 PM, Bob Pollack robert_h_poll...@yahoo.com wrote: Just FYI, this behavior was probably triggered by your query string (?period=6). I have written a long post on this problem, at http://www.nabble.com/More-info-on-class-not-found-exception-tt22086106.html#a22086106, which I can't seem to post to this mailing list. I'll add your workaround (don't use the big jar) to this post. Several people have posted this problem, in various forms. Perhaps the Camel documentation should include a caution about what you can expect to see with the big jar. From: skappel skap...@finobra.com To: camel-u...@activemq.apache.org Sent: Friday, February 27, 2009 12:17:51 PM Subject: Re: NoClassDefFoundError for unrelated classes Solution: do not use the apache-camel jar. Use camel-core and only the jars used in the application. These warning still appear: WARNING: Could not find class 'org/apache/activemq/camel/converter/InvokeJmsMessageListenerTest.class' WARNING: Could not find class 'org/apache/activemq/camel/converter/InvokeMessageListenerTest.class' This is caused by activemq-all-5.1.0.jar. Both classes have a space between Listener and Test, causing a mismatch. skappel wrote: The Timer or Quartz components and DSL as in: from(timer://foo?period=6) appear to generate NoClassDefFoundError and ClassNotFound exceptions for unrelated components, such as Scala, Mina, Http,etc. There are also many warnings with org.apache.camel.util.ResolverUtil addIfMatching. The timers do function, and the exceptions and warnings go away if parameters in the URI are removed. How do you make this Camel happy? -- View this message in context: http://www.nabble.com/NoClassDefFoundError-for-unrelated-classes-tp22239685p22250210.html Sent from the Camel - Users (activemq) mailing list archive at Nabble.com. -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: Camel-quartz
On Sat, Feb 28, 2009 at 5:06 PM, Hadrian Zbarcea hzbar...@gmail.com wrote: I think using '+' for a space is a common convention and better than a '_'. Okay lets support them both, using _ is much easier to read instead of +. Try a complex cron with - and using + as separators is not easy to read. $0.02 Hadrian On Feb 28, 2009, at 10:29 AM, Claus Ibsen wrote: Hi The ticket: https://issues.apache.org/activemq/browse/CAMEL-1407 Implemented in Camel 2.0 On Sat, Feb 28, 2009 at 4:06 PM, Claus Ibsen claus.ib...@gmail.com wrote: Hi I have created the ticket and is currently improving the quartz component. Yeah its a real bummer with the / as cron separators. I have improved it to be a URI parameter instead, only requiring to use _ as space. eg: quartz://myGroup/myTimerName?cron=0_0/5_12-18_?_*_MON-FRI quartz://myGroup/myTimerName?cron=0_0_*_*_*_? And we can use ? instead of having to use $. So its only _ as spaces. On Fri, Feb 27, 2009 at 3:58 PM, Claus Ibsen claus.ib...@gmail.com wrote: On Fri, Feb 27, 2009 at 2:48 PM, gmagniez gabriel.magn...@steria.com wrote: Hi, The camel-quartz component replace the character / by , but how can i use the / in the cron expression like from trigering something every five minutes: 0/5? I've found another thread about that problem but it was not resolved. http://www.nabble.com/camel-quartz-cron-trigger-endpoint-uri-syntax-td13923344.html#a13923344 Hi Yeah I can not see the reason for this replacement unless to divide into sub paths, for each individual cron element. Do you mind creating a ticket, then we can fix it so you can use / in the URI. The only one that is reasonable to replace is the ? with $ otherwise, even thought it may still be valid URI using it. http://camel.apache.org/support.html Best regards -- View this message in context: http://www.nabble.com/Camel-quartz-tp22246214p22246214.html Sent from the Camel - Users (activemq) mailing list archive at Nabble.com. -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: File: using absolute file paths with moveExpressions
On Fri, Feb 27, 2009 at 8:34 PM, Joseph E. Gottman jgott...@proteus-technologies.com wrote: I'm using the Camel 2.0 File component and I'm having trouble with the new moveExpression. I need to move my input file to an absolute directory, but the moveExpression always assumes that I've entered a directory that's relative to my current directory. Is there any way for me to force it to treat my moveExpression as an absolute path? Hi Thanks for reporting. I created a ticket https://issues.apache.org/activemq/browse/CAMEL-1408 And will work on a fix. Joe -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: File: using absolute file paths with moveExpressions
Hi I have fixed it now. Please test it on your system with the latest SNAPSHOT of Camel 2.0. It could takes 4+ hours before its published to the maven repo. On Sat, Feb 28, 2009 at 5:36 PM, Claus Ibsen claus.ib...@gmail.com wrote: On Fri, Feb 27, 2009 at 8:34 PM, Joseph E. Gottman jgott...@proteus-technologies.com wrote: I'm using the Camel 2.0 File component and I'm having trouble with the new moveExpression. I need to move my input file to an absolute directory, but the moveExpression always assumes that I've entered a directory that's relative to my current directory. Is there any way for me to force it to treat my moveExpression as an absolute path? Hi Thanks for reporting. I created a ticket https://issues.apache.org/activemq/browse/CAMEL-1408 And will work on a fix. Joe -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: configuring mail endpoint
On Mon, Mar 2, 2009 at 2:40 PM, siva naresh vssnar...@gmail.com wrote: Hi, we are developing the application for generic endpoints.. and we do not want to to check the instance of the endpoint with the instance of MailEndpoint and set the properties.. Is there a way to enter the property(mail.smtp.starttls.enable=true) via the URI.. in Camel 1.5? or get the property from the spring configuration file. No. You can set it as a JVM system property :) You can configure the endpoint manaually in Spring using the bean id= class= regular spring bean style. This has been enhanced greatly in Camel 2.0 so nearly all endpoints can be created 100% from spring bean style. So I am afraid you are a bit out of luck since you dont want to set it in Java. You can after all just use an instanceof check to see if its a mail endpoint. Claus Ibsen-2 wrote: On Mon, Mar 2, 2009 at 1:30 PM, siva naresh vssnar...@gmail.com wrote: Please see the following code snippet.. Endpoint smtpEndPoint = context .getEndpoint(smtp://usern...@smtp.gmail.com:25?password=password); try { producer = smtpEndPoint .createProducer(); Exchange ex = producer.createExchange(); ex.getIn().setBody(hello); producer.process(ex); } catch (Exception e) { e.printStackTrace(); } throws com.sun.mail.smtp.SMTPSendFailedException: 530 5.7.0 Must issue a STARTTLS command first. 6sm5357658qwd.33 I figured out that I need to set the following property mail.smtp.starttls.enable=true for the above exception. how do I do set the above property using URI or is there any workaround? In Camel 2.0 you just add it as an URI option. In Came 1.x you can not do this. But since you use java code you can case the endpoint to MailEndpoint. And there should be a getter for mail properties or what its named. And there you should be able to add/set properties. MailEndpoint - MailConfiguration - AdditionalJavaMailProperties Or you can add it is a system property and Camel will use it also. -- View this message in context: http://www.nabble.com/configuring-mail-endpoint-tp22287281p22287281.html Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ -- View this message in context: http://www.nabble.com/configuring-mail-endpoint-tp22287281p22288278.html Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: Performance and MessageSupport.getBody (1.6.0)
On Mon, Mar 2, 2009 at 6:43 PM, paquettd dan.paque...@lmco.com wrote: I'm not sure if it makes a difference but I'm not using JMS anywhere. In fact in this test everything is using direct. Is there something I can do in the Spring DSL to hint to Camel that there is no conversion necessary? Can you show your route and what you send to the direct endpoint? Claus Ibsen-2 wrote: On Mon, Mar 2, 2009 at 5:54 PM, paquettd dan.paque...@lmco.com wrote: I've been seeing some performance problems with Camel 1.6.0 (I have not tried this with previous versions yet). My profiler is pointing the finger at MessageSupport.getBody, TypeConverter.convertTo, and DefaultTypeConverter.findTypeConverter specifically findTypeConverter is always throwing a NoTypeConversionAvailableException; which is then being caught and ignored in MessageSupport.getBody; at which point processing continues successfully. This should be normal in situations where you ask the body to be a specific type which cannot be converted to. To help this can you show your route and what kind of JMS messages are you sending. Camel is payload type agnostics (eg dont have to be pure XML etc.) so you can send whatever objects you like. It has a rich type converter registry to be able to convert seamless between types. This registry is loaded on demand, so you should make sure your start profiling after Camel is warm. protected T T getBody(ClassT type, Object body) is the specific getBody in question. Is this exception an expected behavior? It's weird how the catch block doesn't even log a warning. Should a converter have been found? My message payload is just a java.lang.String. In the old days it returned null, but that did not work as the payload you were trying to convert could be null, so it was a catch-22 situation. So we added the exception. But if throwing exception is expensive we could maybe add a has test to avoid this exception being thrown and caught in the MessageSupport. The exception is also meant for end users so they get a good exception detailing the problem if they try to convert something into eg, MyFooClass and its not possible to convert to it. Instead of returning a null value as result. I suspect I've done something wrong but I don't know where to start looking. I'm concerned with this; as I'm comparing Camel to some other message routing solutions. This is making Camel take 40 times longer than the competition and I want to make sure I do a fair comparison. We are currently rewamping the internal API in Camel 2.0 that leads us up to a point where we can do performance improvements when Camel routes exchanges. Currently it does a bit of defensive copying when it moves message from node to node. The revamped API lets us do some more clever stuff there to improve the speed. So if you are testing, eg. JMS - JMS and want it to be really fast then of course pure JMS to JMS is faster than eg over Camel as its a very flexible and transport/protocol agnostic framework. But performance improvements is on our roadmap in 2.1. -- View this message in context: http://www.nabble.com/Performance-and-MessageSupport.getBody-%281.6.0%29-tp22291841p22291841.html Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ -- View this message in context: http://www.nabble.com/Performance-and-MessageSupport.getBody-%281.6.0%29-tp22291841p22292939.html Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: Camel 2.0-snapshot deployed on SMKNL4 - There are 2 parameters that couldn't be set on the endpoint
It is trying to delete the file first. Are you sure its not locked or something by another app. Could you try again and be sure the existing file is not open by some other apps. On Tue, Mar 3, 2009 at 10:36 AM, cmoulliard cmoulli...@gmail.com wrote: I don't if this point must be fixed or not but when a file already exist in the 'done' directory, then the following error is generated : 2009-03-03 10:34:00,937 ERROR FileConsumer - Cannot rename file: GenericFile[d:\temp\data\csv.txt] to: GenericFile[d:\temp\done\csv.txt] org.apache.camel.component.file.GenericFileOperationFailedException: Cannot rename file: GenericFile[d:\temp\data\csv.txt] to: GenericFile[d:\temp\done\csv.txt] at org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.renameFile(GenericFileRenameProcessStrategy.java:82) at org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.commit(GenericFileRenameProcessStrategy.java:58) at org.apache.camel.component.file.GenericFileConsumer.processStrategyCommit(GenericFileConsumer.java:231) at org.apache.camel.component.file.GenericFileConsumer$1.done(GenericFileConsumer.java:185) at org.apache.camel.processor.UnitOfWorkProcessor$1.done(UnitOfWorkProcessor.java:57) at org.apache.camel.management.InstrumentationProcessor$1.done(InstrumentationProcessor.java:74) at org.apache.camel.processor.Pipeline.process(Pipeline.java:106) at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68) at org.apache.camel.processor.interceptor.StreamCachingInterceptor.proceed(StreamCachingInterceptor.java:87) at org.apache.camel.processor.interceptor.StreamCachingInterceptor.process(StreamCachingInterceptor.java:82) at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:52) at org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:170) at org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:103) at org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:66) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317) at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:619) cmoulliard wrote: OK. By the way it works fine with absolute paths. Claus Ibsen-2 wrote: The problem is that you mix and match absolute with relative. I will add a fix but you should also use absolute paths for the move expression as a workaround. On Tue, Mar 3, 2009 at 10:16 AM, cmoulliard cmoulli...@gmail.com wrote: Hi claus, I receive the following error : 2009-03-03 10:09:41,859 ERROR FileConsumer - java.lang.NullPointerException at org.apache.camel.component.file.GenericFile.changeFileName(GenericFile.java:119) at org.apache.camel.component.file.strategy.GenericFileExpressionRenamer.renameFile(GenericFileExpressionRenamer.java:41) at org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.commit(GenericFileRenameProcessStrategy.java:57) at org.apache.camel.component.file.GenericFileConsumer.processStrategyCommit(GenericFileConsumer.java:231) at org.apache.camel.component.file.GenericFileConsumer$1.done(GenericFileConsumer.java:185) at org.apache.camel.processor.UnitOfWorkProcessor$1.done(UnitOfWorkProcessor.java:57) at org.apache.camel.management.InstrumentationProcessor$1.done(InstrumentationProcessor.java:74) at org.apache.camel.processor.Pipeline.process(Pipeline.java:106) at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68) at org.apache.camel.processor.interceptor.StreamCachingInterceptor.proceed(StreamCachingInterceptor.java:87) at org.apache.camel.processor.interceptor.StreamCachingInterceptor.process(StreamCachingInterceptor.java:82) at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:52) at org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:170
Re: Camel 2.0-snapshot deployed on SMKNL4 - There are 2 parameters that couldn't be set on the endpoint
Hi Are you by any chance running on Windows platform? I am just curious as we have got a report on windows with 1.x sometimes can not move file after processing. On Tue, Mar 3, 2009 at 11:31 AM, cmoulliard cmoulli...@gmail.com wrote: You are right ;-) The file was locked by another application. Claus Ibsen-2 wrote: It is trying to delete the file first. Are you sure its not locked or something by another app. Could you try again and be sure the existing file is not open by some other apps. On Tue, Mar 3, 2009 at 10:36 AM, cmoulliard cmoulli...@gmail.com wrote: I don't if this point must be fixed or not but when a file already exist in the 'done' directory, then the following error is generated : 2009-03-03 10:34:00,937 ERROR FileConsumer - Cannot rename file: GenericFile[d:\temp\data\csv.txt] to: GenericFile[d:\temp\done\csv.txt] org.apache.camel.component.file.GenericFileOperationFailedException: Cannot rename file: GenericFile[d:\temp\data\csv.txt] to: GenericFile[d:\temp\done\csv.txt] at org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.renameFile(GenericFileRenameProcessStrategy.java:82) at org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.commit(GenericFileRenameProcessStrategy.java:58) at org.apache.camel.component.file.GenericFileConsumer.processStrategyCommit(GenericFileConsumer.java:231) at org.apache.camel.component.file.GenericFileConsumer$1.done(GenericFileConsumer.java:185) at org.apache.camel.processor.UnitOfWorkProcessor$1.done(UnitOfWorkProcessor.java:57) at org.apache.camel.management.InstrumentationProcessor$1.done(InstrumentationProcessor.java:74) at org.apache.camel.processor.Pipeline.process(Pipeline.java:106) at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68) at org.apache.camel.processor.interceptor.StreamCachingInterceptor.proceed(StreamCachingInterceptor.java:87) at org.apache.camel.processor.interceptor.StreamCachingInterceptor.process(StreamCachingInterceptor.java:82) at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:52) at org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:170) at org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:103) at org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:66) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317) at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:619) cmoulliard wrote: OK. By the way it works fine with absolute paths. Claus Ibsen-2 wrote: The problem is that you mix and match absolute with relative. I will add a fix but you should also use absolute paths for the move expression as a workaround. On Tue, Mar 3, 2009 at 10:16 AM, cmoulliard cmoulli...@gmail.com wrote: Hi claus, I receive the following error : 2009-03-03 10:09:41,859 ERROR FileConsumer - java.lang.NullPointerException at org.apache.camel.component.file.GenericFile.changeFileName(GenericFile.java:119) at org.apache.camel.component.file.strategy.GenericFileExpressionRenamer.renameFile(GenericFileExpressionRenamer.java:41) at org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.commit(GenericFileRenameProcessStrategy.java:57) at org.apache.camel.component.file.GenericFileConsumer.processStrategyCommit(GenericFileConsumer.java:231) at org.apache.camel.component.file.GenericFileConsumer$1.done(GenericFileConsumer.java:185) at org.apache.camel.processor.UnitOfWorkProcessor$1.done(UnitOfWorkProcessor.java:57) at org.apache.camel.management.InstrumentationProcessor$1.done(InstrumentationProcessor.java:74) at org.apache.camel.processor.Pipeline.process(Pipeline.java:106) at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68) at org.apache.camel.processor.interceptor.StreamCachingInterceptor.proceed(StreamCachingInterceptor.java:87
Re: org.apache.camel.NoTypeConversionAvailableException: No type converter available to convert from type: org.apache.camel.component.file.GenericFileMessage to the required type - SMX4 !
/camel-spring.xsd; bean id=bindyDataformat class=org.apache.camel.dataformat.bindy.csv.BindyCsvDataFormat constructor-arg type=java.lang.String value=com.xpectis.camel.bindy.model/ /bean bean id=csv class=com.xpectis.camel.bindy.csv.CsvBean / camelContext xmlns=http://camel.apache.org/schema/osgi; camel:packagecom.xpectis.camel.bindy.routing/camel:package camel:route camel:from uri=file://d:/temp/data/?noop=true / camel:unmarshal ref=bindyDataformat/ camel:to uri=bean:csv / /camel:route /camelContext /beans Willem Claus Ibsen wrote: Hi The @FallbackConverter type converter should kick in, when you use file based components Willem is there something there that needs to be done in camel-osgi for registering fallback converteres as well? On Mon, Mar 2, 2009 at 5:16 PM, cmoulliard cmoulli...@gmail.com wrote: Yes Willem, Here it is : ?xml version=1.0 encoding=UTF-8? beans xmlns=http://www.springframework.org/schema/beans; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation= http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd; bean id=bindyDataformat class=org.apache.camel.dataformat.bindy.csv.BindyCsvDataFormat constructor-arg type=java.lang.String value=com.xpectis.camel.bindy.model/ /bean bean id=csv class=com.xpectis.camel.bindy.csv.CsvBean / camelContext xmlns=http://camel.apache.org/schema/spring; packagecom.xpectis.camel.bindy.routing/package route from uri=file://d:/temp/data/?noop=true / unmarshal ref=bindyDataformat/ to uri=bean:csv / /route /camelContext /beans Remark : I work with camel 2.0-SNAPSHOT. Regards, Charles willem.jiang wrote: Hi Charles, What kind of camel context did you create? Can you show me the Spring configuration file or the DSL rule? Willem On Mon, Mar 2, 2009 at 11:01 PM, cmoulliard cmoulli...@gmail.com wrote: Hi, I have a small camel - bindy project running perfectly in Eclipse or when launched using command camel:run but when I deploy it on Servicemix Kernel 4, I receive the following error : 15:48:05,936 | ERROR | ompon...@1cb1d37 | DeadLetterChannel | rg.apache.camel.processor.Logger 207 | Failed delivery for exchangeId: ID-dell-charles-2356-1236005216593-0-1. On delivery attempt: 0 caught: org.apache.camel.NoTypeConversionAvailableException: No type converter available to convert from type: org.apache.camel.component.file.GenericFileMessage to the required type: java.io.InputStream with value GenericFileMessage: GenericFile[d:\temp\data\csv.txt] org.apache.camel.NoTypeConversionAvailableException: No type converter available to convert from type: org.apache.camel.component.file.GenericFileMessage to the required type: java.io.InputStream with value GenericFileMessage: GenericFile[d:\temp\data\csv.txt] at org.apache.camel.impl.converter.DefaultTypeConverter.convertTo(DefaultTypeConverter.java:126) at org.apache.camel.impl.converter.DefaultTypeConverter.convertTo(DefaultTypeConverter.java:74) at org.apache.camel.impl.MessageSupport.getBody(MessageSupport.java:70) at org.apache.camel.impl.MessageSupport.getBody(MessageSupport.java:51) at org.apache.camel.util.ExchangeHelper.getMandatoryInBody(ExchangeHelper.java:135) at org.apache.camel.processor.UnmarshalProcessor.process(UnmarshalProcessor.java:44) at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:80) at org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:194) at org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:129) at org.apache.camel.processor.Pipeline.process(Pipeline.java:115) at org.apache.camel.processor.Pipeline.process(Pipeline.java:89) at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68) at org.apache.camel.processor.interceptor.StreamCachingInterceptor.proceed(StreamCachingInterceptor.java:87) at org.apache.camel.processor.interceptor.StreamCachingInterceptor.process(StreamCachingInterceptor.java:82) at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:52) at org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:170) at org.apache.camel.component.file.GenericFileConsumer.poll
Re: Are durable topic subscriptions destroyed?
On Thu, Mar 5, 2009 at 3:38 AM, ariekenb aaron.j.riekenb...@lmco.com wrote: If I create a durable topic subscription using the jms or activemq components (for example activemq:topic:myTopic?clientId=client1durableSubscriptionName=subscription1), does camel ever cause the durable subscription to be destroyed? In other words will camel ever cause session.unsubscribe to be called? I'm working in a situation where I'm implementing failover of a durable subscription on different machines using camel and I want to be sure the durable subscription does not get destroyed when the camel context is destroyed. Just out of curiosity, I'm also wondering how/if one can indicate he wants the durable subscription to be destroyed when the camel context is destroyed. Not to my knowledge. But I would advice you to double check the source code of camel-jms to see if there is any code that would call unsubscribe. Usually such code would be in doStop or stop methods. James Strachan who wrote the camel-jms component would be in a better position to clarify this. With your findings we should update the wiki, so please report back. As an aside there is a small bug on this web page describing durable subscriptions (http://camel.apache.org/jms.html). The first paragraph under Notes states If you wish to use durable topic subscriptions, you need to specify both clientId and durableSubscriberName. durableSubscriberName does not work. The table below has the correct property: durableSubscriptionName. Thanks for spotting this. Fixed the typo. -- View this message in context: http://www.nabble.com/Are-durable-topic-subscriptions-destroyed--tp22344211p22344211.html Sent from the Camel - Users (activemq) mailing list archive at Nabble.com. -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: Is it possible to overload a bean method?
On Thu, Mar 5, 2009 at 9:40 AM, ee7arh andrew.hu...@2e-systems.com wrote: Thanks for the feedback, It looks like we are talking about the same use case. In my example, all my methods had the same name, but each method had a different parameter (Object1, 2 and 3). Each of these parameter types inheritted from Objectn. So each method did have a different concrete sub-type although all are instances of Objectn. In your example, your 3rd method has a different name... was that a typo? Yeah probably. I could certainly use different method names, it would just mean I have to have some more logic in my RouteBuilder. At the moment, I just send objects off the queue to the same bean method and ask it to take care of selecting the correct one by overloading. You can send it to an indirect method that will check the type and invoke the correct method of the 3. Then you route can stay simple. Thanks and Regards Andrew ee7arh wrote: Hi, I have a bean defined which has 3 methods all with same name but with different arguements. I would like to route messages from a queue to this bean and depending on the object type I was hoping that the correct method would get called by overloading. Instead i get the error: org.apache.camel.NoTypeConversionAvailableException: No type converter available to convert from type:. I noticed that the first method defined in my bean caused this error so it looks like Camel takes the 1st method and tries (and fails) to convert the message. here is my bean definition: @Service(value = serviceEventGenerator) public class ServiceEventGenerator { public ArrayListServiceEvent generateServiceEvents(Object1 event) {} public ArrayListServiceEvent generateServiceEvents(Object2 event) {} public ArrayListServiceEvent generateServiceEvents(Object3 event) {} } (Incidentally in my example, Object 1,2 and 3 all extend from a parent class Objectn.) And my route: from(jms:queue:unmarshalledEventsQueue) .to(log:unmarshalledEventLogger?level=INFO) .to(bean:serviceEventGenerator?methodName=generateServiceEvents) Thanks in advance for any help Andrew -- View this message in context: http://www.nabble.com/Is-it-possible-to-overload-a-bean-method--tp22338316p22347357.html Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: Is it possible to overload a bean method?
BTW I created a ticket for it https://issues.apache.org/activemq/browse/CAMEL-1424 On Thu, Mar 5, 2009 at 9:49 AM, Claus Ibsen claus.ib...@gmail.com wrote: On Thu, Mar 5, 2009 at 9:40 AM, ee7arh andrew.hu...@2e-systems.com wrote: Thanks for the feedback, It looks like we are talking about the same use case. In my example, all my methods had the same name, but each method had a different parameter (Object1, 2 and 3). Each of these parameter types inheritted from Objectn. So each method did have a different concrete sub-type although all are instances of Objectn. In your example, your 3rd method has a different name... was that a typo? Yeah probably. I could certainly use different method names, it would just mean I have to have some more logic in my RouteBuilder. At the moment, I just send objects off the queue to the same bean method and ask it to take care of selecting the correct one by overloading. You can send it to an indirect method that will check the type and invoke the correct method of the 3. Then you route can stay simple. Thanks and Regards Andrew ee7arh wrote: Hi, I have a bean defined which has 3 methods all with same name but with different arguements. I would like to route messages from a queue to this bean and depending on the object type I was hoping that the correct method would get called by overloading. Instead i get the error: org.apache.camel.NoTypeConversionAvailableException: No type converter available to convert from type:. I noticed that the first method defined in my bean caused this error so it looks like Camel takes the 1st method and tries (and fails) to convert the message. here is my bean definition: @Service(value = serviceEventGenerator) public class ServiceEventGenerator { public ArrayListServiceEvent generateServiceEvents(Object1 event) {} public ArrayListServiceEvent generateServiceEvents(Object2 event) {} public ArrayListServiceEvent generateServiceEvents(Object3 event) {} } (Incidentally in my example, Object 1,2 and 3 all extend from a parent class Objectn.) And my route: from(jms:queue:unmarshalledEventsQueue) .to(log:unmarshalledEventLogger?level=INFO) .to(bean:serviceEventGenerator?methodName=generateServiceEvents) Thanks in advance for any help Andrew -- View this message in context: http://www.nabble.com/Is-it-possible-to-overload-a-bean-method--tp22338316p22347357.html Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: java.lang.NoClassDefFoundError when running CamelJmsToFileExample
This is the dependecy reported by maven [INFO] [dependency:list] [INFO] [INFO] The following files have been resolved: [INFO]aopalliance:aopalliance:jar:1.0:compile [INFO]backport-util-concurrent:backport-util-concurrent:jar:2.1:compile [INFO]com.sun.xml.bind:jaxb-impl:jar:2.1.6:compile [INFO]commons-logging:commons-logging:jar:1.1.1:compile [INFO]commons-logging:commons-logging-api:jar:1.1:compile [INFO]commons-pool:commons-pool:jar:1.4:compile [INFO]javax.activation:activation:jar:1.1:compile [INFO]javax.xml.bind:jaxb-api:jar:2.1:compile [INFO]javax.xml.stream:stax-api:jar:1.0-2:compile [INFO]junit:junit:jar:3.8.2:test [INFO]org.apache.activemq:activeio-core:jar:3.1.0:compile [INFO]org.apache.activemq:activemq-core:jar:5.2.0:compile [INFO]org.apache.camel:camel-core:jar:1.6.1-SNAPSHOT:compile [INFO]org.apache.camel:camel-jms:jar:1.6.1-SNAPSHOT:compile [INFO]org.apache.camel:camel-spring:jar:1.6.1-SNAPSHOT:compile [INFO] org.apache.geronimo.specs:geronimo-j2ee-management_1.0_spec:jar:1.1:compile [INFO]org.apache.geronimo.specs:geronimo-jms_1.1_spec:jar:1.1.1:compile [INFO]org.apache.geronimo.specs:geronimo-jta_1.1_spec:jar:1.1.1:compile [INFO]org.springframework:spring-aop:jar:2.5.6:compile [INFO]org.springframework:spring-beans:jar:2.5.6:compile [INFO]org.springframework:spring-context:jar:2.5.6:compile [INFO]org.springframework:spring-context-support:jar:2.5.6:compile [INFO]org.springframework:spring-core:jar:2.5.6:compile [INFO]org.springframework:spring-jms:jar:2.5.6:compile [INFO]org.springframework:spring-tx:jar:2.5.6:compile On Thu, Mar 5, 2009 at 9:53 AM, Claus Ibsen claus.ib...@gmail.com wrote: Hi Ah line 50 is the JMS component. You need the camel-jms on the classpath. And you also need activemq .jars as well. On Wed, Mar 4, 2009 at 11:48 PM, m.s. mathis.schwuc...@web.de wrote: When I try to run the CamelJmsToFileExample, I get the exception below. Can anyone help to figure out what went wrong? Cheers, M.S: 04.03.2009 16:40:02 org.apache.camel.impl.DefaultCamelContext init INFO: JMX enabled. Using InstrumentationLifecycleStrategy. Exception in thread main java.lang.NoClassDefFoundError: org/springframework/transaction/PlatformTransactionManager at cameltest.CamelJmsToFileExample.main(CamelJmsToFileExample.java:50) Caused by: java.lang.ClassNotFoundException: org.springframework.transaction.PlatformTransactionManager at java.net.URLClassLoader$1.run(URLClassLoader.java:200) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:307) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) ... 1 more -- View this message in context: http://www.nabble.com/java.lang.NoClassDefFoundError-when-running-CamelJmsToFileExample-tp22341345p22341345.html Sent from the Camel - Users (activemq) mailing list archive at Nabble.com. -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: MinaConfiguration codec property
) at org.apache.camel.component.mina.MinaComponent.createSocketEndpoint(MinaComponent.java:175) at org.apache.camel.component.mina.MinaComponent.createEndpoint(MinaComponent.java:109) at org.apache.camel.component.mina.MinaComponent.createEndpoint(MinaComponent.java:101) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:115) ... 18 more if i remove the property codec, it works. I believe it's because the myCodec bean is not already created. It is reference as a spring value, not as a bean reference. But i tried to add depends-on but it doesn't work. bean depends-on=myCodec id=myMinaConfig ... Regards. NicolaS. -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: MinaConfiguration codec property
at org.apache.camel.util.CamelContextHelper.lookup(CamelContextHelper.java:152) at org.apache.camel.util.CamelContextHelper.mandatoryLookup(CamelContextHelper.java:170) at org.apache.camel.impl.DefaultComponent.mandatoryLookup(DefaultComponent.java:315) at org.apache.camel.component.mina.MinaComponent.getCodecFactory(MinaComponent.java:360) at org.apache.camel.component.mina.MinaComponent.configureCodecFactory(MinaComponent.java:213) at org.apache.camel.component.mina.MinaComponent.createSocketEndpoint(MinaComponent.java:175) at org.apache.camel.component.mina.MinaComponent.createEndpoint(MinaComponent.java:109) at org.apache.camel.component.mina.MinaComponent.createEndpoint(MinaComponent.java:101) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:115) ... 18 more if i remove the property codec, it works. I believe it's because the myCodec bean is not already created. It is reference as a spring value, not as a bean reference. But i tried to add depends-on but it doesn't work. bean depends-on=myCodec id=myMinaConfig ... Regards. NicolaS. -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: DSL Content Router interrupted with splitter() or multicast()
On Thu, Mar 5, 2009 at 10:25 AM, ee7arh andrew.hu...@2e-systems.com wrote: Hi, When I tryto use the functions splitter() or multicast() in my DSL within a choice() block, I am not able to have another when() or even an otherwise() Predicate isInvitation = PredicateBuilder.regex(header(event_type), invitation); Predicate isReply = PredicateBuilder.regex(header(event_type), reply); from(jms:queue:myQueue) .choice() .when(isInvitation) .to(bean:eventMarshaller?methodName=unmarshallTriggerInvites) .splitter(body()) // This line causes a compilcation problem on the next when() or otherwise() .to(jms:queue:unmarshalledEventsQueue)) .when(isFlightUpdate) If I take out the splitter() line above, all works fine and I can have as many when() statements as I like. Is there a reason why this doesn't work? Yeah the compiler can not follow you :) When you mix like that in some situations you get to a hold. The solution is to split your route in sub routes. So keep one route for the overall choice And then sub routes for the splitter You can use direct:xxx endpoints to connect them in sync fashion and use seda:xxx for async fashion. Thanks Andrew -- View this message in context: http://www.nabble.com/DSL-Content-Router-interrupted-with-splitter%28%29-or-multicast%28%29-tp22347983p22347983.html Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: Invoking web services with Camel Using CXF
On Thu, Mar 5, 2009 at 5:50 PM, Bruce Snyder bruce.sny...@gmail.com wrote: On Wed, Mar 4, 2009 at 10:55 PM, Claus Ibsen claus.ib...@gmail.com wrote: There is a setHeader tag you can use to add the header, just like the Java DSL below. It might use a expression as subtype so you need to wrap it with constant for string litterals Something like this: setHeader name=fooconstantBar/constant/setHeader Thanks, Claus. I missed this element in the XSD. The problem with this flavor is the following error: org.apache.camel.RuntimeCamelException: Can't find the operation name in the message! To my knowledge, there is no way to add headers to a message exchange via the XML. If I'm wrong about this I'd appreciate some suggestions on how to get beyond the error. 2) Below is the same route using the Java API: public void configure() { from(file:src/data?noop=true).process(new Processor() { public void process(Exchange exchange) throws Exception { Message in = exchange.getIn(); in.setHeader(operationName, sayHi); } }). to(cxf:http://localhost:9002/HelloWorld?serviceClass=demo.spring.HelloWorld;); } The problem with this route is that Camel hangs on the following line indefinitely and I can't get it beyond it: ... INFO: Apache Camel 1.6.0 (CamelContext:camelContext) started Mar 4, 2009 2:01:06 PM org.apache.camel.util.MainSupport generateDot INFO: Generating DOT file for routes: /Users/bsnyder/Desktop/eclipse-3.4/workspace-amq-trunk/camel-example-two/target/site/cameldoc for: org.apache.camel.spring.springcamelcont...@dd6a83 with name: camelContext If anyone can tell me how to move beyond this then I could move on to the next issue. Incidentally, patched the org.apache.camel.spring.Main class to add the ability to disable the DOT file generation. But there is already a property in the RunMojo named dotEnabled but it's read-only. Why is this? Strange, as according to this you should be able to disable it: http://camel.apache.org/camel-dot-maven-goal.html I've now disabled this in the POM using the following configuration and it's still hanging in the same location: If it is possible then I have fixed that in 1.6.1-SNAPSHOT or 2.0-SNAPSHOT by disabling DOT by default. btw the parameter for camel:run is dotEnabled, where as its useDot for camel:dot. I have aligned these names to useDot in 1.6.1 onwards. Detecting if the EXEC hangs is kinda hard as its use some 3rd part .jar to exec the Graphviz and wait for return codes. But in you case it looks like something get it to struck. Im on Mac OS X as well and have not seen this with Graphwiz. reporting plugins plugin groupIdorg.apache.camel/groupId artifactIdcamel-maven-plugin/artifactId version${camel-version}/version configuration !--executable/Applications/Graphviz.app/Contents/MacOS/Graphviz/executable-- useDotfalse/useDot /configuration /plugin /plugins /reporting Maybe we should let it be disabled by default as most people will NOT have Graphviz installed by default. That's not a bad idea, but there should be some logging that indicates the situation, i.e., Unable to locate the Graphviz executable, disabling DOT generation. Additionally, I've enabled debug logging on org.apache.camel and I'm still only seeing info level output, even after cleaning and rebuilding. Have you added log4j to the classpath and log4j.properties in src/main/resources? CXF is sadly using JDK Logging (This is really terrible IMHO, always use JCL as all the other frameworks does) Willem Jiang wrote something somewhere how to get CXF to use log4j. Yeah, I'm aware of this as I added a tip to the CXF wiki some time ago: http://cwiki.apache.org/CXF20DOC/debugging.html#Debugging-UsingLog4jInsteadofjava.util.logging But this is not the issue. I'm no longer using the camel-cxf component and I still cannot see debug level logging. Is this entire DEBUG logging or only for CXF? Camel uses commons logging. BTW: Beware there re some commons logging .jars with no log4j factories so if you grab one of the wrong ones it cannot log using log4j. Inside the .jar there should be a log4j class somewhere. What about the examples that ships with Camel can you see debug logging there? They use log4j and there is a log4j properties in src/main/resources to tamper with. Bruce -- perl -e 'print unpack(u30,D0G)u8...@4vyy95R\F)R=6-E+G-N61ED\!G;6%I;\YC;VT* );' Apache ActiveMQ - http://activemq.apache.org/ Apache Camel - http://camel.apache.org/ Apache ServiceMix - http://servicemix.apache.org/ Blog: http://bruceblog.org/ -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: Invoking web services with Camel Using CXF
On Thu, Mar 5, 2009 at 6:42 PM, Bruce Snyder bruce.sny...@gmail.com wrote: On Thu, Mar 5, 2009 at 9:59 AM, Claus Ibsen claus.ib...@gmail.com wrote: If it is possible then I have fixed that in 1.6.1-SNAPSHOT or 2.0-SNAPSHOT by disabling DOT by default. Looks like it hasn't been deployed yet, so I'm having to build it locally. btw the parameter for camel:run is dotEnabled, where as its useDot for camel:dot. I have aligned these names to useDot in 1.6.1 onwards. I tried the dotEnabled config and got this error: Error configuring: org.apache.camel:camel-maven-plugin. Reason: ERROR: Cannot override read-only parameter: dotEnabled in goal: camel:run Yeah that is a bommer with the @readonly. This is also fixed. Is this entire DEBUG logging or only for CXF? Camel uses commons logging. This is only using Camel. I'm not using CXF. BTW: Beware there re some commons logging .jars with no log4j factories so if you grab one of the wrong ones it cannot log using log4j. Inside the .jar there should be a log4j class somewhere. The project is using commons-logging-1.1 from the transitive dependency via camel-core. What about the examples that ships with Camel can you see debug logging there? They use log4j and there is a log4j properties in src/main/resources to tamper with. That's the weird thing - I can see all debug level logging with the Camel examples. Can you try mvn dependency:list to see if it got log4j in there. Maybe compare it with the example that worked. Bruce -- perl -e 'print unpack(u30,D0G)u8...@4vyy95R\F)R=6-E+G-N61ED\!G;6%I;\YC;VT* );' Apache ActiveMQ - http://activemq.apache.org/ Apache Camel - http://camel.apache.org/ Apache ServiceMix - http://servicemix.apache.org/ Blog: http://bruceblog.org/ -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: java.lang.NoClassDefFoundError when running CamelJmsToFileExample
On Thu, Mar 5, 2009 at 8:41 PM, m.s. mathis.schwuc...@web.de wrote: Thanks for the clarification, working with Camel in a Maven project in NetBeans works great. Unfortunately, I have to use it in an Ant build project, so I have to care for resolving the dependencies myself. Is there a way to help me doing this with Maven, e.g. by bundling all dependencies I need in a single archive? You can use ivy that works with ANT and can find maven dependencies. For maven you can run: mvn dependency:list to get a list what is needed. M.S. willem.jiang wrote: Yes. we don't ship all the dependencies in the binary distribution. Because Camel has lots of components if we ship all the dependency jars, the binary could be up to more than 100MB. Fortunately maven could help us to do that kind of work :) Willem m.s. wrote: Thanks, it works when I use Maven to download all the .jars listed in the dependency list and add them to the libraries in the NetBeans IDE. So is it correct that the binary distribution does not contain all dependencies if I use the JMS Component or aother component? M.S. -- View this message in context: http://www.nabble.com/java.lang.NoClassDefFoundError-when-running-CamelJmsToFileExample-tp22341345p22359006.html Sent from the Camel - Users (activemq) mailing list archive at Nabble.com. -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: Camel meven goal configuration problem
Hi Could you show us you maven pom configuration for this plugin? On Fri, Mar 6, 2009 at 11:18 AM, mta38 mtaraud@orange-ftgroup.com wrote: Hi all, I am trying to run camel maven goal (camel:dot). I stated that if in resource project folder, it does not exist META-INF/spring:*.xml structure, but something like resource/ com/ myprganisation/ routes/ camel-context.xml (camel routes are in this file) Folder1/ SpringFile1.xml (beans used by camel routes) The command mvn camel:dot generate an index.html file with message No EIP diagrams available even if in my pom.xml, i configure applicationContextUri property of camel-maven-plugin. Is someone can explain me what is wrong in my use of camel maven goal ?:confused: Thanks in advance, Best regards. Mta38 -- View this message in context: http://www.nabble.com/Camel-meven-goal-configuration-problem-tp22369252p22369252.html Sent from the Camel - Users (activemq) mailing list archive at Nabble.com. -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: Catch and handle errors when using the TransactionErrorHandler
On Fri, Mar 6, 2009 at 1:51 PM, Henric Hedin hhe...@gmail.com wrote: Hi, Is it possible to in some way to use the TransactionErrorHandler and at the same time catch and handle exceptions? I have read the documentation under http://camel.apache.org/error-handling-in-camel.html that for transactional exchanges the Error Handler does not kick, so the following code in my Route configure will not work: errorHandler(bean(TransactionErrorHandlerBuilder.class, transactionErrorHandler)); onException(SAXParseException.class). handled(true). policy(notsupported). maximumRedeliveries(1). transform().constant(Sorry, parse exception...). to(jms:queue:validationFailed.SAXParseException); from(jms:queue:input-queue?transacted=true). unmarshal(jaxbDataFormat). to(jms:queue:output-queue). What I'm trying to accomplish is if a parsing exception occurs, I would like my incoming message to be rolled back and put on the jms deadletter queue (configured for the queue on the JMS provider, when the JMSXDeliveryCount has reached it's threshold). But I would also be able to send an information jms-message to the same jms-provider with information about why the message has been backed out (of course outside the incoming transaction). Maybe a strange solution, but is it possible to handle in Camel? :) /Henric No the DeadLetterChannel is disabled for transacted exchanges. There is a trick though, if you dont add the Spring Policy then it will default to REQUIRED and still use DLC. We are considering how we can provide options for end users in the future so you can use DLC for somerthing combined with transacted exchanges. The problem with transacted exchanges is that they are redelivered in a totally new thread so Camel has no wait of correlating a previous attempt, we can only rely on the few JMS options you get such as the JMSX counter. But we dont know when we have reached exhausted, to send the extra JMS message But any feedback and ideas is welcome what we can do in the future to bring more value to error handling with TX -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: Catch and handle errors when using the TransactionErrorHandler
On Mon, Mar 9, 2009 at 9:28 AM, Henric Hedin hhe...@gmail.com wrote: OK, I had missed that warning :) I'm using WebSphere MQ 6.0.2.5, Camel 1.6.0 and Spring 2.5.6. I'm not running XA or inside a J2EE Container, but the cacheLevelName=CACHE_NONE seems to have solved by problem for WebSphere MQ. Thanks. I have added you case to the warning. /Henric On Mon, Mar 9, 2009 at 9:11 AM, Claus Ibsen claus.ib...@gmail.com wrote: On Mon, Mar 9, 2009 at 9:02 AM, Henric Hedin hhe...@gmail.com wrote: Hi again, I solved my problem by setting cacheLevelName=CACHE_NONE on the MQ JMS Endpoint. Now the message is backed out out directly, without the route/JVM restart. Great We have a warning about it here: http://camel.apache.org/jms.html Maybe we should add WMQ to the list as well that could have problems as well? BTW Which versions of Camel, Spring and WMQ are you using? Regards, Henric On Mon, Mar 9, 2009 at 8:53 AM, Henric Hedin hhe...@gmail.com wrote: Thank you Claus, the trick to not use the Spring Policy works good enough for me! Though, I still get a strange behavior. I'm using WebSphere MQ as the incoming JMS-provider and for the input queue I have set Backout requeue queue and the Backout threshold to 1. When sending a message to the input queue which causes a parse exception, the message is removed from the input queue and I could see on the queue depth is increased for the backout-queue; but's its never committed (i.e. I can't see the message when browsing the queue). When stopping my Route builder-flow/JVM the message is put back on the input queue and the backout count equals 2. Then, when I restart the flow/JVM again, the message is finally put correctly to the Backout queue (and removed from the input-queue), without any exceptions occurring in my Camel Route. Could this have anything to do with the JMS (Spring) options or could it be related to pooling in my (WMQ) connection factory? I will probably make some further investigations and probably try AMQ instead to see if I get the same behavior. Thanks, Henric On Fri, Mar 6, 2009 at 5:10 PM, Claus Ibsen claus.ib...@gmail.com wrote: On Fri, Mar 6, 2009 at 1:51 PM, Henric Hedin hhe...@gmail.com wrote: Hi, Is it possible to in some way to use the TransactionErrorHandler and at the same time catch and handle exceptions? I have read the documentation under http://camel.apache.org/error-handling-in-camel.html that for transactional exchanges the Error Handler does not kick, so the following code in my Route configure will not work: errorHandler(bean(TransactionErrorHandlerBuilder.class, transactionErrorHandler)); onException(SAXParseException.class). handled(true). policy(notsupported). maximumRedeliveries(1). transform().constant(Sorry, parse exception...). to(jms:queue:validationFailed.SAXParseException); from(jms:queue:input-queue?transacted=true). unmarshal(jaxbDataFormat). to(jms:queue:output-queue). What I'm trying to accomplish is if a parsing exception occurs, I would like my incoming message to be rolled back and put on the jms deadletter queue (configured for the queue on the JMS provider, when the JMSXDeliveryCount has reached it's threshold). But I would also be able to send an information jms-message to the same jms-provider with information about why the message has been backed out (of course outside the incoming transaction). Maybe a strange solution, but is it possible to handle in Camel? :) /Henric No the DeadLetterChannel is disabled for transacted exchanges. There is a trick though, if you dont add the Spring Policy then it will default to REQUIRED and still use DLC. We are considering how we can provide options for end users in the future so you can use DLC for somerthing combined with transacted exchanges. The problem with transacted exchanges is that they are redelivered in a totally new thread so Camel has no wait of correlating a previous attempt, we can only rely on the few JMS options you get such as the JMSX counter. But we dont know when we have reached exhausted, to send the extra JMS message But any feedback and ideas is welcome what we can do in the future to bring more value to error handling with TX -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: routing like jetty-splitter-aggregator-reply request/response problem
On Fri, Mar 6, 2009 at 4:30 PM, beduin gabriele.fr...@intext.it wrote: Hi, I'm building a routing like this : from jetty to splitter to aggegator to responseProcessor to mockend each endpoint is set to InOut and direct. Basically I want that request from jetty (that's like a batch to process) being splitted, processed (when all work), aggegated and have a response back. Instead what happen's that after splitted the last message is back as a response ... then the next endpoint will work fine but the (wrong) response is already back to jetty ... How can I tell to wait for a response by my responseProcessor ? Hi I am very sorry for the late reply. Was hoping someone else stepped up. Normally the replies is much faster here at the Camel community. Hope we didnt scare you away. Yes Camel can do this, though the split aggregate combination and the EIP patterns itself is hard to understand and use. The EIP book assumes messaging and often relies on InOnly. But you want a request-reply (InOut) and to wait for a combined response to send back to Jetty. I am preparing a sample for this and will add it to the wiki so I will point to it when I get it ready in a short time. Its really a nice use case you have and of course something others could need to do as well. Thanks to all try give me a suggest -- View this message in context: http://www.nabble.com/routing-like-%22jetty-splitter-aggregator-reply%22-request-response-problem-tp22374696p22374696.html Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: java.lang.NoClassDefFoundError: org/apache/camel/model/RouteType - camel 2.0
Yeah all camel components have been rebuild. You need to rebuild and install new bundles of any camel component you use, also camel-spring-javaconfig And could you look in your class: com.xpectis.camel.bindy.csv.FileCsvUnmarshalTest$ContextConfig Looks like it is using the old classes!! On Tue, Mar 10, 2009 at 10:36 AM, cmoulliard cmoulli...@gmail.com wrote: Claus, Have you also updated the code to build the routes when we use spring javaconfig : @ContextConfiguration(locations = com.xpectis.camel.bindy.csv.FileCsvUnmarshalTest$ContextConfig, loader = JavaConfigContextLoader.class) public class FileCsvUnmarshalTest extends AbstractJUnit4SpringContextTests { �...@endpointinject(uri = mock:result) private MockEndpoint resultEndpoint; �...@test public void testUnMarshallMessage() throws Exception { resultEndpoint.expectedMessageCount(1); resultEndpoint.assertIsSatisfied(); } �...@configuration public static class ContextConfig extends SingleRouteCamelConfiguration { BindyCsvDataFormat camelDataFormat = new BindyCsvDataFormat(com.xpectis.camel.bindy.model); �...@override �...@bean public RouteBuilder route() { return new RouteBuilder() { �...@override public void configure() { from(file://src/data?noop=true).unmarshal(camelDataFormat).to(mock:result); } }; } } } because I have the same error in this case. Caused by: java.lang.NoSuchMethodError: com.xpectis.camel.bindy.csv.FileCsvUnmarshalTest$ContextConfig$1.from(Ljava/lang/String;)Lorg/apache/camel/model/RouteType; at com.xpectis.camel.bindy.csv.FileCsvUnmarshalTest$ContextConfig$1.configure(FileCsvUnmarshalTest.java:53) at org.apache.camel.builder.RouteBuilder.checkInitialized(RouteBuilder.java:240) at org.apache.camel.builder.RouteBuilder.getRouteList(RouteBuilder.java:214) at org.apache.camel.impl.DefaultCamelContext.addRoutes(DefaultCamelContext.java:437) at org.apache.camel.spring.javaconfig.CamelConfiguration.camelContext(CamelConfiguration.java:58) at com.xpectis.camel.bindy.csv.FileCsvUnmarshalTest$ContextConfig$$EnhancerByCGLIB$$608ff13b.CGLIB$camelContext$3(generated) at com.xpectis.camel.bindy.csv.FileCsvUnmarshalTest$ContextConfig$$EnhancerByCGLIB$$608ff13b$$FastClassByCGLIB$$ea63cc09.invoke(generated) at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:167) at org.springframework.config.java.annotation.BeanMethodInterceptor.intercept(BeanMethodInterceptor.java:65) at com.xpectis.camel.bindy.csv.FileCsvUnmarshalTest$ContextConfig$$EnhancerByCGLIB$$608ff13b.camelContext(generated) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:115) cmoulliard wrote: I will recheck but I have done a build of camel-core, camel-spring, camel-osgi and camel-bindy yesterday afternoon. Claus Ibsen-2 wrote: The classes have been renamed lately in Camel. xxxType is now named xxxDefinition. So you need to update all camel jars in your container. Also camel-spring On Mon, Mar 9, 2009 at 4:01 PM, cmoulliard cmoulli...@gmail.com wrote: Hi, When I deploy the following routes on SMX4, ?xml version=1.0 encoding=UTF-8? beans xmlns=http://www.springframework.org/schema/beans; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:camel=http://camel.apache.org/schema/spring; xmlns:cxf=http://camel.apache.org/schema/cxf; xsi:schemaLocation= http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://camel.apache.org/schema/osgi http://camel.apache.org/schema/osgi/camel-osgi.xsd http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd http://camel.apache.org/schema/cxf http://camel.apache.org/schema/cxf/camel-cxf.xsd; bean id=bindyDataformat class=org.apache.camel.dataformat.bindy.csv.BindyCsvDataFormat constructor-arg type=java.lang.String value=org.apache.camel.example.reportincident.model / /bean bean id=csv class=org.apache.camel.example.reportincident.beans.Csv / bean id=webService class=org.apache.camel.example.reportincident.beans.WebService / !-- bean id=reportIncidentEndpoint class=org.apache.camel.example.reportincident.ReportIncidentEndpoint/ -- bean id=OK class
Re: Camel-Mina Request/Response correlation
On Tue, Mar 10, 2009 at 3:08 PM, mam1 dbra...@novator.com wrote: Claus Ibsen-2 wrote: On Mon, Mar 9, 2009 at 6:21 PM, mam1 dbra...@novator.com wrote: Hi. I have a multithreaded environment using Camel's Mina component with Spring Remoting as following: camel:camelContext camel:proxy id=test_client serviceInterface=a.b.c.TestService serviceUrl=direct:test_service/ camel:route id=test_service_mina_route camel:from uri=direct:test_service/ camel:to uri=mina:tcp://localhost:8000?textline=falseamp;minaLogger=trueamp;timeout=10amp;lazySessionCreation=trueamp;sync=trueamp;exchangePattern=InOutamp;transferExchange=true/ /camel:route /camel:camelContext I am getting unexpected results. One calling thread consumes a result intended for different calling thread, etc. It looks like there is no correlation between request and response. I am using camel 1.6.0. For reliable request/reply with correlation I would advice to use JMS. I assume you use Camel on both the client and server side since you have option: transferExchange=true that will send Camel API objects to the server. Can you show the server side as well? eg the server that listen on port 8000. Did anybody encounter similar problem? What am i missing and what is a solution for this issue? Thanks in advance. -- View this message in context: http://www.nabble.com/Camel-Mina-Request-Response-correlation-tp22413710p22413710.html Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ Thank you for reply. Camel is used on both sides as you correctly assumed. Server side configuration looks like following: beans:bean id=test_service class=a.b.c.TestServiceImpl/ camel:camelContext camel:export id=service_proxy serviceRef=test_service serviceInterface=a.b.c.TestService uri=mina:tcp://localhost:8000?textline=falseamp;minaLogger=trueamp;timeout=10amp;lazySessionCreation=trueamp;sync=trueamp;exchangePattern=InOutamp;transferExchange=true/ /camel:camelContext Is correlation already implemented for JMS (camel 1.6) component or there is an additional work that has to be done to enable correlation? Can we expect reliable communication using Mina component? Yes its a core piece in JMS to be able to correlate JMS messages. There is a JMSCorrelationID header for that. There is a getter on the JMSMessage object for it: message.getJMSCorrelationID(); As its a key piece in JMS its implemented by the JMS Broker. Messaging using JMS should be considered for reliable messaging. And you get all the features from the JMS brokers, such as persistent queues, failover, recovery, redelivery and much much more. Check out ActiveMQ http://activemq.apache.org/ MINA is used for low level socket communication such as UDP and TCP. It shouldn't really be used for a poor mans substitute for JMS. Thansks. -- View this message in context: http://www.nabble.com/Camel-Mina-Request-Response-correlation-tp22413710p22434965.html Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: Transactional batching
On Tue, Mar 10, 2009 at 3:23 PM, Thomas Beckmann thomas.beckm...@freiheit.com wrote: Hi, we are using camel 1.6 and we have a simple route that reads from an activemq queue and writes to another activemq queue based on a recipient list. The read and write is done in a transaction. Is it possible to somehow configure a batchsize and timeout so that a couple of messages are processed in one transaction? Could you also try the ActiveMQ user forum? Could be AMQ has such support. However in Camel I am not aware of such a support. What is the reason for this? Thanks in advance Thomas -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: Integartion with Glassfish
On Wed, Mar 11, 2009 at 12:32 AM, m.s. da_...@arcor.de wrote: Claus Ibsen-2 wrote: No Camel is an basically an API so its just a bunch of .jar files. So it can be embedded how you like it. So you can run Camel with Glassfish as: - as a bunch of .jars in WEB-INF/lib for the web deployment model - as OSGi - combined with Spring and let Spring handle the lifecycle of Camel. You can also run Camel totally standalone as a java main app. Are there any examples on the integration approaches mentioned? I found many examples that use Spring, but I would like to start and access Camel from a web application running in Glassfish without learning yet another framework. I try to figure out how an easy way on how to start the CamelContext on server startup and having access to it to add routes from a webservice running in the servlet container. You can see some of the tutorials and examples such as: http://camel.apache.org/tutorial-axis-camel.html http://camel.apache.org/tutorial-on-using-camel-in-a-web-application.html http://camel.apache.org/tutorials.html Thanks for any help, M.S. -- View this message in context: http://www.nabble.com/Re%3A-Integartion-with-Glassfish-tp22243954p22445894.html Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: Transactional batching
On Tue, Mar 10, 2009 at 8:23 PM, Thomas Beckmann thomas.beckm...@freiheit.com wrote: Hi, Am Dienstag 10 März 2009 schrieb Claus Ibsen: On Tue, Mar 10, 2009 at 3:23 PM, Thomas Beckmann thomas.beckm...@freiheit.com wrote: Hi, we are using camel 1.6 and we have a simple route that reads from an activemq queue and writes to another activemq queue based on a recipient list. The read and write is done in a transaction. Is it possible to somehow configure a batchsize and timeout so that a couple of messages are processed in one transaction? Could you also try the ActiveMQ user forum? Could be AMQ has such support. However in Camel I am not aware of such a support. But how could activemq help. Isn't it camel that is responsible for transaction demarcation? No Camel is just routing and mediation. The TX manager is AMQ, or whatever you configure with Spring TX. So if you need to be able to do batch consuming of messages in a single transaction then its something that AMQ should help support. Camel JMS is build on top of Spring JMS, so if its something that Spring JMS support as well, then it could very well be something Camel can do also. What is the reason for this? The FUSE tuning guide says: Even if you have to pay the performance cost of XA transactions - using batching (processing and sending many messages in a single transaction (JMS or XA) will boost performance considerably. This is because you share the synchrony cost (the waiting for things to be written and sync'd to disk) across many many messages. That's exactly what we want to achieve. Well this applies for XA only. Are you sure you want to use XA and not just regular TX? XA is painful, expensive and can be hard to get working accross different vendor products/drivers etc. If yes, then you should consider once more to be really really sure you want to use XA. And the rule of optmization, dont do it unless there has been established a fact that there is a performance problem Thomas -- Thomas Beckmann Dipl.-Math. freiheit.com technologies gmbh Straßenbahnring 22 / 20251 Hamburg, Germany fon +49 (0)40 / 890584-0 fax +49 (0)40 / 890584-20 HRB Hamburg 70814 DB48 4B15 11BA 9268 B74B 64A0 48AE 80AB C86A 46A3 Geschäftsführer: Claudia Dietze, Stefan Richter, Jörg Kirchhof -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: Camel-Mina Request/Response correlation
Hi Feel free to create a ticket if you would like such a feature in Camel with the mina being able to correlate. Maybe there is something we can do. But yet again JMS is much better for reliable messaging, but sometimes low level TCP could be feasible instead if bringing in a JMS broker in the server farm. You can also try other remoting protocols such as RMI, file based :), XMPP, HTTP, REST, SOAP etc. On Tue, Mar 10, 2009 at 3:30 PM, Claus Ibsen claus.ib...@gmail.com wrote: On Tue, Mar 10, 2009 at 3:08 PM, mam1 dbra...@novator.com wrote: Claus Ibsen-2 wrote: On Mon, Mar 9, 2009 at 6:21 PM, mam1 dbra...@novator.com wrote: Hi. I have a multithreaded environment using Camel's Mina component with Spring Remoting as following: camel:camelContext camel:proxy id=test_client serviceInterface=a.b.c.TestService serviceUrl=direct:test_service/ camel:route id=test_service_mina_route camel:from uri=direct:test_service/ camel:to uri=mina:tcp://localhost:8000?textline=falseamp;minaLogger=trueamp;timeout=10amp;lazySessionCreation=trueamp;sync=trueamp;exchangePattern=InOutamp;transferExchange=true/ /camel:route /camel:camelContext I am getting unexpected results. One calling thread consumes a result intended for different calling thread, etc. It looks like there is no correlation between request and response. I am using camel 1.6.0. For reliable request/reply with correlation I would advice to use JMS. I assume you use Camel on both the client and server side since you have option: transferExchange=true that will send Camel API objects to the server. Can you show the server side as well? eg the server that listen on port 8000. Did anybody encounter similar problem? What am i missing and what is a solution for this issue? Thanks in advance. -- View this message in context: http://www.nabble.com/Camel-Mina-Request-Response-correlation-tp22413710p22413710.html Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ Thank you for reply. Camel is used on both sides as you correctly assumed. Server side configuration looks like following: beans:bean id=test_service class=a.b.c.TestServiceImpl/ camel:camelContext camel:export id=service_proxy serviceRef=test_service serviceInterface=a.b.c.TestService uri=mina:tcp://localhost:8000?textline=falseamp;minaLogger=trueamp;timeout=10amp;lazySessionCreation=trueamp;sync=trueamp;exchangePattern=InOutamp;transferExchange=true/ /camel:camelContext Is correlation already implemented for JMS (camel 1.6) component or there is an additional work that has to be done to enable correlation? Can we expect reliable communication using Mina component? Yes its a core piece in JMS to be able to correlate JMS messages. There is a JMSCorrelationID header for that. There is a getter on the JMSMessage object for it: message.getJMSCorrelationID(); As its a key piece in JMS its implemented by the JMS Broker. Messaging using JMS should be considered for reliable messaging. And you get all the features from the JMS brokers, such as persistent queues, failover, recovery, redelivery and much much more. Check out ActiveMQ http://activemq.apache.org/ MINA is used for low level socket communication such as UDP and TCP. It shouldn't really be used for a poor mans substitute for JMS. Thansks. -- View this message in context: http://www.nabble.com/Camel-Mina-Request-Response-correlation-tp22413710p22434965.html Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: Multicast from File Polling
On Wed, Mar 11, 2009 at 9:18 PM, Bruno Borges bruno.bor...@gmail.com wrote: What is the best option to do a multicasting from a file polling endpoint? Do you care to explain a bit more in details what you excacty mean? Using this will send the same message to a,b and c simultaneously: from(file).multicast().to(a, b, c); Bruno Borges blog.brunoborges.com.br +55 21 76727099 The glory of great men should always be measured by the means they have used to acquire it. - Francois de La Rochefoucauld Sent from: Rio de janeiro Rj Brazil. -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: Multicast from File Polling
On Thu, Mar 12, 2009 at 6:25 AM, Bruno Borges bruno.bor...@gmail.com wrote: Yes, but the second endpoint doesn't get the message correctly as the file has already been pulled out. Are you using Camel 1.x? The file component has been totally rewritten in 2.0. You can then send to an intermediate endpoint and then multicast from it from(file).to(seda:foo); from(seda:foo).multicast().to(a, b, c); You can use the .convertBodyTo(String.class) if you want to load the file content and store that as payload instead of a java.io.File handle from(file).convertBodyTo(String.class).to(seda:foo); Bruno Borges blog.brunoborges.com.br +55 21 76727099 The glory of great men should always be measured by the means they have used to acquire it. - Francois de La Rochefoucauld On Thu, Mar 12, 2009 at 1:31 AM, Claus Ibsen claus.ib...@gmail.com wrote: On Wed, Mar 11, 2009 at 9:18 PM, Bruno Borges bruno.bor...@gmail.com wrote: What is the best option to do a multicasting from a file polling endpoint? Do you care to explain a bit more in details what you excacty mean? Using this will send the same message to a,b and c simultaneously: from(file).multicast().to(a, b, c); Bruno Borges blog.brunoborges.com.br +55 21 76727099 The glory of great men should always be measured by the means they have used to acquire it. - Francois de La Rochefoucauld Sent from: Rio de janeiro Rj Brazil. -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: Multicast from File Polling
On Thu, Mar 12, 2009 at 1:25 PM, Bruno Borges bruno.bor...@gmail.com wrote: That's what I've been doing (with 1.6). Looks like I'm already doing the only possible way. :-) Thanks! PS: I'm writting a Twitter component. What should I do later to contribute it to the project? That is fantastic. See the contribution wiki page: http://camel.apache.org/contributing.html Bruno Borges blog.brunoborges.com.br +55 21 76727099 The glory of great men should always be measured by the means they have used to acquire it. - Francois de La Rochefoucauld On Thu, Mar 12, 2009 at 2:33 AM, Claus Ibsen claus.ib...@gmail.com wrote: On Thu, Mar 12, 2009 at 6:25 AM, Bruno Borges bruno.bor...@gmail.com wrote: Yes, but the second endpoint doesn't get the message correctly as the file has already been pulled out. Are you using Camel 1.x? The file component has been totally rewritten in 2.0. You can then send to an intermediate endpoint and then multicast from it from(file).to(seda:foo); from(seda:foo).multicast().to(a, b, c); You can use the .convertBodyTo(String.class) if you want to load the file content and store that as payload instead of a java.io.File handle from(file).convertBodyTo(String.class).to(seda:foo); Bruno Borges blog.brunoborges.com.br +55 21 76727099 The glory of great men should always be measured by the means they have used to acquire it. - Francois de La Rochefoucauld On Thu, Mar 12, 2009 at 1:31 AM, Claus Ibsen claus.ib...@gmail.com wrote: On Wed, Mar 11, 2009 at 9:18 PM, Bruno Borges bruno.bor...@gmail.com wrote: What is the best option to do a multicasting from a file polling endpoint? Do you care to explain a bit more in details what you excacty mean? Using this will send the same message to a,b and c simultaneously: from(file).multicast().to(a, b, c); Bruno Borges blog.brunoborges.com.br +55 21 76727099 The glory of great men should always be measured by the means they have used to acquire it. - Francois de La Rochefoucauld Sent from: Rio de janeiro Rj Brazil. -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: Multicast from File Polling
On Thu, Mar 12, 2009 at 1:43 PM, Bruno Borges bruno.bor...@gmail.com wrote: By the way, is it possible to fork camel-test to 1.6.x ? That would be great. =D The code doesn't seem to be complicated to accomplish this. No but to adding a new .jar to the articfacts to be asembled and build with maven does take a bit of pain to get right. There are multiple files and you gotta remember it all etc. If you provide a patch that would help, and we could consider adding it in 1.6.x. Camel 1.6.x is to be a patch fix only now so end users on 1.6 have a stable branch for producation usage. Bruno Borges blog.brunoborges.com.br +55 21 76727099 The glory of great men should always be measured by the means they have used to acquire it. - Francois de La Rochefoucauld On Thu, Mar 12, 2009 at 9:28 AM, Claus Ibsen claus.ib...@gmail.com wrote: On Thu, Mar 12, 2009 at 1:25 PM, Bruno Borges bruno.bor...@gmail.com wrote: That's what I've been doing (with 1.6). Looks like I'm already doing the only possible way. :-) Thanks! PS: I'm writting a Twitter component. What should I do later to contribute it to the project? That is fantastic. See the contribution wiki page: http://camel.apache.org/contributing.html Bruno Borges blog.brunoborges.com.br +55 21 76727099 The glory of great men should always be measured by the means they have used to acquire it. - Francois de La Rochefoucauld On Thu, Mar 12, 2009 at 2:33 AM, Claus Ibsen claus.ib...@gmail.com wrote: On Thu, Mar 12, 2009 at 6:25 AM, Bruno Borges bruno.bor...@gmail.com wrote: Yes, but the second endpoint doesn't get the message correctly as the file has already been pulled out. Are you using Camel 1.x? The file component has been totally rewritten in 2.0. You can then send to an intermediate endpoint and then multicast from it from(file).to(seda:foo); from(seda:foo).multicast().to(a, b, c); You can use the .convertBodyTo(String.class) if you want to load the file content and store that as payload instead of a java.io.File handle from(file).convertBodyTo(String.class).to(seda:foo); Bruno Borges blog.brunoborges.com.br +55 21 76727099 The glory of great men should always be measured by the means they have used to acquire it. - Francois de La Rochefoucauld On Thu, Mar 12, 2009 at 1:31 AM, Claus Ibsen claus.ib...@gmail.com wrote: On Wed, Mar 11, 2009 at 9:18 PM, Bruno Borges bruno.bor...@gmail.com wrote: What is the best option to do a multicasting from a file polling endpoint? Do you care to explain a bit more in details what you excacty mean? Using this will send the same message to a,b and c simultaneously: from(file).multicast().to(a, b, c); Bruno Borges blog.brunoborges.com.br +55 21 76727099 The glory of great men should always be measured by the means they have used to acquire it. - Francois de La Rochefoucauld Sent from: Rio de janeiro Rj Brazil. -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: Restlet component and alternate character sets
On Thu, Mar 12, 2009 at 6:24 PM, nojonojo n0...@yahoo.com wrote: It appears to me that the Restlet component doesn't support character sets other than the default. In general, Camel uses the Exchange.CHARSET_NAME property in the Exchange to determine which character set to use in conversions between binary and String representations. The DefaultRestletBinding doesn't pass this information on to the Restlet library in the populateRestletResponseFromExchange method. A simple change makes this work. Applying the following diff passes the charset information onto the Restlet component properly: 217a218,221 if (exchange.getProperty(Exchange.CHARSET_NAME) != null) { response.getEntity().setCharacterSet(CharacterSet.valueOf(exchange.getProperty(Exchange.CHARSET_NAME, String.class))); } This sets the characterset for the Restlet representation at the very end of the populateRestletResponseFromExchange method. Good spot I am sure Willem Tam can fix this as he doing most of this camel component. And it should be backported to 1.6.1 as well. Thanks. Nolan -- View this message in context: http://www.nabble.com/Restlet-component-and-alternate-character-sets-tp22481379p22481379.html Sent from the Camel - Users (activemq) mailing list archive at Nabble.com. -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: Problem with IdempotentConsumer
On Thu, Mar 12, 2009 at 6:59 PM, chrajanirao rajan...@gmail.com wrote: Thanks Claus. Do you know when is Camel 2.0 scheduled to be released? See the other thread on the 2.0M1 release - eg the first milestone of 2.0. We hope to be able to release 2.0 within 1-2 months, eg sooner the better. But we still need a little time to get the API settled. When 2.0 is out its much harder to change the API as it needs to be compatible. -- View this message in context: http://www.nabble.com/Problem-with-IdempotentConsumer-tp22467720p22482175.html Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: jetty-component : many context paths
On Fri, Mar 13, 2009 at 8:32 AM, pevgen pev...@km.ru wrote: Thank you, Bruno. But i think, that i could't explain my problem :) if i create a direct:path (like jetty:http://localhost:1234/base;), then all requests like ...base/blablabla can't process by the jetty endpoint. i want create http-router and route in-messages like if path1 then { process1();} if path2 { process2();} ... where path1 and path2 are context-paths I do not think camel-jetty supports multiple context paths on the same jetty server. eg as a workaround you can have multiple jetty servers using different port numbers. But feel free to create a JIRA ticket for the RFE so we can support multiple content paths for the same jetty server. http://camel.apache.org/support.html There are any councils ? Evgeny Bruno Borges wrote: Isn't possible to do a direct:path and from there you multicast to other endpoints? Like: from(some:where).to(direct:path); String[] paths = getJettyPaths(); from(direct:path).multicast(paths); How about this? Bruno Borges blog.brunoborges.com.br +55 21 76727099 The glory of great men should always be measured by the means they have used to acquire it. - Francois de La Rochefoucauld Sent from: Rio de janeiro Rj Brazil. On Thu, Mar 12, 2009 at 1:32 PM, pevgen pev...@km.ru wrote: Hello. How can i get a jetty-endpoint with many context paths ? for example, i want to get requests on http://localhost:1234/base/path1and http://localhost:1234/base/path2. but 'path1' and 'path2' are runtime paths (from 1 to many :)). if i configured the endpoint as jetty:http://localhost:1234/base;, then i got jetty http 404 error. Thanks Evgeny -- View this message in context: http://www.nabble.com/jetty-component-%3A-many-context-paths-tp22479524p22479524.html Sent from the Camel - Users mailing list archive at Nabble.com. - Bruno Borges blog.brunoborges.com.br +55 21 76727099 The glory of great men should always be measured by the means they have used to acquire it. - Francois de La Rochefoucauld -- View this message in context: http://www.nabble.com/jetty-component-%3A-many-context-paths-tp22479524p22491491.html Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: How do I filter out unwanted header properties propergated in route
On Fri, Mar 13, 2009 at 1:08 PM, AHardy alan.ha...@db.com wrote: Apache Camel has been a revelation in componentising flow based applications. Although getting started has been a hair pulling exercise at times..but definitely rewarding. I have the following route defined from(imap:mailhost).process(new AttachmentProcessor).to(bean:translate).to(jms:queue:output) When I inspect the JMS header of published message, it contains unwanted properties propergated by camel from original email along with processing involved in the route. Example Properties={ to={String:us...@abc.com, us...@abc.com} org_apache_camel_splitSize={Integer:43} precedence={String:list} subject={String:Subject line from email} org_apache_camel_MultiParameterArray={String:false} from={String:us...@abc.com} org_apache_camel_splitCounter={Integer:12} How do I prevent these internal headers being copied into JMS header? If you need to remove a single header then there is a removeHeader DSL node. However since there are many you can use a processor or bean to do a bit of java code eg to remove them all exchange.getIn().setHeaders(null); You can also set a new HeaderFilterStrategy on your JMS endpoint that can do the filtering. -- View this message in context: http://www.nabble.com/How-do-I-filter-out-unwanted-header-properties-propergated-in-route-tp22495164p22495164.html Sent from the Camel - Users (activemq) mailing list archive at Nabble.com. -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: Delayer: Transport disposed at JVM-Shutdown
On Fri, Mar 13, 2009 at 5:56 PM, Markus Reil gistenju...@gmx.de wrote: Hi, does anyone have an idea here please? I tried to configure a global errorHandler like errorHandler(loggingErrorHandler(com.kekaya.activemq)); or errorHandler(deadLetterChannel(direct:err).maximumRedeliveries(0)); but the Exception still gets processed by camel's default DeadLetterChannel. If you do NOT way any error handling in camel just set the error handler to no error handler :) Yeah maybe we need a nicer DSL for disabling it errorHandler(noErrorHandler()); Setting up a custom ExceptionListener did not change anything. What do you mean? A onException or what? Any help is appreciated. Cheers, Markus -- View this message in context: http://www.nabble.com/Delayer%3A-%22Transport-disposed%22-at-JVM-Shutdown-tp22202167p22500700.html Sent from the Camel - Users (activemq) mailing list archive at Nabble.com. -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: camel-activemq java.util.Map over JMS
On Sun, Mar 15, 2009 at 3:38 AM, mam1 dbra...@novator.com wrote: Hi. I have a problem using camel activemq/jms components. I used to have a low level socket communication using Java serialization. One of responses contained a Serializable object that had a MapLong, ListLong as its member. There is a ticket for RFE to allow setting which JMS message type should be used http://issues.apache.org/activemq/browse/CAMEL-898 So you can force it to use serialization using ObjectMessage. When I use camel activemq/jms the returned object contains a MapString, ListLong. Did anybody encounter similar problem? Is it possible to configure jms/activemq to use Java serialization? Any ideas. BTW using jms/activemq on both (client/server) sides of the channel results in aforementioned behavior only on the client side. Server side accepts MapLong, ListLong parameter as expected. So are you saying that when you use request-reply with JMS using Camel on both client + server with AMQ, the response the client recieves is suddenly with String in the Map? You are welcome to put together a little .zip with a demo that demonstrates this issue. That would be great for investigation in the camel-jms codebase. Camel configuration is as following: client: camel:camelContext trace=true camel:proxy id=test_remoting_service_proxy serviceInterface=a.b.c.TestService serviceUrl=activemq:queue:test.serviceQueue?exchangePattern=InOut/ /camel:camelContext server: camel:camelContext camel:export id=remoting_service serviceRef=test_remoting_service serviceInterface=a.b.c.TestService uri=activemq:queue:test.serviceQueue?exchangePattern=InOut / /camel:camelContext beans:bean id=test_remoting_service class=a.b.c.TestServiceImpl/ broker:broker useJmx=false persistent=false brokerName=localhost cacheTempDestinations=true enableStatistics=false broker:transportConnectors broker:transportConnector name=tcp uri=tcp://localhost:61616?trace=true/ /broker:transportConnectors /broker:broker !-- configure the activemq component -- beans:bean id=activemq class=org.apache.activemq.camel.component.ActiveMQComponent beans:property name=maxConcurrentConsumers value=10/ beans:property name=deliveryPersistent value=true/ beans:property name=concurrentConsumers value=5/ beans:property name=cacheLevelName value=CACHE_CONNECTION/ beans:property name=connectionFactory beans:bean class=org.apache.activemq.spring.ActiveMQConnectionFactory beans:property name=brokerURL value=tcp://localhost:61616/ /beans:bean /beans:property /beans:bean Thanks in advance. -- View this message in context: http://www.nabble.com/camel-activemq-java.util.Map-over-JMS-tp22519506p22519506.html Sent from the Camel - Users (activemq) mailing list archive at Nabble.com. -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: camel-activemq java.util.Map over JMS
Hi The problem is that you use Map as the type. And thus Camel wants to use javax.jms.MapMessage as the JMS type to send the message between the client/server. And the JMS MapMessage store all its keys as String objects http://java.sun.com/javaee/5/docs/api/javax/jms/MapMessage.html So you should send it as ObjectMessage instead. However as Camel select the type it want to use itself, then you cannot currently control the behavior. As a workaround you can use other types, eg a custom Object instead. The RFE to allow you to choose the type is this ticket: https://issues.apache.org/activemq/browse/CAMEL-898 On Sun, Mar 15, 2009 at 2:29 PM, mam1 dbra...@novator.com wrote: mam1 wrote: Hi. I have a problem using camel activemq/jms components. I used to have a low level socket communication using Java serialization. One of responses contained a Serializable object that had a MapLong, ListLong as its member. When I use camel activemq/jms the returned object contains a MapString, ListLong. Did anybody encounter similar problem? Is it possible to configure jms/activemq to use Java serialization? Any ideas. BTW using jms/activemq on both (client/server) sides of the channel results in aforementioned behavior only on the client side. Server side accepts MapLong, ListLong parameter as expected. Camel configuration is as following: client: camel:camelContext trace=true camel:proxy id=test_remoting_service_proxy serviceInterface=a.b.c.TestService serviceUrl=activemq:queue:test.serviceQueue?exchangePattern=InOut/ /camel:camelContext server: camel:camelContext camel:export id=remoting_service serviceRef=test_remoting_service serviceInterface=a.b.c.TestService uri=activemq:queue:test.serviceQueue?exchangePattern=InOut / /camel:camelContext beans:bean id=test_remoting_service class=a.b.c.TestServiceImpl/ broker:broker useJmx=false persistent=false brokerName=localhost cacheTempDestinations=true enableStatistics=false broker:transportConnectors broker:transportConnector name=tcp uri=tcp://localhost:61616?trace=true/ /broker:transportConnectors /broker:broker !-- configure the activemq component -- beans:bean id=activemq class=org.apache.activemq.camel.component.ActiveMQComponent beans:property name=maxConcurrentConsumers value=10/ beans:property name=deliveryPersistent value=true/ beans:property name=concurrentConsumers value=5/ beans:property name=cacheLevelName value=CACHE_CONNECTION/ beans:property name=connectionFactory beans:bean class=org.apache.activemq.spring.ActiveMQConnectionFactory beans:property name=brokerURL value=tcp://localhost:61616/ /beans:bean /beans:property /beans:bean Thanks in advance. Thank you for quick reply. I am attaching a small demonstration zip. I forgot to mention that i was using camel 1.6.0 and Spring 2.5.5 http://www.nabble.com/file/p22523230/camel-activemq-test.zip camel-activemq-test.zip -- View this message in context: http://www.nabble.com/camel-activemq-java.util.Map-over-JMS-tp22519506p22523230.html Sent from the Camel - Users (activemq) mailing list archive at Nabble.com. -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: camel-activemq java.util.Map over JMS
On Mon, Mar 16, 2009 at 9:46 AM, Claus Ibsen claus.ib...@gmail.com wrote: Hi The problem is that you use Map as the type. And thus Camel wants to use javax.jms.MapMessage as the JMS type to send the message between the client/server. And the JMS MapMessage store all its keys as String objects http://java.sun.com/javaee/5/docs/api/javax/jms/MapMessage.html So you should send it as ObjectMessage instead. However as Camel select the type it want to use itself, then you cannot currently control the behavior. As a workaround you can use other types, eg a custom Object instead. The RFE to allow you to choose the type is this ticket: https://issues.apache.org/activemq/browse/CAMEL-898 I have just committed this into trunk. So it will be part of Camel 2.0 Then you should be able to send you Map as an Object and thus preserve your keys as Long types. On Sun, Mar 15, 2009 at 2:29 PM, mam1 dbra...@novator.com wrote: mam1 wrote: Hi. I have a problem using camel activemq/jms components. I used to have a low level socket communication using Java serialization. One of responses contained a Serializable object that had a MapLong, ListLong as its member. When I use camel activemq/jms the returned object contains a MapString, ListLong. Did anybody encounter similar problem? Is it possible to configure jms/activemq to use Java serialization? Any ideas. BTW using jms/activemq on both (client/server) sides of the channel results in aforementioned behavior only on the client side. Server side accepts MapLong, ListLong parameter as expected. Camel configuration is as following: client: camel:camelContext trace=true camel:proxy id=test_remoting_service_proxy serviceInterface=a.b.c.TestService serviceUrl=activemq:queue:test.serviceQueue?exchangePattern=InOut/ /camel:camelContext server: camel:camelContext camel:export id=remoting_service serviceRef=test_remoting_service serviceInterface=a.b.c.TestService uri=activemq:queue:test.serviceQueue?exchangePattern=InOut / /camel:camelContext beans:bean id=test_remoting_service class=a.b.c.TestServiceImpl/ broker:broker useJmx=false persistent=false brokerName=localhost cacheTempDestinations=true enableStatistics=false broker:transportConnectors broker:transportConnector name=tcp uri=tcp://localhost:61616?trace=true/ /broker:transportConnectors /broker:broker !-- configure the activemq component -- beans:bean id=activemq class=org.apache.activemq.camel.component.ActiveMQComponent beans:property name=maxConcurrentConsumers value=10/ beans:property name=deliveryPersistent value=true/ beans:property name=concurrentConsumers value=5/ beans:property name=cacheLevelName value=CACHE_CONNECTION/ beans:property name=connectionFactory beans:bean class=org.apache.activemq.spring.ActiveMQConnectionFactory beans:property name=brokerURL value=tcp://localhost:61616/ /beans:bean /beans:property /beans:bean Thanks in advance. Thank you for quick reply. I am attaching a small demonstration zip. I forgot to mention that i was using camel 1.6.0 and Spring 2.5.5 http://www.nabble.com/file/p22523230/camel-activemq-test.zip camel-activemq-test.zip -- View this message in context: http://www.nabble.com/camel-activemq-java.util.Map-over-JMS-tp22519506p22523230.html Sent from the Camel - Users (activemq) mailing list archive at Nabble.com. -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: Delayer: Transport disposed at JVM-Shutdown
On Mon, Mar 16, 2009 at 3:34 PM, Markus Reil gistenju...@gmx.de wrote: Claus Ibsen-2 wrote: Which version of Camel are you using? And are you sure there is a message in delay in Camel, while you shutdown? Are you also using JMS? I'm using 1.5.0 at the moment and I'm sure the message is in delay: [15:27:03.598] [DEBUG] [DelayRoutes] Save exchange to wait queue I shutdown here... [15:27:33.656] [DEBUG] [DelayRoutes] Message will be sent to target queue (activemq:queue:queue.profileComputation.out). And yes, I am using JMS. The fix is in 2.0-SNAPSHOT. Or the 2.0M1 that is published on the central maven repo later today. I just tried apache-camel-2.0-20090311.162311-1.tar.gz and I still don't see the Interrupted log message. I do not get the Transport disposed exception anymore but the server won't shutdown at all. Last log lines are: [15:27:10.613] [ INFO] [org.apache.camel.impl.DefaultCamelContext] Apache Camel (CamelContext:null) is stopping [15:27:33.655] [DEBUG] [com.kekaya.activemq.DelayRoutes] headers: properties:{CamelBeanHolder=Routes: [], kekayaExecTime=1237213653596} headers:{JMSCorrelationID=null, JMSMessageID=ID:localhost-59869-1237213501544-2:0:1:1:1, JMSExpiration=0, kekayaDelay=30, kekayaPass=2, JMSDeliveryMode=2, kekayaExecTime=1237213653596, JMSPriority=4, kekayaId=3, JMSTimestamp=1237213623616, JMSReplyTo=null, JMSDestination=queue://queue.profileComputation.wait, JMSXGroupID=null, JMSType=null, JMSRedelivered=false} [15:27:33.656] [DEBUG] [com.kekaya.activemq.DelayRoutes] Message will be sent to target queue (activemq:queue:queue.profileComputation.out). [15:27:33.657] [DEBUG] [org.apache.camel.impl.DefaultComponent] Creating endpoint uri=[activemq:queue:queue.profileComputation.out], path=[queue:queue.profileComputation.out], parameters=[{}] [15:27:33.657] [DEBUG] [org.apache.camel.impl.DefaultCamelContext] [] activemq:queue:queue.profileComputation.out converted to endpoint: Endpoint[activemq:queue:queue.profileComputation.out] by component: org.apache.camel.component.jms.jmscompon...@1eb2e9f -- View this message in context: http://www.nabble.com/Delayer%3A-%22Transport-disposed%22-at-JVM-Shutdown-tp22202167p22539534.html Sent from the Camel - Users (activemq) mailing list archive at Nabble.com. -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: process() not called when mime type in Base64
On Mon, Mar 16, 2009 at 4:38 PM, AHardy alan.ha...@db.com wrote: Correction, the process() component is called! The Base64 convertor being selected does not popluate Exchange.getIn.getAttachments. Is this correct? That could be. Can you try debugging the code and look for yourself what happens -- View this message in context: http://www.nabble.com/process%28%29-not-called-when-mime-type-in-Base64-tp22539655p22540805.html Sent from the Camel - Users (activemq) mailing list archive at Nabble.com. -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: Camel 1.6.1-SNAPSHOT
Hi The move to top level project at apache kinda killed the 1.6.x-SNAPSHOT. I have no timeline when it will be back, or back if ever. On Mon, Mar 16, 2009 at 1:24 PM, Guillaume Renault guillaume.rena...@bull.net wrote: Hi all, I was wondering if a Camel 1.6.1-SNAPSHOT version is available through the SNAPSHOT maven repository (http://people.apache.org/repo/m2-snapshot-repository/org/apache/camel/) ... ? When i checked, i only found the 2.0-SNAPSHOT version, and an empty dir for the 1.5-SNAPSHOT one :) Cheers, Guillaume -- Guillaume Renault - BULL Service BULL - Architect of an Open World Email : guillaume.rena...@bull.net Tel : +334 76 29 71 09 Office : B1-295 Web : http://jasmine.ow2.org web : http://jonas.ow2.org (\ _ /) (='.'=) ()-() -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: Mutual SSL authentication with Camel applications
Hi Have you tried the AMQ forum to see if there is a solution that works with AMQ only? Then we know its possible and can see if there is something needed to be changed in camel-jms or maybe in the activemq-camel component that is shipped with AMQ itself. On Fri, Mar 13, 2009 at 7:39 AM, huntc hu...@mac.com wrote: By the way, here are some of the things I'm observing when attempting mutual authentication: 1. Wireshark shows: Client Hello Server Hello, Certificate, Certificate Request, Server Hello Done Certificate, Client Key Exchange Alert (Level: Fatal, Description: Bad Certificate) If I look at the Certificate, Client Key Exchange in detail I see in the Handshake Protocol: Certificate that the Certificates Length is 0. 2. ActiveMQ shows in its log: ERROR TransportConnector - Could not accept connection : null cert chain I'm presuming that this is because the client has not passed its certificate. I hope that these are useful observations. -- View this message in context: http://www.nabble.com/Mutual-SSL-authentication-with-Camel-applications-tp22490614p22491057.html Sent from the Camel - Users (activemq) mailing list archive at Nabble.com. -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: StreamCaching in Camel 1.6
On Fri, Mar 6, 2009 at 1:46 PM, _Jens jens.riemschnei...@icw.de wrote: Hi, first of all, thanks to both of you, Gert and Willem, for the quick replies. I saw that the jira was already fixed, great job. Does this mean that the methods for disabling stream caching will be removed in the future? I have tried to use noErrorHandler but there was a special case that used the default error handler at some point and I wasn't able to change this. A drilled down version of my scenario is shown in the test case below. It has to do with the choice and when elements in the route. They seem to introduce the standard error handler, as they don't inherit the configured one. The standard error handling then configures the route to use stream caching again. For some reason this only seems to happen if the JMX agent is disabled in the CamelContext, which I simulate by setting the system property. Of course, in our real scenario we simply disable it in the application context. So you are saying that with/without JMX it has an influence on your route? That is kinda odd, but there could be a gremlin. Need to check into this. �...@test public void testUploadFailsForBigFileWithNoErrorHandler() throws Exception { System.setProperty(JmxSystemPropertyKeys.DISABLED, true); DefaultCamelContext context = new DefaultCamelContext(); context.addRoutes(new RouteBuilder() { �...@override public void configure() throws Exception { errorHandler(noErrorHandler()); from(jetty:http://localhost:8989/bigfile;) .choice().when(header(foo).isEqualTo(bar)).to(direct:end) .otherwise().end(); from(direct:end) .process(new Processor() { public void process(Exchange exchange) throws Exception { InputStream inputStream = exchange.getIn().getBody(InputStream.class); while (inputStream.read() != -1) {} } }); } }); context.start(); HttpClient client = new HttpClient(); PostMethod method = new PostMethod(http://localhost:8989/bigfile;); File file = new File(c:\\temp\\test.bin.ok2); method.setRequestEntity(new FileRequestEntity(file, unknown/unknown)); assertEquals(200, client.executeMethod(method)); } -- View this message in context: http://www.nabble.com/StreamCaching-in-Camel-1.6-tp22305654p22371815.html Sent from the Camel - Users (activemq) mailing list archive at Nabble.com. -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: StreamCaching in Camel 1.6
Hi Just wanted to note that the bug is now fixed in the next release of Camel - 1.6.1 and 2.0 Thanks for reporting. On Tue, Mar 17, 2009 at 9:28 AM, Claus Ibsen claus.ib...@gmail.com wrote: Hi A quick test shows: JMX disabled: EventDrivenConsumerRoute[Endpoint[direct:start] - UnitOfWork(StreamCachingInterceptor(choice{when body contains Hello: Pipeline[DeadLetterChannel[sendTo(Endpoint[mock:hello]), log:org.apache.camel.DeadLetterChannel?level=error], DeadLetterChannel[StreamCachingInterceptor(choice{when body contains Bye: DeadLetterChannel[StreamCachingInterceptor(sendTo(Endpoint[mock:bye])), log:org.apache.camel.DeadLetterChannel?level=error]}), log:org.apache.camel.DeadLetterChannel?level=error]]}))] JMX enabled: EventDrivenConsumerRoute[Endpoint[direct:start] - UnitOfWork(Instrumentation(Instrumentation(choice{when body contains Hello: Pipeline[sendTo(Endpoint[mock:hello]), choice{when body contains Bye: sendTo(Endpoint[mock:bye])}]})))] So yeah there is a bug in Camel that is affected by the JMX. I will log a JIRA for this. https://issues.apache.org/activemq/browse/CAMEL-1463 On Tue, Mar 17, 2009 at 9:15 AM, Claus Ibsen claus.ib...@gmail.com wrote: On Fri, Mar 6, 2009 at 1:46 PM, _Jens jens.riemschnei...@icw.de wrote: Hi, first of all, thanks to both of you, Gert and Willem, for the quick replies. I saw that the jira was already fixed, great job. Does this mean that the methods for disabling stream caching will be removed in the future? I have tried to use noErrorHandler but there was a special case that used the default error handler at some point and I wasn't able to change this. A drilled down version of my scenario is shown in the test case below. It has to do with the choice and when elements in the route. They seem to introduce the standard error handler, as they don't inherit the configured one. The standard error handling then configures the route to use stream caching again. For some reason this only seems to happen if the JMX agent is disabled in the CamelContext, which I simulate by setting the system property. Of course, in our real scenario we simply disable it in the application context. So you are saying that with/without JMX it has an influence on your route? That is kinda odd, but there could be a gremlin. Need to check into this. �...@test public void testUploadFailsForBigFileWithNoErrorHandler() throws Exception { System.setProperty(JmxSystemPropertyKeys.DISABLED, true); DefaultCamelContext context = new DefaultCamelContext(); context.addRoutes(new RouteBuilder() { �...@override public void configure() throws Exception { errorHandler(noErrorHandler()); from(jetty:http://localhost:8989/bigfile;) .choice().when(header(foo).isEqualTo(bar)).to(direct:end) .otherwise().end(); from(direct:end) .process(new Processor() { public void process(Exchange exchange) throws Exception { InputStream inputStream = exchange.getIn().getBody(InputStream.class); while (inputStream.read() != -1) {} } }); } }); context.start(); HttpClient client = new HttpClient(); PostMethod method = new PostMethod(http://localhost:8989/bigfile;); File file = new File(c:\\temp\\test.bin.ok2); method.setRequestEntity(new FileRequestEntity(file, unknown/unknown)); assertEquals(200, client.executeMethod(method)); } -- View this message in context: http://www.nabble.com/StreamCaching-in-Camel-1.6-tp22305654p22371815.html Sent from the Camel - Users (activemq) mailing list archive at Nabble.com. -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: Mutual SSL authentication with Camel applications
On Tue, Mar 17, 2009 at 1:56 PM, huntc hu...@mac.com wrote: Here's the promised blog entry: http://christopherhunt-software.blogspot.com/2009/03/mutual-ssl-authentication-and-ldap.html Hi Thanks a lot for sharing this with us. Its been noticed by the AMQ committers. -- View this message in context: http://www.nabble.com/Mutual-SSL-authentication-with-Camel-applications-tp22490614p22558460.html Sent from the Camel - Users (activemq) mailing list archive at Nabble.com. -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: Wsdl file not find by cxf or camel-cxf endpoint in OSGI server ?
On Thu, Mar 19, 2009 at 1:35 AM, Willem Jiang willem.ji...@gmail.com wrote: Ah, another OSGi issue. Charles, you are exploring a new world with CXF and Camel. Please feel free to fill a JIRA when you get into trouble. Maybe we could use the OSGi resolver to look up the wsdl file. Since we just pass the wsdl location as a String into CXF in the camel-cxf component, we may need do some work on CXF side. Yeah in Camel 2.0 there is API on CamelContext to get a ClassResolver that can be injected with a OSGi aware. Please use this API to get hold of resolvers as it should then be the same API used by components. But the impl behind them can be OSGi specific, JBoss specifc, WebSphere specifc and the default ones, etc. Willem cmoulliard wrote: Hi, I have created two bundles : - one for the files generated by wsdl2java of CXF = bundle reportingincident.service (= bundle A) - and the other for my camel-context using these files = bundle reportingincident.camel (= bundle B) In the bundle A, I have created a directory under META-INF called wsdl where my reporting_incident.wsdl file is and exported the package (in this case, the wsdl file) using the syntax : Export-PackageMETA-INF.wsdl/Export-Package The bundle B imports the package META-INF.wsdl using the following syntax Import-PackageMETA-INF.wsdl/Import-Package Unfortunately, when Camel-cxf endpoint and CXF are created and started during the load of the camel-context, Cxf claims that it does not find the file under c:///apache-servicemix-kernet-1.1.0-SNAPSHOT/bin/reporting_incident.wsdl According to the documentation of camel-cxf endpoint, the wsdl file defined for the parameter wsdlUrl is loaded through the classpath. This is not the case here, why ? Regards, - Charles Moulliard SOA Architect My Blog : http://cmoulliard.blogspot.com/ http://cmoulliard.blogspot.com/ -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: process() not called when mime type in Base64
Hi Can you see the MailHtmlAttachmentTest unit test for inspiration. It does a send and receive a HTML mail with attachment. On Mon, Mar 16, 2009 at 5:16 PM, Claus Ibsen claus.ib...@gmail.com wrote: On Mon, Mar 16, 2009 at 4:38 PM, AHardy alan.ha...@db.com wrote: Correction, the process() component is called! The Base64 convertor being selected does not popluate Exchange.getIn.getAttachments. Is this correct? That could be. Can you try debugging the code and look for yourself what happens -- View this message in context: http://www.nabble.com/process%28%29-not-called-when-mime-type-in-Base64-tp22539655p22540805.html Sent from the Camel - Users (activemq) mailing list archive at Nabble.com. -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: References to objects processed in routes held, eventually run out of memory
Hi Can you try using bean(Object, methodname) in your route and pass in the same object, just to be sure its not Camel loading your bean constantly? And you are sure your bean in Spring XML is defined as singleton scope? In 2.0 I have adding TRACE logging to ObjectHelper.loadClass that loads a class. Then we will be able to TRACE if Camel is loading the same class over and over again. Another try is to use .process() instead of bean and put the code in there so you are sure the class is not loaded. On Thu, Mar 19, 2009 at 2:24 PM, ee7arh andrew.hu...@2e-systems.com wrote: Hi, Thanks for response. I'm using Camel 1.6.0 and ActiveMQ 5.2.0. I also had the same results with camel 1.5 and activeMQ 5.1 I have attached a graph from Jconsole showing what happens as the application starts, runs for a about 1.5 hours then crashes with out of memory. http://www.nabble.com/file/p22600122/jconsole-graphs.jpg Notes: - I set the maximum memory to 64MB using -Xmx64M -server. normally I would use more but then the problem takes longer to reproduce - Notice the number of loaded classes never reduces. I also have another application which shows the same pattern. - As the application starts to run out of memory, the CPU usage goes extremely high Here is my route: from(jms:queue:mobileExtTriggerInvites) .errorHandler(deadLetterChannel(seda:errors).maximumRedeliveries(0)) // Exception Handling .onException(JAXBException.class) .to(jms:queue:unmarshallableRequest).end() .onException(UnexpectedEventException.class) .to(jms:queue:unexpectedEvent).end() // Log Incoming XML .to(log:incomingEventXmlLogger?level=INFO) // Attempt to Unmarshall object expected on this queue .to(bean:eventMarshaller?methodName=unmarshallTriggerInvites) // Generate Service Events from this External Event .to(bean:serviceEventGenerator?methodName=procecssTriggerInvites) // Split generated Events out of List into individual events .splitter(body()) // Destination queue for further processing .to(jms:queue:serviceEventQueue); You can see that I have 2 bean processors, I have also attached the code for those. http://www.nabble.com/file/p22600122/EventMarhaller.txt EventMarhaller.txt http://www.nabble.com/file/p22600122/ServiceEventGenerator.txt ServiceEventGenerator.txt Perhaps it's useful, perhaps not but I read a blog article which sounded very similar to the problem I am having, link below. Basically it looks like Camel or ActiveMQ still has a reference to every single object I create and send through the routing - this would surely explain why the number of loaded classes gets bigger and bigger the more the application runs. http://dertompson.com/2007/08/01/fighting-the-outofmemoryerror/ http://dertompson.com/2007/08/01/fighting-the-outofmemoryerror using JConsole, I also periodically purged the end queue and this made no difference. If it helps, I am able to provide a heapdump to anyone for analysis with jHat. As mentioned in my 1st post, all instances of classes created during the application lifecycle continue to live on in memory. It appears that my objects are referenced by ActiveMQMessage For example, I will trace 1 of those classes created in code attached: Class: class com.ee.berbe.mobile.servicelogic.flightops.events.service.TriggerMMSInvitations References to this object: org.apache.activemq.command.activemqobjectmess...@0xafab8fd8 (174 bytes) : field object -- -- Class: class org.apache.activemq.command.ActiveMQObjectMessage References to this object: java.util.linkedhashmap$en...@0xafab8970 (32 bytes) : field value java.util.linkedhashmap$en...@0xafab8810 (32 bytes) : field value So it seems that ActiveMQ is still storing all my objets on a LinkedHashMap but I've no idea why. Thanks again for any help Andrew willem.jiang wrote: Hi Which version of Camel are you using ? Can you show us you routing rules and your processor codes? They will help us to dig the issue. Willem -- View this message in context: http://www.nabble.com/References-to-objects-processed-in-routes-held%2C-eventually-run-out-of-memory-tp22580791p22600122.html Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: Camel on OC4J with JMX problem
(WebApplicationBinder.java:99) at oracle.oc4j.admin.internal.ApplicationDeployer.bindWebApp(ApplicationDeployer.java:550) at oracle.oc4j.admin.internal.ApplicationDeployer.doDeploy(ApplicationDeployer.java:205) at oracle.oc4j.admin.internal.DeployerBase.execute(DeployerBase.java:93) at oracle.oc4j.admin.jmx.server.mbeans.deploy.OC4JDeployerRunnable.doRun(OC4JDeployerRunnable.java:52) at oracle.oc4j.admin.jmx.server.mbeans.deploy.DeployerRunnable.run(DeployerRunnable.java:81) at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:298) at java.lang.Thread.run(Thread.java:619) -- View this message in context: http://www.nabble.com/Camel-on-OC4J-with-JMX-problem-tp22625461p22625461.html Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: Questions about camel Exchange that contains a CxfMessage with POJO dataFormat
Hi Can we get a CfxConstants class/interface containing all the keys end users need to know about using camel-cxf? And org.apache.camel.component.cxf.DataFormat.class.getName() isn't the same as org.apache.camel.component.cxf.DataFormat ? And is there a compelling reason why this key hasn't been migrated to the new short form Camel 2.0 syntax? On Sun, Mar 22, 2009 at 5:49 AM, Willem Jiang willem.ji...@gmail.com wrote: Hi Michael, You can get the dataFromat info by checking the exchange's property. Camel 2.0 exchange.getProperty(org.apache.camel.component.cxf.DataFormat.class.getName()); For Camel 1.x, you may try to use this exchange.getProperty(org.apache.camel.component.cxf.CxfExchange.DATA_FORMAT); Willem Michael Ramnarine wrote: Thanks Willem, We were looking to write a custom processor that doesn't know ahead of time which dataFormat the client will be using to access the endpoint. Is there anything on the camel exchange or camel message or cxf message that we can check to at least tell which dataFormat is coming into the custom processor? I suppose we could check the class type of the exchange.getIn().getBody(), but can you think of a better way? -Mike -Original Message- From: Willem Jiang [mailto:willem.ji...@gmail.com] Sent: Friday, March 20, 2009 3:21 AM To: users@camel.apache.org Subject: Re: Questions about camel Exchange that contains a CxfMessage with POJO dataFormat Hi Michael, Since CXF using Stax to handle the XML message , it does not cache the whole xml message when it do the marshaling work. For the POJO Dataformate, you can't get the xml message from the CXFMessage instace, since the inputstream is consumed by the XMLStreamReader. Can I know the reason why are you want to get the xml message even you have the list of the request parameters ? Willem Michael Ramnarine wrote: One thing I just noticed... Using getContentFormats() on a POJO CxfMessage for a soap over http endpoint via: CxfMessage message = (CxfMessage) exchange.getIn() message.getMessage().getContentFormats() Returns: [interface java.util.List, class java.io.InputStream, interface javax.xml.stream.XMLStreamReader, interface org.w3c.dom.Node] Will one of these have the original xml message? How do I use these content formats to get that message in w3c format? -Mike From: Michael Ramnarine Sent: Thursday, March 19, 2009 10:46 PM To: 'users@camel.apache.org' Subject: Questions about camel Exchange that contains a CxfMessage with POJO dataFormat Is the original xml message available given a camel Exchange for a soap message that contains a CxfMessage with POJO dataFormat? Specifically, working in a custom processor, if the inbound message is a CxfMessage with MESSAGE dataFormat, the body is a copy of the original raw message (accessible via exchange.getIn().getBody()). However, if the inbound message is POJO dataFormat, then getBody() only returns a list containing the Java parameters for the operation being invoked. Is there anyway to get at the raw xml message when the inbound message is in POJO dataFormat? Also, is there a way to determine the dataFormat (MESSAGE, PAYLOAD, or POJO) from the camel Exchange or CxfMessage? -Mike -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/
Re: Apache Camel 2.0 M1-java.lang.ClassCastException: org.apache.camel.component.jms.JmsConfiguration$CamelJmsTeemplate102
Hi I have had a quick look and it looks like a bug in Camel. I have created a ticket for it https://issues.apache.org/activemq/browse/CAMEL-1480 Not many uses the old 1.0.2 JMS API hence not discovered before. If WebSphereMQ 5.3 support the new 1.1 JMS API then the MQ client .jars you have on your classpath must also be JMS 1.1 ready. But I will get a fix for the old 1.0.2 API. Then you can test it using a 2.0-SNAPSHOT version. See the Apache Camel downloads page for how to setup maven to look in the Apache SNAPSHOT repo. On Mon, Mar 23, 2009 at 7:56 PM, funkychap funkycha...@hotmail.com wrote: Hi, I only tried with camel 2. If you want me to try with lower versions, i can.Let me know. Thanks, Claus Ibsen-2 wrote: Hi The best solution would be if MQ can use JMS 1.1 api: You might need to setup the JMS connection factory in MQ to be JMS 1.1 as well. There might be some option in MQ somewhere to configure this. Did it work with Camel 1.x or have you only tried 2.0m1? I will look into this in the morning when I am at work again. Maybe there is something we can do in Camel to support good old IBM :) On Mon, Mar 23, 2009 at 7:33 PM, funkychap funkycha...@hotmail.com wrote: I got this when i tried it: 2009-03-23 13:31:25,636 INFO [org.apache.camel.processor.interceptor.TraceInterceptor] - ID-W2GZHS8301-1159-1237833080668-2-0 direct:CustomerService -- to(ibmmq://queue:My.QUEUE), Pattern:InOut, Headers:{content.type=text/xml, SOAPAction=}, BodyType:byte[], Body:soap:Envelope ./soap:Envelope Exception in thread main java.lang.AbstractMethodError: com.ibm.mq.jms.MQQueueConnectionFactory.createConnection()Ljavax/jms/Connection; at org.springframework.jms.support.JmsAccessor.createConnection(JmsAccessor.java:184) at org.springframework.jms.listener.AbstractJmsListeningContainer.createSharedConnection(AbstractJmsListeningContainer.java:378) at org.springframework.jms.listener.AbstractJmsListeningContainer.establishSharedConnection(AbstractJmsListeningContainer.java:346) at org.springframework.jms.listener.AbstractJmsListeningContainer.doStart(AbstractJmsListeningContainer.java:258) at org.springframework.jms.listener.SimpleMessageListenerContainer.doStart(SimpleMessageListenerContainer.java:175) at org.springframework.jms.listener.AbstractJmsListeningContainer.initialize(AbstractJmsListeningContainer.java:171) at org.springframework.jms.listener.AbstractJmsListeningContainer.afterPropertiesSet(AbstractJmsListeningContainer.java:134) at org.apache.camel.component.jms.requestor.Requestor.doStart(Requestor.java:205) at Claus Ibsen-2 wrote: Hi Can you try with JMS 1.1? useVersion102=false On Mon, Mar 23, 2009 at 7:05 PM, funkychap funkycha...@hotmail.com wrote: HI, I am trying to run the example provided in the camel manual. Better JMS Transport for CXF Webservice using Apache Camel. I made changes to the connection factory to point to the iBM MQ 5.3. I changed the wsdl to my service wsdl. When i am trying to run, i am getting the exception: 2009-03-23 12:18:09,322 ERROR [org.apache.camel.processor.DeadLetterChannel] - Failed delivery for exchangeId: ID-W2GZHS8301-4436-1237828678058-0-0. On delivery attempt: 5 caught: java.lang.ClassCastException: org.apache.camel.component.jms.JmsConfiguration$CamelJmsTeemplate102 java.lang.ClassCastException: org.apache.camel.component.jms.JmsConfiguration$CamelJmsTeemplate102 at org.apache.camel.component.jms.JmsProducer.process(JmsProducer.java:175) at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:68) at org.apache.camel.processor.DelegateProcessor.processNext(DelegateProcessor.java:49) at org.apache.camel.processor.DelegateProcessor.proceed(DelegateProcessor.java:78) at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:115) Any Ideas: My client.xml is listed below: bean id=ibmmq class=org.apache.camel.component.jms.JmsComponent property name=connectionFactory bean class=com.ibm.mq.jms.MQQueueConnectionFactory property name=transportType util:constant static-field=com.ibm.mq.jms.JMSC.MQJMS_TP_CLIENT_MQ_TCPIP/ /property property name=queueManager value=QM_w2gzhs8301/ property name=hostName value=XXX.XXX.XX.XX/ property name=port value=1414/ /bean /property property name=useVersion102 value=true / !--property name=messageConverter ref=messageConverter102/ --/bean bean id=messageConverter102 class=org.springframework.jms.support.converter.SimpleMessageConverter102