Re: Where to put...
That´s up to you. Camel does not enforce any naming scheme. For the spring config typical names are *-context.xml. If you use the java dsl then the class you need to extend is RouteBuilder. So often it is called *RouteBuilder but again it is not enforced. Christian Am 04.04.2011 00:52, schrieb dead_devil_66: Thanks for replying. Butshould the files have a certain name, considering it's role in the app, or what? -- View this message in context: http://camel.465427.n5.nabble.com/Where-to-put-tp4279283p4279450.html Sent from the Camel - Users mailing list archive at Nabble.com. -- http://www.liquid-reality.de
Re: Exchange.MAXIMUM_CACHE_POOL_SIZE is not affecting producers created by recipientList
Excellent! That is something I was looking for since Camel 2.5! -- View this message in context: http://camel.465427.n5.nabble.com/Exchange-MAXIMUM-CACHE-POOL-SIZE-is-not-affecting-producers-created-by-recipientList-tp4257273p4279856.html Sent from the Camel - Users mailing list archive at Nabble.com.
String processing with Apache Camel with Spring DSL
Hi, this is my first email to this mailing-list. Although already knowing for some time, I only recently got the opportunity to deploy integration solution using Apache Camel. And Camel did wonder! I and my fellow friends were amazed by the concept and simplicity of Apache Camel Now, I have another problem to solve using Camel. One of my tasks to be done is doing string processing / transformation. I need to parse and extract several information from a text log. The string format itself is fixed, but string is not in comma separated value. For example, the text is: 2011-04-04 14:34:05,003 INFO - cli_to_gw submit_sm_req text ip :10.2.x:37xxx to:62x msg:Congratulations, the product ABC activation to subscriber DEF is successful. The serial number is XYZ. from:x I want to extract only ABC, DEF and XYZ from the text log. In order to avoid heavy changes in our production environment, I intend to use Spring XML DSL to configure my routes. Is it possible to do so? What functions should I use? I have no problem filtering the log to only process certain type of log (using 'regex' simple operator), but have no idea of extract those information using Spring XML. Thanks in advance :) -- Twitter: @md_ray Email/IM: saviour...@gmail.com
Re: String processing with Apache Camel with Spring DSL
If you are using Spring then I would be looking at a POJO to do this parsing work - routing to it using the beanRef - this would encapsulate your string manipulation and leave camel to perform delivery and routing. There are predicates and conditionals you could use in your dsl - but for my taste this wouldn't give me the transparency and simplicity of testing I would like. My inclination is to use Camel for the heavy lifting and pojos or processors for the fine grained stuff On 4 Apr 2011, at 09:24, Muhammad Rayhan wrote: Hi, this is my first email to this mailing-list. Although already knowing for some time, I only recently got the opportunity to deploy integration solution using Apache Camel. And Camel did wonder! I and my fellow friends were amazed by the concept and simplicity of Apache Camel Now, I have another problem to solve using Camel. One of my tasks to be done is doing string processing / transformation. I need to parse and extract several information from a text log. The string format itself is fixed, but string is not in comma separated value. For example, the text is: 2011-04-04 14:34:05,003 INFO - cli_to_gw submit_sm_req text ip :10.2.x:37xxx to:62x msg:Congratulations, the product ABC activation to subscriber DEF is successful. The serial number is XYZ. from:x I want to extract only ABC, DEF and XYZ from the text log. In order to avoid heavy changes in our production environment, I intend to use Spring XML DSL to configure my routes. Is it possible to do so? What functions should I use? I have no problem filtering the log to only process certain type of log (using 'regex' simple operator), but have no idea of extract those information using Spring XML. Thanks in advance :) -- Twitter: @md_ray Email/IM: saviour...@gmail.com
Turn a route into a component
Hi Is there any way to rurn a route into a camel component ? I'd like to do this because I want to add some higher level logic to an existing component. regards Sorin
Re: multiple databases used in mybatis or ibatis in one route
Hello, thanks to Claus and Richard, it worked ! So, to further help anyone who would have the same need : I wanted to be able to use MyBatis pointing to 2 different datasources in the same route. I use Camel 2.7.0 on ServiceMix (trunk). Using the spring dsl, my configuration was : ?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:ctx= http://www.springframework.org/schema/context; xmlns:camel=http://camel.apache.org/schema/spring; xmlns:osgix= http://www.springframework.org/schema/osgi-compendium; xsi:schemaLocation= http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd http://www.springframework.org/schema/osgi-compendium http://www.springframework.org/schema/osgi-compendium/spring-osgi-compendium.xsd camel:camelContext xmlns=http://camel.apache.org/schema/spring; route from URI=timer://SynchroDB?period=3/ to uri=mybatis:selectDataToTransfert?statementType=SelectList / !-- retrieve the list of ID to synchronise -- split simple${body}/simple to uri=log:events / to uri=mybatis:selectDataContentToTransfert?statementType=SelectOne / !-- retrieve the datato transfert -- to uri=mybatis2:registerInbound?statementType=Insert / /split /route /camel:camelContext bean id=mybatis2 class=org.apache.camel.component.mybatis.MyBatisComponent property name=configurationUri value=SqlMapConfig_destination.xml/ /bean /beans Hope it'll be helpfull to someone ! Mike 2011/4/1 Michael Dewitte michael.dewi...@gmail.com Thnaks to you, Claus and Richard for this fast and extensive help ! I'll give it a try today ! Thx, Mike 2011/3/31 Richard Kettelerij richardkettele...@gmail.com To use this component in your route use: from(mybatis2:selectFoo).to(...); -- View this message in context: http://camel.465427.n5.nabble.com/multiple-databases-used-in-mybatis-or-ibatis-in-one-route-tp4273206p4274145.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Scheduling routes with RoutePolicy
Hi, I've been trying it out using the noAutoStartUp() - which seems to make it work, i.e. let the route begin in a stopped state and then having a cron-schedule to start it at a given point in time. However, I need to have it to start and then stop a few hours later, but this does not work. If I set both a routeStartTime and a routeStopTime on the policy, then two scheduled events are being handled, but they are both firing the STOP action. I've been through the code, and I think that the problem is in this method of the ScheduledRoutePolicy: protected void loadCallbackDataIntoSchedulerContext(Action action, Route route) throws SchedulerException { getScheduler().getContext().put(SCHEDULED_ACTION, action); getScheduler().getContext().put(SCHEDULED_ROUTE, route); } This method is called during each invocation of the ScheduledRoutepolicy.scheduleRoute(Action action) method - which in my test gets called twice - first for the Start action and secondly for the Stop action. So after the second invocation of loadCallbackDataIntoSchedulerContext the SCHEDULED_ACTION on the context is the Stop action - even though I wanted to define both a Start and Stop action. I.e. it is possible to register in the routepolicy multiple actions, but the registration in the scheduler context only allows for one single action. Is this deliberate or is it a flaw in the implementation. From comments on other issues in the forum I can see that it should be possible to register multiple policies on a route from Camel 2.7 - however, we are currently stuck on JDK1.5 so Camel 2.7 is not an option for us. Regards Mikael -- View this message in context: http://camel.465427.n5.nabble.com/Scheduling-routes-with-RoutePolicy-tp4269200p4281413.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Turn a route into a component
Hi. I'm not sure what you want to do, but perhaps the context component is something for you. Claus On 04.04.2011 11:49, Sorin Silaghi wrote: Hi Is there any way to rurn a route into a camel component ? I'd like to do this because I want to add some higher level logic to an existing component. regards Sorin
Re: JBoss 5.1.0 - 6.0.0.Final (Camel Issues)
Can you guys try the attached JAR on the following JIRA https://issues.apache.org/jira/browse/CAMEL-3825 As its the JAR we want to ship officially from camel-extra for JBoss 6 support. - Claus Ibsen - FuseSource Email: cib...@fusesource.com Web: http://fusesource.com Twitter: davsclaus Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/ -- View this message in context: http://camel.465427.n5.nabble.com/JBoss-5-1-0-6-0-0-Final-Camel-Issues-tp3353086p4281700.html Sent from the Camel - Users mailing list archive at Nabble.com.
RE: http not cleaning up tmp files when exchange is stopped
Thanks. Can you post the route with the stop that fails deleting the tmp file? And if possible feel free to create a JIRA ticket about this issue http://camel.apache.org/support - Claus Ibsen - FuseSource Email: cib...@fusesource.com Web: http://fusesource.com Twitter: davsclaus Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/ -- View this message in context: http://camel.465427.n5.nabble.com/http-not-cleaning-up-tmp-files-when-exchange-is-stopped-tp4269124p4281702.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Why camel:convertBodyTo type='org.w3c.dom.Document' can't work?
It has to be valid XML to be convertable to DOM. So fill in eg Hello World as the message body to have a valid XML content. - Claus Ibsen - FuseSource Email: cib...@fusesource.com Web: http://fusesource.com Twitter: davsclaus Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/ -- View this message in context: http://camel.465427.n5.nabble.com/Why-camel-convertBodyTo-type-org-w3c-dom-Document-can-t-work-tp4280965p4281703.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: String processing with Apache Camel with Spring DSL
Thanks John for the reply I tend to agree with you on POJO doing the parsing dirty work. Creating new POJO is actually the thing we want to avoid. Our team prefer configuring Spring DSL rather than using POJO. On this case where the parsing will be too complex, however, POJO maybe the cleanest solution On Mon, Apr 4, 2011 at 3:35 PM, John McDonald mcdon...@gmail.com wrote: If you are using Spring then I would be looking at a POJO to do this parsing work - routing to it using the beanRef - this would encapsulate your string manipulation and leave camel to perform delivery and routing. There are predicates and conditionals you could use in your dsl - but for my taste this wouldn't give me the transparency and simplicity of testing I would like. My inclination is to use Camel for the heavy lifting and pojos or processors for the fine grained stuff On 4 Apr 2011, at 09:24, Muhammad Rayhan wrote: Hi, this is my first email to this mailing-list. Although already knowing for some time, I only recently got the opportunity to deploy integration solution using Apache Camel. And Camel did wonder! I and my fellow friends were amazed by the concept and simplicity of Apache Camel Now, I have another problem to solve using Camel. One of my tasks to be done is doing string processing / transformation. I need to parse and extract several information from a text log. The string format itself is fixed, but string is not in comma separated value. For example, the text is: 2011-04-04 14:34:05,003 INFO - cli_to_gw submit_sm_req text ip :10.2.x:37xxx to:62x msg:Congratulations, the product ABC activation to subscriber DEF is successful. The serial number is XYZ. from:x I want to extract only ABC, DEF and XYZ from the text log. In order to avoid heavy changes in our production environment, I intend to use Spring XML DSL to configure my routes. Is it possible to do so? What functions should I use? I have no problem filtering the log to only process certain type of log (using 'regex' simple operator), but have no idea of extract those information using Spring XML. Thanks in advance :) -- Twitter: @md_ray Email/IM: saviour...@gmail.com -- Sent using Telkomsel network Twitter: @md_ray Email/IM: saviour...@gmail.com and md_...@yahoo.com
Acknowledgement mechanism
When I receive a JMS message, I want to check it whether it's valid: - if it is, then I want to send acknowledgement to the replyTo and to continue the workflow - if it's not valid, then I want to send back an error and stop the chain of execution What mechanism in Camel would you advise? Seems like interceptors are a good choice to implement what I want. -- View this message in context: http://camel.465427.n5.nabble.com/Acknowledgement-mechanism-tp4281845p4281845.html Sent from the Camel - Users mailing list archive at Nabble.com.
Route Question
Hi, I'm working on an app where I need to conditionally route files based on filename. Ideally I'd like the list of filenames that need to be matched to be read in from an external file. Is there a simple way to do this using Camel? Something like the following? ${header.CamelFileName} regex 'fileNameFromExternalFile' -- View this message in context: http://camel.465427.n5.nabble.com/Route-Question-tp4281861p4281861.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Route Question
Hi. yes: camelContext xmlns=http://camel.apache.org/schema/spring; template id=camelTemplate/ !-- use myFilter as filter to allow setting ANT paths for which files to scan for -- endpoint id=myFileEndpoint uri=file://target/antpathmatcher?recursive=trueamp;filter=#myAntFilter/ route from ref=myFileEndpoint/ to uri=mock:result/ /route /camelContext !-- we use the antpath file filter to use ant paths for includes and exlucde -- bean id=myAntFilter class=org.apache.camel.component.file.AntPathMatcherGenericFileFilter !-- include and file in the subfolder that has day in the name -- property name=includes value=**/subfolder/**/*day*/ !-- exclude all files with bad in name or .xml files. Use comma to seperate multiple excludes -- property name=excludes value=**/*bad*,**/*.xml/ /bean You can find this in the documentation:http://camel.apache.org/file2.html Claus On 04.04.2011 16:36, jpalmer1026 wrote: Hi, I'm working on an app where I need to conditionally route files based on filename. Ideally I'd like the list of filenames that need to be matched to be read in from an external file. Is there a simple way to do this using Camel? Something like the following? ${header.CamelFileName} regex 'fileNameFromExternalFile' -- View this message in context: http://camel.465427.n5.nabble.com/Route-Question-tp4281861p4281861.html Sent from the Camel - Users mailing list archive at Nabble.com.
maven plugin
I am testing some routes and would like to create some sample routes to play with. I am using maven to create these projects with the following command: mvn archetype:create -DgroupId=a.b.c.d -DartifactId=MyRouter -DarchetypeArtifactId=camel-router -DarchetypeGroupId=org.apache.camel This command works fine, I can run the command mvn package, and that runs fine. I then try and run the command mvn camel:run and the command hangs, and this is the last line printed out: Apr 4, 2011 9:47:02 AM org.apache.camel.spring.Main generateDot INFO: Generating DOT file for routes: C:\temp\MyRouter\target/site/cameldoc for: org.apache.camel.spring.SpringCamelContext@622209db with name: camelContext Before running the command, I added in the following lines to the pom.xml file: configuration useDotfalse/useDot /configuration I even tried to specify the path to dot.exe and got the same results. So is there any way I can run the camel route without running dot from maven? Thanks, Mark
Re: dot generation with maven plugin - classNotFoundException
You can probably work around it by adding: http://repo1.maven.org/maven2/org/slf4j/slf4j-simple/ to the plugins dependency list. 2011/4/4 Michael Dewitte michael.dewi...@gmail.com Hi, I was trying to get some visualisation of my developped route, and so I tried the mvn camel:dot target on my route. But then I got the following stacktrace. Any clue ? I use Camel 2.7.0 and my route is configured via Spring XML... [INFO] Running Camel embedded to load Spring XML files from classpath: META-INF/spring/*.xml SLF4J: Failed to load class org.slf4j.impl.StaticLoggerBinder. SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details. [FATAL ERROR] org.apache.camel.maven.DotMojo#execute() caused a linkage error (java.lang.NoClassDefFoundError) and may be out-of-date. Check the realms: [FATAL ERROR] Plugin realm = app0.child-container[org.apache.camel:camel-maven-plugin:2.7.0] [...] [INFO] Trace java.lang.NoClassDefFoundError: org/slf4j/impl/StaticLoggerBinder at org.slf4j.LoggerFactory.getSingleton(LoggerFactory.java:230) at org.slf4j.LoggerFactory.bind(LoggerFactory.java:121) at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:112) at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:275) at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:248) at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:261) at org.apache.camel.impl.MainSupport.clinit(MainSupport.java:47) 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.apache.camel.maven.EmbeddedMojo.runCamel(EmbeddedMojo.java:223) at org.apache.camel.maven.EmbeddedMojo.executeWithoutWrapping(EmbeddedMojo.java:127) at org.apache.camel.maven.DotMojo.runCamelEmbedded(DotMojo.java:380) at org.apache.camel.maven.DotMojo.execute(DotMojo.java:256) at org.apache.camel.maven.DotMojo.execute(DotMojo.java:221) -- -- David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen
Recommended approach for JMS polling consumer
Hi, I am using Camel 2.4.0 to define routes in XML (Spring configuration files). I want my route to read all messages from a JMS queue, at regular intervals. I also want to keep my route as simple as possible, for easy maintenance. When I look for info about this, there's lots of advice but nothing definitive. Included below are paraphrased versions of the info I found. Please advise on which approach is the simplest and/or most reliable. Thanks, Paul [1] Approach #1: a timer consumer, then a pollEnrich processor to pull in a JMS message. Example: route id=RetryTimerRoute from uri=timer://myTimer?period=360/ pollEnrich uri=activemq:queue:MyQueue/ ... /route Note: It might be necessary to set the pre-fetch value for the JMS connection to zero, i.e. activemq:queue:MyQueue?consumer.prefetchSize=0 References: http://camel.apache.org/content-enricher.html http://camel.apache.org/polling-consumer.html http://activemq.apache.org/destination-options.html http://activemq.apache.org/what-is-the-prefetch-limit-for.html [2] Approach #2: use templates to move messages onto another queue at regular intervals; then let consumer of that queue process all messages. Example: public static class MyRetryTimer { private ConsumerTemplate consumer; private ProducerTemplate producer; public void setConsumer(ConsumerTemplate consumer) { this.consumer = consumer; } public void setProducer(ProducerTemplate producer) { this.producer = producer; } public void transferMessagesForRetry() { // move all messages while (true) { String msg = consumer.receive(activemq:queue:MyFirstQueue, 1000); if (msg == null) { // no more messages break; } producer.send(activemq:queue:MySecondQueue, msg); } } } bean id=RetryTimer class=MyRetryTimer/ route id=RetryTimerRoute from uri=timer://myTimer?period=360/ to uri=bean:RetryTimer?method=transferMessagesForRetry/ /route route id=RetryRoute from uri=activemq:queue:MySecondQueue/ ... /route Notes: How do I inject the consumer producer? References: http://camel.apache.org/polling-consumer.html http://fusesource.com/docs/router/2.6/prog_guide/Templates-Consumer.html [3] Approach #3: define a task executor in spring, and use it to set the consumer's taskExecutor option. This is not well documented. Example: bean class=org.springframework.core.task.TimerTaskExecutor !-- some config goes here -- /bean route id=RetryRoute from uri=activemq:queue:MyQueue?taskExecutor=org.springframework.core.task.TimerTaskExecutor/ ... /route Notes: Is the example correct? How do I configure the spring task executor? References: http://camel.apache.org/jms http://static.springsource.org/spring/docs/2.5.6/reference/scheduling.html https://issues.apache.org/jira/browse/CAMEL-3286 -- EOF STRICTLY PRIVATE, CONFIDENTIAL AND PRIVILEGED COMMUNICATION. This message (including attachments) may contain information that is privileged, confidential or protected from disclosure. They are intended solely for the use of the intended recipient. If you are not the intended recipient, you are hereby notified that dissemination, disclosure, copying, distribution, printing, transmission or use of this message or any information contained in it is strictly prohibited. If you have received this message from NewBay Software in error, please immediately notify the sender by reply email and delete this message from your computer. The content of this e-mail, and any files transmitted with it, may have been changed or altered without the consent of the author. Although we have taken steps to ensure that this email and attachments are free from any virus, we advise that in keeping with good computing practice the recipient should ensure they are actually virus free.
Improvement of the Idempotent Repository
Hello list! I'm thinking about to add a timestamp property to the idempotent repository (at least to the JDBC and JPA based one). The reason is the following: The individual records in our batch file doesn't have a unique id which we can use as key for the idempotent consumer. Our solution was to get the entire line and build a hash for the key. The problems comes, after we have been asked to remove the entries in the idempotent repository from the last processed file, because it should be processed again. We could not do this, because we don't know which entries (hashes) belongs to the last file we processed. Our short time solution is to extend the database table we use and add a 'created_at' column which is filled by the database with a default value to 'sysdate' (Oracle). I'm wondering whether we should support this by default in further versions of Camel (set the created_at timestamp) at least in the JDBC and JPA based idempotent repositories. What you are thinking? Cheers, Christian
Re: dot generation with maven plugin - classNotFoundException
Thanks for the answer, but it didn't solve the problem... :-( 2011/4/4 David Karlsen davidkarl...@gmail.com You can probably work around it by adding: http://repo1.maven.org/maven2/org/slf4j/slf4j-simple/ to the plugins dependency list. 2011/4/4 Michael Dewitte michael.dewi...@gmail.com Hi, I was trying to get some visualisation of my developped route, and so I tried the mvn camel:dot target on my route. But then I got the following stacktrace. Any clue ? I use Camel 2.7.0 and my route is configured via Spring XML... [INFO] Running Camel embedded to load Spring XML files from classpath: META-INF/spring/*.xml SLF4J: Failed to load class org.slf4j.impl.StaticLoggerBinder. SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details. [FATAL ERROR] org.apache.camel.maven.DotMojo#execute() caused a linkage error (java.lang.NoClassDefFoundError) and may be out-of-date. Check the realms: [FATAL ERROR] Plugin realm = app0.child-container[org.apache.camel:camel-maven-plugin:2.7.0] [...] [INFO] Trace java.lang.NoClassDefFoundError: org/slf4j/impl/StaticLoggerBinder at org.slf4j.LoggerFactory.getSingleton(LoggerFactory.java:230) at org.slf4j.LoggerFactory.bind(LoggerFactory.java:121) at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:112) at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:275) at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:248) at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:261) at org.apache.camel.impl.MainSupport.clinit(MainSupport.java:47) 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.apache.camel.maven.EmbeddedMojo.runCamel(EmbeddedMojo.java:223) at org.apache.camel.maven.EmbeddedMojo.executeWithoutWrapping(EmbeddedMojo.java:127) at org.apache.camel.maven.DotMojo.runCamelEmbedded(DotMojo.java:380) at org.apache.camel.maven.DotMojo.execute(DotMojo.java:256) at org.apache.camel.maven.DotMojo.execute(DotMojo.java:221) -- -- David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen
Re: Route Question
You can combine the content based router [1] and the simple language [2] to something like: from(seda:a) .choice() .when(simple(${header.CamelFileName} regex 'foo.*')) .to(seda:b) .when(simple(${header.CamelFileName} regex 'bar.*')) .to(seda:c) .otherwise() .to(seda:d); [1] http://camel.apache.org/content-based-router.html [2] http://camel.apache.org/simple.html Christian
Does activemq/jms component have keepalive option?
I have a simple route that goes from(file:/some/path).to(activemq:some/queue); From truss and activeMq admin page, I notice that it is constantly connecting/closing the connections. Is there a way to make the endpoint retain a connection to make it more efficient? Thanks, Tom
Re: String processing with Apache Camel with Spring DSL
Looking at the example string, I think you need a component that is capable of parsing fixed-width records. This can be accomplished using either of the following Camel components: - camel-bindy (POJO based), http://camel.apache.org/bindy.html - camel-flatpack (XML based), http://camel.apache.org/flatpack.html Both camel components can be used with Spring XML, but flatpack also allows your record definitions to be specified in XML. If you need advanced data mapping capabilities you should have a look at Smooks (http://www.smooks.org). It integrates with Camel out-of-the-box. On Mon, Apr 4, 2011 at 10:24 AM, Muhammad Rayhan saviour...@gmail.comwrote: Hi, this is my first email to this mailing-list. Although already knowing for some time, I only recently got the opportunity to deploy integration solution using Apache Camel. And Camel did wonder! I and my fellow friends were amazed by the concept and simplicity of Apache Camel Now, I have another problem to solve using Camel. One of my tasks to be done is doing string processing / transformation. I need to parse and extract several information from a text log. The string format itself is fixed, but string is not in comma separated value. For example, the text is: 2011-04-04 14:34:05,003 INFO - cli_to_gw submit_sm_req text ip :10.2.x:37xxx to:62x msg:Congratulations, the product ABC activation to subscriber DEF is successful. The serial number is XYZ. from:x I want to extract only ABC, DEF and XYZ from the text log. In order to avoid heavy changes in our production environment, I intend to use Spring XML DSL to configure my routes. Is it possible to do so? What functions should I use? I have no problem filtering the log to only process certain type of log (using 'regex' simple operator), but have no idea of extract those information using Spring XML. Thanks in advance :) -- Twitter: @md_ray Email/IM: saviour...@gmail.com
Failed to create route
Hi, I'm trying to use the camel properties component to externalize a properties file. It looks like the properties file is getting read, but I'm getting the following exception when the app tries to read the externalized properties: Exception in thread main org.apache.camel.RuntimeCamelException: org.apache.camel.FailedToCreateRouteException: Failed to create route route1: Route[[From[{{file.inbox}}]] - [Choice[[When[simple{${heade... because of No endpoint could be found for: {{file.inbox}}, please check your classpath contains the needed Camel component jar. Here are the relevant code snippets from my spring-config file: ${header.CamelFileName} regex '^.*txt$' ${header.CamelFileName} regex '^.*xml$' My properties file is as follows: file.inbox=target/inbox file.outbox=target/outbox file.xml=target/xml Any idea what I might be doing wrong? Thanks! -- View this message in context: http://camel.465427.n5.nabble.com/Failed-to-create-route-tp4282517p4282517.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Failed to create route
Do you have a properties placeholder [1] for your properties and/or is it at the expected location? camelContext ... propertyPlaceholder id=properties location=com/mycompany/myprop.properties/ /camelContext Hadrian [1] http://camel.apache.org/properties.htm On Apr 4, 2011, at 3:10 PM, jpalmer1026 wrote: Hi, I'm trying to use the camel properties component to externalize a properties file. It looks like the properties file is getting read, but I'm getting the following exception when the app tries to read the externalized properties: Exception in thread main org.apache.camel.RuntimeCamelException: org.apache.camel.FailedToCreateRouteException: Failed to create route route1: Route[[From[{{file.inbox}}]] - [Choice[[When[simple{${heade... because of No endpoint could be found for: {{file.inbox}}, please check your classpath contains the needed Camel component jar. Here are the relevant code snippets from my spring-config file: ${header.CamelFileName} regex '^.*txt$' ${header.CamelFileName} regex '^.*xml$' My properties file is as follows: file.inbox=target/inbox file.outbox=target/outbox file.xml=target/xml Any idea what I might be doing wrong? Thanks! -- View this message in context: http://camel.465427.n5.nabble.com/Failed-to-create-route-tp4282517p4282517.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Failed to create route
I declared my Properties component as a bean as described in my post. -- View this message in context: http://camel.465427.n5.nabble.com/Failed-to-create-route-tp4282517p4282634.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Failed to create route
Actually, I figured it out. Silly mistake on my part. I was usinginstead of (note the 'file' keyword before the colon). -- View this message in context: http://camel.465427.n5.nabble.com/Failed-to-create-route-tp4282517p4282652.html Sent from the Camel - Users mailing list archive at Nabble.com.
Howto use delay message brokerage in a Camel Route using AMQ_SCHEDULED_DELAY
As part of my routes, I need a processor to calculate and set a delay in the distribution. The message should be released to the Activemq topic/queue, but only send to subscribers when the delay has expired. AMQ_SCHEDULED_DELAY seems ideal for this. But I cant get it to work. In my processor bean I have exchange.getIn().setHeader(AMQ_SCHEDULED_DELAY, delay); The exchange I thereafter route to an activemq endpoint. The problem is that the subscriber receives all messages immediately, no matter the delay set. It looks as if the AMQ_SCHEDULED_DELAY header flag is not taken into account. What am I doing wrong? -- View this message in context: http://camel.465427.n5.nabble.com/Howto-use-delay-message-brokerage-in-a-Camel-Route-using-AMQ-SCHEDULED-DELAY-tp4282763p4282763.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Does activemq/jms component have keepalive option?
Hi, Have you considered using a PooledConnectionFactory instead of the ActiveMQConnectionFactory. This will allow you not to create fresh connections each time. Cheers, Ashwin... - - Ashwin Karpe Apache Camel Committer Sr Principal Consultant FUSESource (a Progress Software Corporation subsidiary) http://fusesource.com Blog: http://opensourceknowledge.blogspot.com CamelOne 2011: http://fusesource.com/camel2011 - -- View this message in context: http://camel.465427.n5.nabble.com/Does-activemq-jms-component-have-keepalive-option-tp4282121p4283140.html Sent from the Camel - Users mailing list archive at Nabble.com.