How to unit test sql-stored steps in a camel route

I recently joined a project in which lots of autosys jobs are replaced with camel routes. most of the processing flows follow the same pattern:Read a file from a certain folderApply some deserialization of some sort into a java structureInvoke a stored procedure or another based on some values included in the java structuureSend the processing results to some third party consumerThe easiest way to implement the stored procedure invoke was to use the sql-stored component. Let's just say I have this route:from("file://d:/temp/in/?include=myFile*.csv").process("myHeaderSetter"...

Suspend and Resume a Camel Route

Hi i am having a JMS consumer route in camel, my requirement is to stop/suspend that route at certain incident(based on the some field value) and then resume that route using a scheduler. For this i have created two routes, one is my original jms consumer route and one is scheduler route, that resume the jms consumer routes, although i am able to suspend the route but second route is not resuming the suspended route and its showing the state as started. below are my two routesoriginal consumer routefrom("activeMQ:demo.audit.event1?testConnectionOnStartup=true&acknowledg...

camel sql-stored component. How to pass INOUT oracle parameter?

I am using camel 2.18 camel-sql component for calling stored procedures. Is it possible to call oracle stored procedure which has an INOUT parameter? INOUT is not supported, only IN or OUT, where IN is the default. [XXX]

Simple Expression Language: how to get the ${routeId} in Apache Camel 2.10

How can I access the "routeId" in Apache Camel 2.10?I see that the property exists from camel 2.11.From Simple Expression Langauge docs${routeId}StringCamel 2.11: Returns the id of the current route the Exchange is being routed. Is there another easy hack available? No, you would need to do a little piece of code to get the route id. You can check the source code of Camel 2.11 onwards to see how Camel does it in that function. [XXX]

Camel-FTP only run once?

I can't seem to get the camel-ftp component to die when no files are found.I added a LimitedPollingConsumerPollStrategy with a limit of 1:<bean id="noPoll" class="org.apache.camel.impl.LimitedPollingConsumerPollStrategy"> <property name="limit" value="1"/></bean>and configured the URI to use it: ftp://user@host.ftp/?password=pass&stepwise=false&binary=true&delete=false&noop=true&pollStrategy=#noPollIt still just hangs, looking for files, when it doesn't find any.. so I added &sendEmptyMessageWhenIdle=true to the URI.I added cond...

Camel Bindy Date format Unmarshalling issue

I ran into an issue with Apache Camel Bindy data format for the Date field parsing from a CSV file.Date in the CSV is 02/11/2015 03:34:49 PMFormat in the Bindy Class annotated as @DataField(pos = 8,pattern="MM/dd/yyyy hh:mm:ss a")private Date time;Getting below exception java.lang.IllegalArgumentException: Date provided does not fit the pattern defined, position: 8, line: 1 at org.apache.camel.dataformat.bindy.BindyCsvFactory.bind(BindyCsvFactory.java:213) at org.apache.camel.dataformat.bindy.csv.BindyCsvDataFormat.unmarshal(BindyCsvDataFormat.java:185) at o...

camel bindy decimal pattern

I need a point as decimal separator in my output file. When using this pattern :@DataField(pos = 12, precision = 1, pattern = "####.#") Double amount;with for ex. input: 1491.84the output is strangely (no decimal): 1491.if I change my pattern with a comma instead of a point :@DataField(pos = 12, precision = 1, pattern = "####,#") Double amount;input: 1491.84output: 1491,8then it works but why not for the point separator ? Please have a look at your Locale.There is a common difference between English locales (like en_UK or en_US) and some European localse (like German o...

sending a response to client from camel cxf component

I am new to camel, i am trying to use camel cxf component to create a soap webservice. I started with a samples from camel in action. I have configured a route using cxf component and added a processor to process the request. I received the request in the bean i used to process the service but i cant able to send the response back to the client. Thanks in advanceThis is the route i used :<route><from uri="cxf:bean:orderEndpoint" /><setExchangePattern pattern="InOut"/><to uri="bean:productService" /></route>This is the cxf endpoint i have config...

Apache camel multiple file processing with exec

I am having trouble fixing this simple route, getting exception right after execute. Seems like execute is acting as Producer and over writing file.Exception: org.apache.camel.component.file.GenericFileOperationFailedException: Cannot store file: C:\camel_tests\stage\Downloads.rarRoute:Home directory will have a rar file with images, that should be extracted with winrar.exe, each file in the rar is file processed, and eventually moved to arch directory once this route done. Last successful stage is extracting files in the stage directory.Here CMD_EXPLODE = "\"C:/Program Fi...

Camel Producer blocks when AMQ queue in separate process fills up

I have two separate Spring Boot apps using camel - lets call them producer and consumer. In the producer process, the camel ProducerTemplate sends messages to activemq:queue:consumerIn the consumer process, listens to that queue.When I kill the consumer process, and I can see in the AMQ console that there are no consumers of the queue, the producer sends about 1000 messages to the queue, and then blocks.If I purge the queue, the producer unblocks and processes about another 1000 messages, and then we repeat.Why is the producer process backing off if the downstream queue ge...

Camel FTP endpoint move to a folder based on date

I have a camel route consuming from an FTP server and storing any files it consumes to a directory with move=.dealtWith. However, the number of files in this .dealtWith directory can quickly become unmanageable for users to view, so I would like to move the file to a .dealtWith/{the_date} directory. Is there a way to specify this functionality in camel without bringing the route down? Use Camel Simple Expression Languageftp:url?move=.dealtWith/${date:now:yyyy-MM-dd}/${header.CamelFileName} [XXX]

move messages between ActiveMQ queues in Camel w/o deserializing

I'm running Camel embedded in ActiveQM 5.11.1. I have some Java serialized messages that I need to move between queues with a simple Camel route... <route> <from uri="activemq:A"/> <to uri="activemq:B"/> </route> as expected, I get this error... WARN | Execution of JMS message listener failed. Caused by: [org.apache.camel.RuntimeCamelException - Failed to extract body due to: javax.jms.JMSException: Failed to build body from content. Serializable class not available to broker. Reason: java.lang.ClassNotFoundException: co...

Apache Camel - Copying a large file into a consumer folder

I have a route that expects that various files will be copied into an incoming folder. The route will proceed to move these files into a temp folder where it will do other stuff. The route is as follows: <route id="incoming" > <from uri="file://my/path/incoming"/> <to uri="file://my/path/incoming/temp"/> </route>The issue is that these files may be quite large. Lets say 1Gb. In order to copy this file in to the incoming folder it may take lets say 10 seconds. During these 10 seconds the Consumer polls the directory...

Disable Camel ActiveMQ Consumer Connection logs

I am using Spring DSL to consume messages.Everything works fine. The issue is every 5 seconds it checks for connection and logs message: "Successfully connected to ssl://hostname:port"How to disable the connection log? 1) Add the logging.level.org.apache.activemq=WARN 2) If you are using failover set warnAfterReconnectAttempts=0 [XXX]

Enabling Replay mechanism with camel from messages from DB

Iam trying to implement replay mechanisam with camel ie., i will have to retrieve all the messages already persisted and forward to appropriate camel route to reprocess.This will be triggred by quartz scheduler.I achieved the same by using below.1) once the quartz scheduler is triggered, fwd to processor which will query db and have the message as list and set the same in camel exchange properties as list.2) Use the camel in which LoopProcessor will set appropriate xml in the iteration in the exchange.3) fwd it to activemq which will be forwarded to appropriate camel route...

Apache Activemq 5.10.2 possible memory leak?

We are upgrading to apache ActiveMQ 5.10.2 with apache karaf 3.0.3 on java 8. We have two activemq brokers (network of brokers) connected through dynamic discovery (multicast). Consumers of the queue are apache camel routes (producing/consuming about 20 messages per second in average).We are using apache activemq 5.9.0 with karaf 2.4 on java 7 in production and running fine without any problem for about two years. The only difference in production is that we are processing about 6 messages per second in average. Recently we deployed the application with activemq 5.10.2 to ...

Page 1 of 48  |  Show More Pages:  Top Prev Next Last