Re: Camel startup dependencies in OSGI/Karaf
This is exactly the way I was thinking: - Define a new interface representing a Camel component ( e g CamelComponentService) - Use a service property to identify the specific componente (e g "camel.component") This enables me to wait for a service with that specific service property to be available. E g in my case I'm using iPOJO to instantiate OSGI service and can use an annotation similar to the following: @Requires(filter={camel.component=file}) private CamelComponentService fileComponent; I didn't check that I used the right syntax above. However, the result is that my service will not be started until a CamelComponentService with the service property "camel.component" with the value "file" has been started. I think this would be very useful. It gives Camel a way to publish the availability of components to the outside world - and also a way to do it the OSGI way. /Bengt 2010/4/29 Guillaume Nodet : > We don't have to add anything to the component jars I think. It should be > possible to extend camel-osgi bundle in the following way: > * when a bundle containing a component is started, register a service in > the osgi registry for the component. I think it should be a new interface > which will allow the creation of components (a component factory) > registered with an asssociated property to identify the type of component > (file, jms, etc...) > * modify the osgi component resolver or camel context go to the registry > and wait for some time until all the components are available > The last part might be a bit more tricky, as we need to find a good strategy > for that. It could also be configurable on the osgi component context to > some degree. > > On Thu, Apr 29, 2010 at 04:30, Willem Jiang wrote: > >> Bengt Rodehav wrote: >> >>> Thanks for your reply Willem, >>> >>> I will try to the bundle dependency of camel-core to my route bundle >>> as you suggested - sounds like good advice. >>> >>> I wasn't sure what you mean by your last paragraph: >>> >>> If you need to dependent on some specify component interface will introduce the OSGi related dependency to the camel components. We need to find another way to do it. >>> >>> I assume that there was a problem with my suggestion but I didn't >>> quite understand what. >>> >> >> Oh, that is if you want to publish the camel components into a OSGi >> service, you can do it in the BundleActivator, or write some XML >> configuration to leverage Spring DM or Blue Print to do it. >> >> If you are using BundleActivator, you will introduce some kind of compile >> time dependency of OSGi jar. As we also want camel components work well as a >> stand alone Java application, we should avoid introduce this kind of >> dependency. >> >> Maybe the xml configuration is a choice for us. >> >> This solution need to your start the Spring-DM or BluePrint container >> before your camel route bundle to let the container lookup the bundle >> context for the xml configuration. It seems we are back to your original >> question. And if you start the camel components bundles before you start up >> your camel route bundle, you will not hit this kind of issue. >> >> Willem >> >> >> >>> /Bengt >>> >>> >>> >>> 2010/4/28 Willem Jiang : >>> Hi Please see my comments in the mail. Bengt Rodehav wrote: > I'm using Karaf to deploy my Camel routes. However, I run into > problems during startup due to dependency ordering. Some of these > ordering problems are OSGI/Karaf specific and have nothing to do with > Camel. I've discussed them on the Felix user mailing list and I have > workarounds for that. The Camel problems remain though. > > When trying to deploy both my routes and the camel bundles in Karaf, > my routes fail to iniitialize because the referenced camel component > ("file:" in this case) is not registered in Camel yet. I've tried to > solve this with workarounds in Karaf. It is possible but not very > elegant at all. > Can you add the bundle dependency of camel-core to your route bundle? > Guillaume Nodet (via us...@felix.apache.org) suggested to me that this > is more of a Camel problem than a Karaf problem. In his opinion (and > mine), it would be much better if Camel published components using > OSGI services. That way my services could have a service dependency on > the Camel services so that my service would start when the Camel > service was available. As I understand it, today Camel just scans > bundles as they are started and updates its component registry. This > makes it impossible for dependent bundles (like my routes) to know > whether all the required prerequisites are in place before starting > the route. > That could be a solution of your issue. > If components were published using a component specific interface, I > could add a service dependency to that service and wait until it >
Re: Camel startup dependencies in OSGI/Karaf
We don't have to add anything to the component jars I think. It should be possible to extend camel-osgi bundle in the following way: * when a bundle containing a component is started, register a service in the osgi registry for the component. I think it should be a new interface which will allow the creation of components (a component factory) registered with an asssociated property to identify the type of component (file, jms, etc...) * modify the osgi component resolver or camel context go to the registry and wait for some time until all the components are available The last part might be a bit more tricky, as we need to find a good strategy for that. It could also be configurable on the osgi component context to some degree. On Thu, Apr 29, 2010 at 04:30, Willem Jiang wrote: > Bengt Rodehav wrote: > >> Thanks for your reply Willem, >> >> I will try to the bundle dependency of camel-core to my route bundle >> as you suggested - sounds like good advice. >> >> I wasn't sure what you mean by your last paragraph: >> >> If you need to dependent on some specify component interface will >>> introduce >>> the OSGi related dependency to the camel components. >>> We need to find another way to do it. >>> >> >> I assume that there was a problem with my suggestion but I didn't >> quite understand what. >> > > Oh, that is if you want to publish the camel components into a OSGi > service, you can do it in the BundleActivator, or write some XML > configuration to leverage Spring DM or Blue Print to do it. > > If you are using BundleActivator, you will introduce some kind of compile > time dependency of OSGi jar. As we also want camel components work well as a > stand alone Java application, we should avoid introduce this kind of > dependency. > > Maybe the xml configuration is a choice for us. > > This solution need to your start the Spring-DM or BluePrint container > before your camel route bundle to let the container lookup the bundle > context for the xml configuration. It seems we are back to your original > question. And if you start the camel components bundles before you start up > your camel route bundle, you will not hit this kind of issue. > > Willem > > > >> /Bengt >> >> >> >> 2010/4/28 Willem Jiang : >> >>> Hi >>> >>> Please see my comments in the mail. >>> >>> Bengt Rodehav wrote: >>> I'm using Karaf to deploy my Camel routes. However, I run into problems during startup due to dependency ordering. Some of these ordering problems are OSGI/Karaf specific and have nothing to do with Camel. I've discussed them on the Felix user mailing list and I have workarounds for that. The Camel problems remain though. When trying to deploy both my routes and the camel bundles in Karaf, my routes fail to iniitialize because the referenced camel component ("file:" in this case) is not registered in Camel yet. I've tried to solve this with workarounds in Karaf. It is possible but not very elegant at all. >>> Can you add the bundle dependency of camel-core to your route bundle? >>> Guillaume Nodet (via us...@felix.apache.org) suggested to me that this is more of a Camel problem than a Karaf problem. In his opinion (and mine), it would be much better if Camel published components using OSGI services. That way my services could have a service dependency on the Camel services so that my service would start when the Camel service was available. As I understand it, today Camel just scans bundles as they are started and updates its component registry. This makes it impossible for dependent bundles (like my routes) to know whether all the required prerequisites are in place before starting the route. >>> That could be a solution of your issue. >>> If components were published using a component specific interface, I could add a service dependency to that service and wait until it becomes available before trying to start my routes. If you need to dependent on some specify component interface will >>> introduce >>> the OSGi related dependency to the camel components. >>> We need to find another way to do it. >>> >>> Has anyone else had similar issues?What is the recommended workaround? Are there any plans for improvement? /Bengt >>> Willem >>> >>> >> > -- Cheers, Guillaume Nodet Blog: http://gnodet.blogspot.com/ Open Source SOA http://fusesource.com
Re: Question on splitter
Hi, Please check out my comments in the mail. DaHoopster wrote: Hi, I am having trouble using the splitter. I think it's a very simple problem but I just can't figure what. I have tried a couple of way to split but no luck. Here is what I have: Method 1: = route config: from("activemq:queue:inputQueue?jmsMessageType=Object"). to("customSorter"). split(body()). to("activemq:queue:outputQueue?jmsMessageType=Text"); My customerSorter code: the object.getNumbers returns a list of MyNumber object public void process(Exchange exchange) throws Exception { final MyObject object = exchange.getIn().getBody(MyObject.class); final MyObject sorted = sort(object); exchange.getIn().setBody(object.getNumbers()); } For some reason, I am not getting anything on the output queue. I don't think camel know how to split the getNumbers of object. Method 2: = Route config: from("activemq:queue:inputQueue?jmsMessageType=Object"). to("customSorter"). split(new MySplitExpression()). to("activemq:queue:outputQueue?jmsMessageType=Text"); MySplitExpression: public T evaluate(final Exchange exchange, final Class tClass) { final MyObject myObject = exchange.getIn().copy().getBody(MyObject.class); final List answer = new LinkedList(); for (final MyNumber myNumber : inventory.getNumbers()) { final Message answerMessage = exchange.getIn().copy(); answerMessage.setBody(myNumber, MyNumber.class); System.out.println("=== splitting ==="); You didn't put the message into the answer list. } return (T) answer; } I am seeing the message being printed out but I still don't have any messages on the output queue. Could you help me see what's going on here? Thanks, Han Willem
Re: Question on splitter
On Thu, Apr 29, 2010 at 5:54 AM, DaHoopster wrote: > > Thanks for the reply Ashwin. > > No, MyObject is not serializable but it's annotated with XML annotations. > We are marshaling the object into XML messages and putting XML messages onto > the queues. > > The examples on the page you gave me don't work because the syntax are not > the same as the version of camel I am using, which is 2.2.6. So given that > we are using XML messages, is there a quick solution to the problem? > The splitter wiki page have an XML based example using XPath. > Here is what the message look like: > > > blaM/MyNumber> > blaM/MyNumber> > blaM/MyNumber> > blaM/MyNumber> > > > You may use an xpath expression, something like split(xpath("/MyObject/MyNumbers/MyNumber/text")). > > Thanks, > Han > > > Ashwin Karpe wrote: >> >> Hi, >> >> First of all, I assume that the MyObject class is serializable. >> >> Please check out the section "Using a Pojo to do the splitting" at the >> link >> http://camel.apache.org/splitter.html >> http://camel.apache.org/splitter.html >> >> There is a very good and straightforward example that can do the trick for >> you. >> >> What you need is to to take the object, split its payload, create a list >> of items and allow the splitter to take it from there. >> >> Cheers, >> >> Ashwin... >> >> >> >> DaHoopster wrote: >>> >>> Hi, >>> >>> I am having trouble using the splitter. I think it's a very simple >>> problem but I just can't figure what. I have tried a couple of way to >>> split but no luck. Here is what I have: >>> >>> Method 1: >>> = >>> route config: >>> >>> from("activemq:queue:inputQueue?jmsMessageType=Object"). >>> to("customSorter"). >>> split(body()). >>> to("activemq:queue:outputQueue?jmsMessageType=Text"); >>> >>> My customerSorter code: >>> >>> the object.getNumbers returns a list of MyNumber object >>> >>> public void process(Exchange exchange) throws Exception >>> { >>> final MyObject object = exchange.getIn().getBody(MyObject.class); >>> final MyObject sorted = sort(object); >>> exchange.getIn().setBody(object.getNumbers()); >>> } >>> >>> For some reason, I am not getting anything on the output queue. >>> >>> >>> Method 2: >>> = >>> >>> Route config: >>> >>> from("activemq:queue:inputQueue?jmsMessageType=Object"). >>> to("customSorter"). >>> split(new MySplitExpression()). >>> to("activemq:queue:outputQueue?jmsMessageType=Text"); >>> >>> MySplitExpression: >>> >>> public T evaluate(final Exchange exchange, final Class tClass) >>> { >>> final MyObject myObject = >>> exchange.getIn().copy().getBody(MyObject.class); >>> final List answer = new LinkedList(); >>> for (final MyNumber myNumber : inventory.getNumbers()) >>> { >>> final Message answerMessage = exchange.getIn().copy(); >>> answerMessage.setBody(myNumber, MyNumber.class); >>> System.out.println("=== splitting ==="); >>> } >>> return (T) answer; >>> } >>> >>> I am seeing the message being printed out but I still don't have any >>> messages on the output queue. >>> >>> Could you help me see what's going on here? >>> >>> Thanks, >>> Han >>> >> >> > > -- > View this message in context: > http://old.nabble.com/Question-on-splitter-tp28395839p28396442.html > Sent from the Camel - Users mailing list archive at Nabble.com. > > -- Claus Ibsen Apache Camel Committer Author of Camel in Action: http://www.manning.com/ibsen/ Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ Twitter: http://twitter.com/davsclaus
Re: Question on splitter
Thanks for the reply Ashwin. No, MyObject is not serializable but it's annotated with XML annotations. We are marshaling the object into XML messages and putting XML messages onto the queues. The examples on the page you gave me don't work because the syntax are not the same as the version of camel I am using, which is 2.2.6. So given that we are using XML messages, is there a quick solution to the problem? Here is what the message look like: blaM/MyNumber> blaM/MyNumber> blaM/MyNumber> blaM/MyNumber> Thanks, Han Ashwin Karpe wrote: > > Hi, > > First of all, I assume that the MyObject class is serializable. > > Please check out the section "Using a Pojo to do the splitting" at the > link > http://camel.apache.org/splitter.html > http://camel.apache.org/splitter.html > > There is a very good and straightforward example that can do the trick for > you. > > What you need is to to take the object, split its payload, create a list > of items and allow the splitter to take it from there. > > Cheers, > > Ashwin... > > > > DaHoopster wrote: >> >> Hi, >> >> I am having trouble using the splitter. I think it's a very simple >> problem but I just can't figure what. I have tried a couple of way to >> split but no luck. Here is what I have: >> >> Method 1: >> = >> route config: >> >> from("activemq:queue:inputQueue?jmsMessageType=Object"). >> to("customSorter"). >> split(body()). >> to("activemq:queue:outputQueue?jmsMessageType=Text"); >> >> My customerSorter code: >> >> the object.getNumbers returns a list of MyNumber object >> >> public void process(Exchange exchange) throws Exception >> { >> final MyObject object = exchange.getIn().getBody(MyObject.class); >> final MyObject sorted = sort(object); >> exchange.getIn().setBody(object.getNumbers()); >> } >> >> For some reason, I am not getting anything on the output queue. >> >> >> Method 2: >> = >> >> Route config: >> >> from("activemq:queue:inputQueue?jmsMessageType=Object"). >> to("customSorter"). >> split(new MySplitExpression()). >> to("activemq:queue:outputQueue?jmsMessageType=Text"); >> >> MySplitExpression: >> >> public T evaluate(final Exchange exchange, final Class tClass) >> { >> final MyObject myObject = >> exchange.getIn().copy().getBody(MyObject.class); >> final List answer = new LinkedList(); >> for (final MyNumber myNumber : inventory.getNumbers()) >> { >> final Message answerMessage = exchange.getIn().copy(); >> answerMessage.setBody(myNumber, MyNumber.class); >> System.out.println("=== splitting ==="); >> } >> return (T) answer; >> } >> >> I am seeing the message being printed out but I still don't have any >> messages on the output queue. >> >> Could you help me see what's going on here? >> >> Thanks, >> Han >> > > -- View this message in context: http://old.nabble.com/Question-on-splitter-tp28395839p28396442.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Question on splitter
Hi, First of all, I assume that the MyObject class is serializable. Please check out the section "Using a Pojo to do the splitting" at the link http://camel.apache.org/splitter.html http://camel.apache.org/splitter.html There is a very good and straightforward example that can do the trick for you. What you need is to to take the object, split its payload, create a list of items and allow the splitter to take it from there. Cheers, Ashwin... DaHoopster wrote: > > Hi, > > I am having trouble using the splitter. I think it's a very simple problem > but I just can't figure what. I have tried a couple of way to split but no > luck. Here is what I have: > > Method 1: > = > route config: > > from("activemq:queue:inputQueue?jmsMessageType=Object"). > to("customSorter"). > split(body()). > to("activemq:queue:outputQueue?jmsMessageType=Text"); > > My customerSorter code: > > the object.getNumbers returns a list of MyNumber object > > public void process(Exchange exchange) throws Exception > { > final MyObject object = exchange.getIn().getBody(MyObject.class); > final MyObject sorted = sort(object); > exchange.getIn().setBody(object.getNumbers()); > } > > For some reason, I am not getting anything on the output queue. > > > Method 2: > = > > Route config: > > from("activemq:queue:inputQueue?jmsMessageType=Object"). > to("customSorter"). > split(new MySplitExpression()). > to("activemq:queue:outputQueue?jmsMessageType=Text"); > > MySplitExpression: > > public T evaluate(final Exchange exchange, final Class tClass) > { > final MyObject myObject = > exchange.getIn().copy().getBody(MyObject.class); > final List answer = new LinkedList(); > for (final MyNumber myNumber : inventory.getNumbers()) > { > final Message answerMessage = exchange.getIn().copy(); > answerMessage.setBody(myNumber, MyNumber.class); > System.out.println("=== splitting ==="); > } > return (T) answer; > } > > I am seeing the message being printed out but I still don't have any > messages on the output queue. > > Could you help me see what's going on here? > > Thanks, > Han > - --- Ashwin Karpe, Sr. Principal Consultant, PS - Opensource Center of Competence Progress Software Corporation 14 Oak Park Drive Bedford, MA 01730 --- +1-972-304-9084 (Office) +1-972-971-1700 (Mobile) Blog: http://opensourceknowledge.blogspot.com/ -- View this message in context: http://old.nabble.com/Question-on-splitter-tp28395839p28396190.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Camel startup dependencies in OSGI/Karaf
Bengt Rodehav wrote: Thanks for your reply Willem, I will try to the bundle dependency of camel-core to my route bundle as you suggested - sounds like good advice. I wasn't sure what you mean by your last paragraph: If you need to dependent on some specify component interface will introduce the OSGi related dependency to the camel components. We need to find another way to do it. I assume that there was a problem with my suggestion but I didn't quite understand what. Oh, that is if you want to publish the camel components into a OSGi service, you can do it in the BundleActivator, or write some XML configuration to leverage Spring DM or Blue Print to do it. If you are using BundleActivator, you will introduce some kind of compile time dependency of OSGi jar. As we also want camel components work well as a stand alone Java application, we should avoid introduce this kind of dependency. Maybe the xml configuration is a choice for us. This solution need to your start the Spring-DM or BluePrint container before your camel route bundle to let the container lookup the bundle context for the xml configuration. It seems we are back to your original question. And if you start the camel components bundles before you start up your camel route bundle, you will not hit this kind of issue. Willem /Bengt 2010/4/28 Willem Jiang : Hi Please see my comments in the mail. Bengt Rodehav wrote: I'm using Karaf to deploy my Camel routes. However, I run into problems during startup due to dependency ordering. Some of these ordering problems are OSGI/Karaf specific and have nothing to do with Camel. I've discussed them on the Felix user mailing list and I have workarounds for that. The Camel problems remain though. When trying to deploy both my routes and the camel bundles in Karaf, my routes fail to iniitialize because the referenced camel component ("file:" in this case) is not registered in Camel yet. I've tried to solve this with workarounds in Karaf. It is possible but not very elegant at all. Can you add the bundle dependency of camel-core to your route bundle? Guillaume Nodet (via us...@felix.apache.org) suggested to me that this is more of a Camel problem than a Karaf problem. In his opinion (and mine), it would be much better if Camel published components using OSGI services. That way my services could have a service dependency on the Camel services so that my service would start when the Camel service was available. As I understand it, today Camel just scans bundles as they are started and updates its component registry. This makes it impossible for dependent bundles (like my routes) to know whether all the required prerequisites are in place before starting the route. That could be a solution of your issue. If components were published using a component specific interface, I could add a service dependency to that service and wait until it becomes available before trying to start my routes. If you need to dependent on some specify component interface will introduce the OSGi related dependency to the camel components. We need to find another way to do it. Has anyone else had similar issues?What is the recommended workaround? Are there any plans for improvement? /Bengt Willem
Re: Camel startup dependencies in OSGI/Karaf
Guillaume Nodet wrote: On Wed, Apr 28, 2010 at 17:30, Bengt Rodehav wrote: Thanks for your reply Willem, I will try to the bundle dependency of camel-core to my route bundle as you suggested - sounds like good advice. This won't work I think. The reason is that a camel component will only be used if the bundle containing the component is started. However, there is no way to express such a dependency on a "started" bundle in OSGi. Adding a bundle dependency will only ensure the bundle is resolved. Sorry, it's my bad, I missed the bundle dependency with the OSGi service dependencies. Willem I wasn't sure what you mean by your last paragraph: If you need to dependent on some specify component interface will introduce the OSGi related dependency to the camel components. We need to find another way to do it. I assume that there was a problem with my suggestion but I didn't quite understand what. /Bengt 2010/4/28 Willem Jiang : Hi Please see my comments in the mail. Bengt Rodehav wrote: I'm using Karaf to deploy my Camel routes. However, I run into problems during startup due to dependency ordering. Some of these ordering problems are OSGI/Karaf specific and have nothing to do with Camel. I've discussed them on the Felix user mailing list and I have workarounds for that. The Camel problems remain though. When trying to deploy both my routes and the camel bundles in Karaf, my routes fail to iniitialize because the referenced camel component ("file:" in this case) is not registered in Camel yet. I've tried to solve this with workarounds in Karaf. It is possible but not very elegant at all. Can you add the bundle dependency of camel-core to your route bundle? Guillaume Nodet (via us...@felix.apache.org) suggested to me that this is more of a Camel problem than a Karaf problem. In his opinion (and mine), it would be much better if Camel published components using OSGI services. That way my services could have a service dependency on the Camel services so that my service would start when the Camel service was available. As I understand it, today Camel just scans bundles as they are started and updates its component registry. This makes it impossible for dependent bundles (like my routes) to know whether all the required prerequisites are in place before starting the route. That could be a solution of your issue. If components were published using a component specific interface, I could add a service dependency to that service and wait until it becomes available before trying to start my routes. If you need to dependent on some specify component interface will introduce the OSGi related dependency to the camel components. We need to find another way to do it. Has anyone else had similar issues?What is the recommended workaround? Are there any plans for improvement? /Bengt Willem
Re: Cannot get Camel to work with Dovecot IMAP
Hi, You just put these jars into your classpath (replace the camel* jar with your version) aopalliance:aopalliance:jar:1.0:compile com.sun.xml.bind:jaxb-impl:jar:2.1.12:compile commons-logging:commons-logging:jar:1.1.1:test commons-logging:commons-logging-api:jar:1.1:compile javax.activation:activation:jar:1.1:compile javax.mail:mail:jar:1.4.3:compile javax.xml.bind:jaxb-api:jar:2.1:compile javax.xml.stream:stax-api:jar:1.0-2:compile log4j:log4j:jar:1.2.14:test org.apache.camel:camel-core:jar:2.3-SNAPSHOT:compile org.apache.camel:camel-spring:jar:2.3-SNAPSHOT:compile org.apache.camel:camel-mail:jar:2.3-SNAPSHOT:compile org.fusesource.commonman:commons-management:jar:1.0:compile org.springframework:spring-aop:jar:2.5.6:compile org.springframework:spring-beans:jar:2.5.6:compile org.springframework:spring-context:jar:2.5.6:compile org.springframework:spring-context-support:jar:2.5.6:compile org.springframework:spring-core:jar:2.5.6:compile org.springframework:spring-tx:jar:2.5.6:compile Willem Vilito Exquisitus wrote: Hi Willem, thanks for the reply. I was using the grails plugin which was using Camel 1.6.0. However, I decided to create a simple Java SE application using the latest Camel lib (2.2.0) and the latest mail.jar (1.4.3) from Sun JavaMail. After adding all the jars from the Camel distro (including optionals) and the mail.jar, I now get the following error: Exception in thread "main" java.lang.NoClassDefFoundError: org/springframework/mail/javamail/JavaMailSender According the the Spring documentation, two implementations of the MailSender API are shipped with Spring. Since I added every jar that was in the Camel distro, I am surprise to see that error message. The Camel distro includes some Spring jars. Here is my simple Java SE example program in a few lines. NOTE: This example tries to get Google mail since that had worked in the grails app: // --- public class Main { public static void main(String[] args) throws Exception { CamelContext camelContext = new DefaultCamelContext(); camelContext.addRoutes(new RouteBuilder(){ public void configure(){ from("imaps://imap.gmail.com?username=testuser&password=somepasswd").process(new Processor(){ public void process(Exchange exchng) throws Exception { System.out.println("Got MESSAGE from GMAIL."); System.out.println("->> mesg = " + exchng.getIn().getBody().toString()); } }); } }); camelContext.start(); } } willem.jiang wrote: Hi, Which version of Camel are you using? Which version of Mail jar are you using? There are some bugs with the Geronimo mail jar, so we switch to javax.mail last year, please make sure you are using the javax.mail.jar. Willem Vilito Exquisitus wrote: Hi all, I am having a problem doing something that seems rather simple, read email from an IMAP server (dovecot). I have dovecot deployed on a Ubuntu server and verified the setup using Thunderbird email client. I can send and receive emails from the test account. However, when I tried to get the emails from this account using Camel, it doesn't work. If I change the account setting to my gmail account, it works. So it seems like dovecot is working fine with an email client, and I have even tested it using telnet to list folders and that works too. I came here after googling abit and trying for a few hours. I hope I am not missing something obvious. Thanks a lot. .v the route is: from("imap://?username=testuser" + "&password=somepw&deleteProcessedMessages=false" + "&processOnlyUnseenMessages=true&consumer.delay=6") .process(new MyProcessor()); The class my processor is in Groovy: /// package com.esl.ecas.model.service; import org.apache.camel.Exchange; import org.apache.camel.Message; class MyProcessor implements org.apache.camel.Processor{ public void process(Exchange exchng) throws Exception { println("MyProcessor.process(): ${exchng}"); Message inMesg = exchng.getIn(); println("->In Message: ${inMesg}"); } }
Question on splitter
Hi, I am having trouble using the splitter. I think it's a very simple problem but I just can't figure what. I have tried a couple of way to split but no luck. Here is what I have: Method 1: = route config: from("activemq:queue:inputQueue?jmsMessageType=Object"). to("customSorter"). split(body()). to("activemq:queue:outputQueue?jmsMessageType=Text"); My customerSorter code: the object.getNumbers returns a list of MyNumber object public void process(Exchange exchange) throws Exception { final MyObject object = exchange.getIn().getBody(MyObject.class); final MyObject sorted = sort(object); exchange.getIn().setBody(object.getNumbers()); } For some reason, I am not getting anything on the output queue. Method 2: = Route config: from("activemq:queue:inputQueue?jmsMessageType=Object"). to("customSorter"). split(new MySplitExpression()). to("activemq:queue:outputQueue?jmsMessageType=Text"); MySplitExpression: public T evaluate(final Exchange exchange, final Class tClass) { final MyObject myObject = exchange.getIn().copy().getBody(MyObject.class); final List answer = new LinkedList(); for (final MyNumber myNumber : inventory.getNumbers()) { final Message answerMessage = exchange.getIn().copy(); answerMessage.setBody(myNumber, MyNumber.class); System.out.println("=== splitting ==="); } return (T) answer; } I am seeing the message being printed out but I still don't have any messages on the output queue. Could you help me see what's going on here? Thanks, Han -- View this message in context: http://old.nabble.com/Question-on-splitter-tp28395839p28395839.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Cannot get Camel to work with Dovecot IMAP
Hi Willem, thanks for the reply. I was using the grails plugin which was using Camel 1.6.0. However, I decided to create a simple Java SE application using the latest Camel lib (2.2.0) and the latest mail.jar (1.4.3) from Sun JavaMail. After adding all the jars from the Camel distro (including optionals) and the mail.jar, I now get the following error: Exception in thread "main" java.lang.NoClassDefFoundError: org/springframework/mail/javamail/JavaMailSender According the the Spring documentation, two implementations of the MailSender API are shipped with Spring. Since I added every jar that was in the Camel distro, I am surprise to see that error message. The Camel distro includes some Spring jars. Here is my simple Java SE example program in a few lines. NOTE: This example tries to get Google mail since that had worked in the grails app: // --- public class Main { public static void main(String[] args) throws Exception { CamelContext camelContext = new DefaultCamelContext(); camelContext.addRoutes(new RouteBuilder(){ public void configure(){ from("imaps://imap.gmail.com?username=testuser&password=somepasswd").process(new Processor(){ public void process(Exchange exchng) throws Exception { System.out.println("Got MESSAGE from GMAIL."); System.out.println("->> mesg = " + exchng.getIn().getBody().toString()); } }); } }); camelContext.start(); } } willem.jiang wrote: > > Hi, > > Which version of Camel are you using? > Which version of Mail jar are you using? > > There are some bugs with the Geronimo mail jar, so we switch to > javax.mail last year, please make sure you are using the javax.mail.jar. > > Willem > > > Vilito Exquisitus wrote: >> Hi all, >> >> I am having a problem doing something that seems rather simple, read >> email >> from an IMAP server (dovecot). I have dovecot deployed on a Ubuntu >> server >> and verified the setup using Thunderbird email client. I can send and >> receive emails from the test account. However, when I tried to get the >> emails from this account using Camel, it doesn't work. If I change the >> account setting to my gmail account, it works. >> >> So it seems like dovecot is working fine with an email client, and I have >> even tested it using telnet to list folders and that works too. I came >> here >> after googling abit and trying for a few hours. I hope I am not missing >> something obvious. >> >> Thanks a lot. >> >> .v >> >> the route is: >> from("imap://?username=testuser" + >> "&password=somepw&deleteProcessedMessages=false" + >> "&processOnlyUnseenMessages=true&consumer.delay=6") >> .process(new MyProcessor()); >> >> The class my processor is in Groovy: >> /// >> package com.esl.ecas.model.service; >> import org.apache.camel.Exchange; >> import org.apache.camel.Message; >> >> class MyProcessor implements org.apache.camel.Processor{ >> public void process(Exchange exchng) throws Exception { >> println("MyProcessor.process(): ${exchng}"); >> Message inMesg = exchng.getIn(); >> println("->In Message: ${inMesg}"); >> } >> } >> > > > -- View this message in context: http://old.nabble.com/Cannot-get-Camel-to-work-with-Dovecot-IMAP-tp28381349p28392140.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Apache Camel 2.3 - Pending SNAPSHOTs before release can be done
L.S., I'll start making sure that all these are building fine first now in order to get the release cut tomorrow or so Regards, Gert Vanthienen Open Source SOA: http://fusesource.com Blog: http://gertvanthienen.blogspot.com/ On 28 April 2010 17:56, Claus Ibsen wrote: > Hi > > We have some SNAPSHOT deps which we must have GA releases for before > we can do Apache Camel 2.3 release. > All those deps are OSGi bundles which are defined in the > /platforms/karaf/features/src/main/resources/feautures/xml file. > > Currently we have the following 6 SNAPSHOTs > > > camel-cometd > mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.cometd-java-server/1.0.1_1-SNAPSHOT > > camel-ftp > mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.jsch/0.1.42_1-SNAPSHOT > > camel-nagios > mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.jsendnsca-core/1.3.1_1-SNAPSHOT > > camel-xmpp > mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.smack/3.1.0_1-SNAPSHOT > > camel-bean-validator > mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.jsr303-api-1.0.0/1.5-SNAPSHOT > mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.hibernate-validator/4.0.2.GA_1-SNAPSHOT > > > We need the SMX team to get those bundles released and published to maven > repos. > > > -- > Claus Ibsen > Apache Camel Committer > > Author of Camel in Action: http://www.manning.com/ibsen/ > Open Source Integration: http://fusesource.com > Blog: http://davsclaus.blogspot.com/ > Twitter: http://twitter.com/davsclaus >
Apache Camel 2.3 - Pending SNAPSHOTs before release can be done
Hi We have some SNAPSHOT deps which we must have GA releases for before we can do Apache Camel 2.3 release. All those deps are OSGi bundles which are defined in the /platforms/karaf/features/src/main/resources/feautures/xml file. Currently we have the following 6 SNAPSHOTs camel-cometd mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.cometd-java-server/1.0.1_1-SNAPSHOT camel-ftp mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.jsch/0.1.42_1-SNAPSHOT camel-nagios mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.jsendnsca-core/1.3.1_1-SNAPSHOT camel-xmpp mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.smack/3.1.0_1-SNAPSHOT camel-bean-validator mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.jsr303-api-1.0.0/1.5-SNAPSHOT mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.hibernate-validator/4.0.2.GA_1-SNAPSHOT We need the SMX team to get those bundles released and published to maven repos. -- Claus Ibsen Apache Camel Committer Author of Camel in Action: http://www.manning.com/ibsen/ Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ Twitter: http://twitter.com/davsclaus
Re: Camel startup dependencies in OSGI/Karaf
On Wed, Apr 28, 2010 at 17:30, Bengt Rodehav wrote: > Thanks for your reply Willem, > > I will try to the bundle dependency of camel-core to my route bundle > as you suggested - sounds like good advice. > This won't work I think. The reason is that a camel component will only be used if the bundle containing the component is started. However, there is no way to express such a dependency on a "started" bundle in OSGi. Adding a bundle dependency will only ensure the bundle is resolved. > > I wasn't sure what you mean by your last paragraph: > > > If you need to dependent on some specify component interface will > introduce > > the OSGi related dependency to the camel components. > > We need to find another way to do it. > > I assume that there was a problem with my suggestion but I didn't > quite understand what. > > /Bengt > > > > 2010/4/28 Willem Jiang : > > Hi > > > > Please see my comments in the mail. > > > > Bengt Rodehav wrote: > >> > >> I'm using Karaf to deploy my Camel routes. However, I run into > >> problems during startup due to dependency ordering. Some of these > >> ordering problems are OSGI/Karaf specific and have nothing to do with > >> Camel. I've discussed them on the Felix user mailing list and I have > >> workarounds for that. The Camel problems remain though. > >> > >> When trying to deploy both my routes and the camel bundles in Karaf, > >> my routes fail to iniitialize because the referenced camel component > >> ("file:" in this case) is not registered in Camel yet. I've tried to > >> solve this with workarounds in Karaf. It is possible but not very > >> elegant at all. > > > > Can you add the bundle dependency of camel-core to your route bundle? > >> > >> Guillaume Nodet (via us...@felix.apache.org) suggested to me that this > >> is more of a Camel problem than a Karaf problem. In his opinion (and > >> mine), it would be much better if Camel published components using > >> OSGI services. That way my services could have a service dependency on > >> the Camel services so that my service would start when the Camel > >> service was available. As I understand it, today Camel just scans > >> bundles as they are started and updates its component registry. This > >> makes it impossible for dependent bundles (like my routes) to know > >> whether all the required prerequisites are in place before starting > >> the route. > > > > That could be a solution of your issue. > >> > >> If components were published using a component specific interface, I > >> could add a service dependency to that service and wait until it > >> becomes available before trying to start my routes. > >> > > > > If you need to dependent on some specify component interface will > introduce > > the OSGi related dependency to the camel components. > > We need to find another way to do it. > > > >> Has anyone else had similar issues?What is the recommended workaround? > >> Are there any plans for improvement? > >> > >> /Bengt > >> > > > > > > Willem > > > -- Cheers, Guillaume Nodet Blog: http://gnodet.blogspot.com/ Open Source SOA http://fusesource.com
Re: Camel startup dependencies in OSGI/Karaf
Thanks for your reply Willem, I will try to the bundle dependency of camel-core to my route bundle as you suggested - sounds like good advice. I wasn't sure what you mean by your last paragraph: > If you need to dependent on some specify component interface will introduce > the OSGi related dependency to the camel components. > We need to find another way to do it. I assume that there was a problem with my suggestion but I didn't quite understand what. /Bengt 2010/4/28 Willem Jiang : > Hi > > Please see my comments in the mail. > > Bengt Rodehav wrote: >> >> I'm using Karaf to deploy my Camel routes. However, I run into >> problems during startup due to dependency ordering. Some of these >> ordering problems are OSGI/Karaf specific and have nothing to do with >> Camel. I've discussed them on the Felix user mailing list and I have >> workarounds for that. The Camel problems remain though. >> >> When trying to deploy both my routes and the camel bundles in Karaf, >> my routes fail to iniitialize because the referenced camel component >> ("file:" in this case) is not registered in Camel yet. I've tried to >> solve this with workarounds in Karaf. It is possible but not very >> elegant at all. > > Can you add the bundle dependency of camel-core to your route bundle? >> >> Guillaume Nodet (via us...@felix.apache.org) suggested to me that this >> is more of a Camel problem than a Karaf problem. In his opinion (and >> mine), it would be much better if Camel published components using >> OSGI services. That way my services could have a service dependency on >> the Camel services so that my service would start when the Camel >> service was available. As I understand it, today Camel just scans >> bundles as they are started and updates its component registry. This >> makes it impossible for dependent bundles (like my routes) to know >> whether all the required prerequisites are in place before starting >> the route. > > That could be a solution of your issue. >> >> If components were published using a component specific interface, I >> could add a service dependency to that service and wait until it >> becomes available before trying to start my routes. >> > > If you need to dependent on some specify component interface will introduce > the OSGi related dependency to the camel components. > We need to find another way to do it. > >> Has anyone else had similar issues?What is the recommended workaround? >> Are there any plans for improvement? >> >> /Bengt >> > > > Willem >
Re: Camel startup dependencies in OSGI/Karaf
Hi Please see my comments in the mail. Bengt Rodehav wrote: I'm using Karaf to deploy my Camel routes. However, I run into problems during startup due to dependency ordering. Some of these ordering problems are OSGI/Karaf specific and have nothing to do with Camel. I've discussed them on the Felix user mailing list and I have workarounds for that. The Camel problems remain though. When trying to deploy both my routes and the camel bundles in Karaf, my routes fail to iniitialize because the referenced camel component ("file:" in this case) is not registered in Camel yet. I've tried to solve this with workarounds in Karaf. It is possible but not very elegant at all. Can you add the bundle dependency of camel-core to your route bundle? Guillaume Nodet (via us...@felix.apache.org) suggested to me that this is more of a Camel problem than a Karaf problem. In his opinion (and mine), it would be much better if Camel published components using OSGI services. That way my services could have a service dependency on the Camel services so that my service would start when the Camel service was available. As I understand it, today Camel just scans bundles as they are started and updates its component registry. This makes it impossible for dependent bundles (like my routes) to know whether all the required prerequisites are in place before starting the route. That could be a solution of your issue. If components were published using a component specific interface, I could add a service dependency to that service and wait until it becomes available before trying to start my routes. If you need to dependent on some specify component interface will introduce the OSGi related dependency to the camel components. We need to find another way to do it. Has anyone else had similar issues?What is the recommended workaround? Are there any plans for improvement? /Bengt Willem
Re: Camel : Nagios & Spring XML
Hi titexe, The tag does not exist but you can design your route in spring DSL like this : ... Kind regards, Charles Moulliard Senior Enterprise Architect (J2EE, .NET, SOA) Apache Camel Committer *** - Blog : http://cmoulliard.blogspot.com - Twitter : http://twitter.com/cmoulliard - Linkedlin : http://www.linkedin.com/in/charlesmoulliard On Wed, Apr 28, 2010 at 3:36 PM, titexe wrote: > > Hello, > > in the wiki page , i found the configuration of the Nagios component in DSL > ? > > it's possible to configure it , in the XML Spring ? > > Thanks in advance, > > > -- > View this message in context: > http://old.nabble.com/Camel-%3A-Nagios---Spring-XML-tp28387966p28387966.html > Sent from the Camel - Users mailing list archive at Nabble.com. > >
Camel : Nagios & Spring XML
Hello, in the wiki page , i found the configuration of the Nagios component in DSL ? it's possible to configure it , in the XML Spring ? Thanks in advance, -- View this message in context: http://old.nabble.com/Camel-%3A-Nagios---Spring-XML-tp28387966p28387966.html Sent from the Camel - Users mailing list archive at Nabble.com.
AW: activemq component MaxConnection retry
Hi, try Regards, Christoph -Ursprüngliche Nachricht- Von: ssenth [mailto:seshanmug...@eur.ko.com] Gesendet: Mittwoch, 28. April 2010 13:53 An: users@camel.apache.org Betreff: Re: activemq component MaxConnection retry Claus, Now the changed the bean definition as shown below But getting the below error(java.lang.IllegalArgumentException: Invalid connect parameters: {maxReconnectAttempts=3}). I Guess , can set the properties available in the ActiveMQConnectionFactory example sendTimeout, warnAboutUnstartedConnectionTimeout etc. Not sure how do we set the maxReconectAttempt when the connection is not available. or is there a perperyt in ActiveMQConnectionFactory which will restrict the number of reconnect attempts. org.springframework.jms.UncategorizedJmsException: Uncategorized exception occured during JMS processing; nested exception is javax.jms.JMSException: Could not create Transport. Reason: java.lang.IllegalArgumentException: Invalid connect parameters: {maxReconnectAttempts=3}at org.springframework.jms.support.JmsUtils.convertJmsAccessException(JmsUtils.java:308) at org.springframework.jms.support.JmsAccessor.convertJmsAccessException(JmsAccessor.java:168) at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:474) at org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate.send(JmsConfiguration.java:193) at org.apache.camel.component.jms.JmsProducer.doSend(JmsProducer.java:371) at org.apache.camel.component.jms.JmsProducer.processInOnly(JmsProducer.java:316) at org.apache.camel.component.jms.JmsProducer.process(JmsProducer.java:150) at org.apache.camel.processor.SendProcessor$1.doInProducer(SendProcessor.java:65) at org.apache.camel.processor.SendProcessor$1.doInProducer(SendProcessor.java:63) at org.apache.camel.impl.ProducerCache.doInProducer(ProducerCache.java:142) at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:62) at org.apache.camel.processor.interceptor.StreamCachingInterceptor.process(StreamCachingInterceptor.java:52) at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:61) at org.apache.camel.processor.RedeliveryErrorHandler.processExchange(RedeliveryErrorHandler.java:186) at org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:155) at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:88) at org.apache.camel.processor.DefaultErrorHandler.process(DefaultErrorHandler.java:49) at org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:148) at org.apache.camel.processor.Pipeline.process(Pipeline.java:73) at org.apache.camel.processor.UnitOfWorkProcessor.processNext(UnitOfWorkProcessor.java:54) at org.apache.camel.processor.DelegateProcessor.process(DelegateProcessor.java:48) at com.ko.bonpc.camel.C4BComponent.processForConsumers(C4BComponent.java:136) at com.ko.bonpc.camel.C4BComponent.send(C4BComponent.java:107) at com.ko.bonpc.camel.C4B.send(C4B.java:90) at com.ko.bonpc.test.camel.BonPCSendTestRunner.send(BonPCSendTestRunner.java:116) at com.ko.bonpc.test.camel.BonPCSendTestRunner.sendToBonPC(BonPCSendTestRunner.java:111) at com.ko.bonpc.test.camel.BonPCSendTestRunner.process(BonPCSendTestRunner.java:81) at com.ko.bonpc.test.camel.BonPCSendTestRunner.main(BonPCSendTestRunner.java:43) Caused by: javax.jms.JMSException: Could not create Transport. Reason: java.lang.IllegalArgumentException: Invalid connect parameters: {maxReconnectAttempts=3} at org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:35) at org.apache.activemq.ActiveMQConnectionFactory.createTransport(ActiveMQConnectionFactory.java:239) at org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:252) at org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:224) at org.apache.activemq.ActiveMQConnectionFactory.createConnection(ActiveMQConnectionFactory.java:172) at org.apache.activemq.pool.PooledConnectionFactory.createConnection(PooledConnectionFactory.java:125) at org.apache.activemq.pool.PooledConnectionFactory.createConnection(PooledConnectionFactory.java:110) at org.apache.activemq.pool.PooledConnectionFactory.createConnection(PooledConnectionFactory.java:81) at org.springframework.jms.support.JmsAccessor.createConnection(JmsAccessor.java:184) at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:461) ... 25 more Caused by: java.lang.IllegalArgumentException: Invalid connect parameters: {maxReconnectAttempts=3} at org.ap
Re: activemq component MaxConnection retry
Claus, Now the changed the bean definition as shown below But getting the below error(java.lang.IllegalArgumentException: Invalid connect parameters: {maxReconnectAttempts=3}). I Guess , can set the properties available in the ActiveMQConnectionFactory example sendTimeout, warnAboutUnstartedConnectionTimeout etc. Not sure how do we set the maxReconectAttempt when the connection is not available. or is there a perperyt in ActiveMQConnectionFactory which will restrict the number of reconnect attempts. org.springframework.jms.UncategorizedJmsException: Uncategorized exception occured during JMS processing; nested exception is javax.jms.JMSException: Could not create Transport. Reason: java.lang.IllegalArgumentException: Invalid connect parameters: {maxReconnectAttempts=3}at org.springframework.jms.support.JmsUtils.convertJmsAccessException(JmsUtils.java:308) at org.springframework.jms.support.JmsAccessor.convertJmsAccessException(JmsAccessor.java:168) at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:474) at org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate.send(JmsConfiguration.java:193) at org.apache.camel.component.jms.JmsProducer.doSend(JmsProducer.java:371) at org.apache.camel.component.jms.JmsProducer.processInOnly(JmsProducer.java:316) at org.apache.camel.component.jms.JmsProducer.process(JmsProducer.java:150) at org.apache.camel.processor.SendProcessor$1.doInProducer(SendProcessor.java:65) at org.apache.camel.processor.SendProcessor$1.doInProducer(SendProcessor.java:63) at org.apache.camel.impl.ProducerCache.doInProducer(ProducerCache.java:142) at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:62) at org.apache.camel.processor.interceptor.StreamCachingInterceptor.process(StreamCachingInterceptor.java:52) at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:61) at org.apache.camel.processor.RedeliveryErrorHandler.processExchange(RedeliveryErrorHandler.java:186) at org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:155) at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:88) at org.apache.camel.processor.DefaultErrorHandler.process(DefaultErrorHandler.java:49) at org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:148) at org.apache.camel.processor.Pipeline.process(Pipeline.java:73) at org.apache.camel.processor.UnitOfWorkProcessor.processNext(UnitOfWorkProcessor.java:54) at org.apache.camel.processor.DelegateProcessor.process(DelegateProcessor.java:48) at com.ko.bonpc.camel.C4BComponent.processForConsumers(C4BComponent.java:136) at com.ko.bonpc.camel.C4BComponent.send(C4BComponent.java:107) at com.ko.bonpc.camel.C4B.send(C4B.java:90) at com.ko.bonpc.test.camel.BonPCSendTestRunner.send(BonPCSendTestRunner.java:116) at com.ko.bonpc.test.camel.BonPCSendTestRunner.sendToBonPC(BonPCSendTestRunner.java:111) at com.ko.bonpc.test.camel.BonPCSendTestRunner.process(BonPCSendTestRunner.java:81) at com.ko.bonpc.test.camel.BonPCSendTestRunner.main(BonPCSendTestRunner.java:43) Caused by: javax.jms.JMSException: Could not create Transport. Reason: java.lang.IllegalArgumentException: Invalid connect parameters: {maxReconnectAttempts=3} at org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:35) at org.apache.activemq.ActiveMQConnectionFactory.createTransport(ActiveMQConnectionFactory.java:239) at org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:252) at org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:224) at org.apache.activemq.ActiveMQConnectionFactory.createConnection(ActiveMQConnectionFactory.java:172) at org.apache.activemq.pool.PooledConnectionFactory.createConnection(PooledConnectionFactory.java:125) at org.apache.activemq.pool.PooledConnectionFactory.createConnection(PooledConnectionFactory.java:110) at org.apache.activemq.pool.PooledConnectionFactory.createConnection(PooledConnectionFactory.java:81) at org.springframework.jms.support.JmsAccessor.createConnection(JmsAccessor.java:184) at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:461) ... 25 more Caused by: java.lang.IllegalArgumentException: Invalid connect parameters: {maxReconnectAttempts=3} at org.apache.activemq.transport.TransportFactory.doConnect(TransportFactory.java:144) at org.apache.activemq.transport.TransportFactory.doConnect(TransportFactory.java:51) at org.apache.activemq.transport.TransportFactory.connect(TransportFactory.java:80)
Camel startup dependencies in OSGI/Karaf
I'm using Karaf to deploy my Camel routes. However, I run into problems during startup due to dependency ordering. Some of these ordering problems are OSGI/Karaf specific and have nothing to do with Camel. I've discussed them on the Felix user mailing list and I have workarounds for that. The Camel problems remain though. When trying to deploy both my routes and the camel bundles in Karaf, my routes fail to iniitialize because the referenced camel component ("file:" in this case) is not registered in Camel yet. I've tried to solve this with workarounds in Karaf. It is possible but not very elegant at all. Guillaume Nodet (via us...@felix.apache.org) suggested to me that this is more of a Camel problem than a Karaf problem. In his opinion (and mine), it would be much better if Camel published components using OSGI services. That way my services could have a service dependency on the Camel services so that my service would start when the Camel service was available. As I understand it, today Camel just scans bundles as they are started and updates its component registry. This makes it impossible for dependent bundles (like my routes) to know whether all the required prerequisites are in place before starting the route. If components were published using a component specific interface, I could add a service dependency to that service and wait until it becomes available before trying to start my routes. Has anyone else had similar issues?What is the recommended workaround? Are there any plans for improvement? /Bengt
Re: activemq component MaxConnection retry
Hi I think you can put it in the brokerURL as a uri parameter as shown here http://camel.apache.org/activemq.html On Wed, Apr 28, 2010 at 11:35 AM, ssenth wrote: > > Hi, > I am using the below route to put the message in an ActiveMQ queue > > Bean Declaration class="org.apache.activemq.camel.component.ActiveMQComponent"> > > class="org.apache.activemq.ActiveMQConnectionFactory"/> > > > > Routing > > > > > > I did send two messages which reached the TargetQueue in ActiveMQ, but when > I stopped the activemq and send the third message, CAMLE did not time > out/stop instead it continuously tries to reconnect to ActiveMQ. Can any one > let me know how or hing on how to configure the route to stop the CAMEL > context after let's say 3 reconnect attempts and backup the message to a > folder. > > Did find maxReconnectAttempts and startupMaxReconnectAttempts in > org.apache.activemq.transport.failover.FailoverTransport , but could not > figure out how to set these properties. > > > Below is the log4jenties > > Time: 2:24:32 PM Priority: DEBUG Thread: ActiveMQ Task NDC: null > Category: org.apache.activemq.transport.failover.FailoverTransport Location: > org.apache.activemq.transport.failover.FailoverTransport.doReconnect(FailoverTransport.java:722) > Message: > Connect fail to: tcp://localhost:61616, reason: java.net.ConnectException: > Connection refused: connect > Throwable: > null > > Time: 2:24:32 PM Priority: DEBUG Thread: ActiveMQ Task NDC: null > Category: org.apache.activemq.transport.failover.FailoverTransport Location: > org.apache.activemq.transport.failover.FailoverTransport.doReconnect(FailoverTransport.java:756) > Message: > Waiting 3 ms before attempting connection. > Throwable: > null > > Time: 2:24:32 PM Priority: DEBUG Thread: main NDC: null Category: > org.apache.activemq.transport.failover.FailoverTransport Location: > org.apache.activemq.transport.failover.FailoverTransport.oneway(FailoverTransport.java:406) > Message: > Waiting for transport to reconnect. > Throwable: > null > -- > View this message in context: > http://old.nabble.com/activemq-component-MaxConnection-retry-tp28386612p28386612.html > Sent from the Camel - Users mailing list archive at Nabble.com. > > -- Claus Ibsen Apache Camel Committer Author of Camel in Action: http://www.manning.com/ibsen/ Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ Twitter: http://twitter.com/davsclaus
Bulk SMS Messages
Hello!! :-D I came across a cheap and reliable bulk sms service that covers 801 networks worldwide. All you need to do is sign up to power-bulk-sms.com and request a free demo SMPP, HTTP API or a Web account. You can send sms with PHP, ASP, ASP .NET, Java, SOAP and XML. It is a really great service and you should all check it out!! Moren Folkson.. -- View this message in context: http://old.nabble.com/Bulk-SMS-Messages-tp28387176p28387176.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: jetty:http component "mangles" x-www-form-urlencoded POST in message:
Willem Jiang wrote: greenstar wrote: willem.jiang wrote: I did some refactoring on current DefaultHttpBinding[1], now you can override the populateMessageHeader in your HttpBinding. [1] https://issues.apache.org/activemq/browse/CAMEL-2673 Perhaps DefaultHttpBinding should be changed to leave "application/x-www-form-urlencoded" POST bodies intact (of course it can still propagate form params to the camel message headers). This would be similar to the current querystring param behavior: these get propagated to the camel message, but they don't get stripped from the "original" querystring. Any downsides to this? The upside is less intrusive message modifications which can be pretty destructive to proxying applications. I agree with you and will cache the InputSteam before calling the Request.getParameterNames(). Willem I committed a patch for it[1], please check out the last camel 2.3-SNAPSHOT for verification. [1]https://issues.apache.org/activemq/browse/CAMEL-2679 Willem
activemq component MaxConnection retry
Hi, I am using the below route to put the message in an ActiveMQ queue Bean Declaration Routing I did send two messages which reached the TargetQueue in ActiveMQ, but when I stopped the activemq and send the third message, CAMLE did not time out/stop instead it continuously tries to reconnect to ActiveMQ. Can any one let me know how or hing on how to configure the route to stop the CAMEL context after let's say 3 reconnect attempts and backup the message to a folder. Did find maxReconnectAttempts and startupMaxReconnectAttempts in org.apache.activemq.transport.failover.FailoverTransport , but could not figure out how to set these properties. Below is the log4jenties Time: 2:24:32 PM Priority: DEBUG Thread: ActiveMQ Task NDC: null Category: org.apache.activemq.transport.failover.FailoverTransport Location: org.apache.activemq.transport.failover.FailoverTransport.doReconnect(FailoverTransport.java:722) Message: Connect fail to: tcp://localhost:61616, reason: java.net.ConnectException: Connection refused: connect Throwable: null Time: 2:24:32 PM Priority: DEBUG Thread: ActiveMQ Task NDC: null Category: org.apache.activemq.transport.failover.FailoverTransport Location: org.apache.activemq.transport.failover.FailoverTransport.doReconnect(FailoverTransport.java:756) Message: Waiting 3 ms before attempting connection. Throwable: null Time: 2:24:32 PM Priority: DEBUG Thread: main NDC: null Category: org.apache.activemq.transport.failover.FailoverTransport Location: org.apache.activemq.transport.failover.FailoverTransport.oneway(FailoverTransport.java:406) Message: Waiting for transport to reconnect. Throwable: null -- View this message in context: http://old.nabble.com/activemq-component-MaxConnection-retry-tp28386612p28386612.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Getting NullPointerException when talking to NMR Endpoint
HI, The CXF Bundle is deployed properly. I had these lines in the log files. Creating Service {http://impl.ws.esb.com/}PersonEndPointImplImplService from class com.esb.ws.impl.PersonEndPointImpl ServerImpl | g.apache.cxf.endpoint.ServerImpl 91 | Setting the server's publish address to be nmr:Persons Also I did not received any exception when starting the CXF Bundle. With Regards Harbeer Kadian willem.jiang wrote: > > Can you make sure the cxf bundle is started rightly before the camel > route bundle? > For the stack trace , I think the CXF endpoint is not start rightly. > > Willem > > Harbeer Kadian wrote: >> Hi, >> >> I checked the example given in servicemix 4.0 CXF-Camel NMR. >> I tried to follow the example. >> >> I created a CXF Stack webservice and deployed it as an OSGI Bundle in the >> servicemix. >> I used the nmr endpoint instead of hosting it on http port. >> My spring config file is as follows >> > implementor="#PersonEndPoint" >> address="nmr:Persons"/> >> >> I had another bundle which has following route inside it. >> from("direct:NMR") >> .to("nmr:Persons"); >> >> I sent a soap envelope message on the Direct EndPoint. >> The problem here is that the message is not reaching to the NMR Endpoint. >> It is giving following exception. >> java.lang.NullPointerException >> at >> org.apache.servicemix.camel.nmr.ServiceMixProducer.process(ServiceMixProducer.java:44) >> at >> org.apache.camel.processor.SendProcessor$1.doInProducer(SendProcessor.java:97) >> at >> org.apache.camel.processor.SendProcessor$1.doInProducer(SendProcessor.java:95) >> >> The surprising thing here is that the example provided with the >> servicemix >> 4.0 CXF-Camel NMR is working fine. The only change I observed is that the >> example is keeping all the things in the same bundle whereas in my case >> the >> NMR endpoint and the router are in different bundles. >> >> Please help. >> >> With Regards >> Harbeer Kadian > > > -- View this message in context: http://old.nabble.com/Getting-NullPointerException-when-talking-to-NMR-Endpoint-tp28376375p28386474.html Sent from the Camel - Users mailing list archive at Nabble.com.