Handle first delivery failure differently then all following retries?

2014-10-09 Thread dunnlow
I'm using Camel 2.10.3 and Spring 3.1 with XML route configuration. I have a transacted route that is getting messages from several different sources (and saving them to a database). When there is an exception writing to the database I want to send an alert (a web service) on the FIRST roll back

Forcing a transaction to commit (using Spring XML)?

2014-07-14 Thread dunnlow
Using camel 10.0.3 with Spring 3.1. Doing workflow processing, I have two routes. One pulls a message from a JMS queue, processes it and then puts a new message on a different JMS queue (where the new message continues to be processed). I DONT want the processing of the new message (pulled f

Re: Set header from velocity template

2014-04-15 Thread dunnlow
ah! Thank you, works as expected: ${body} ${body} headers.currentBody ...albeit not as clean as a "toHeader" option on the velocity component :) -- View this message in context: http://camel.465427.n5.nabble.com/Set-header-using-velocity-template-tp5750248p5750271.html

Re: Set header from velocity template

2014-04-15 Thread dunnlow
Sorry, I should have given more detail. I am using velocity to create web pages. My template is an html formatted document (about 40 lines) that uses existing exchange headers. (This gets turned into a web page downstream.) In my (xml) route I have something like: However, this puts

Set header from velocity template

2014-04-15 Thread dunnlow
I currently use velocity to set the message body. Now, I would like to use it to set a _header_. I haven't found any example of this. Obviously I could write a processor/bean. Is there a better way? Thanks. -J -- View this message in context: http://camel.465427.n5.nabble.com/Set-header-fr

Re: Import xml fragments of camel routes?

2013-11-18 Thread dunnlow
Claus, Bummer, ok thank you. Also, thank you for the comment about lack of onexception handling. That is an important limitation (for me) that I didn't catch in the documentation. I'd like to recommend adding it (and any other limitations on routeContext) - perhaps here: http://camel.apache.or

Import xml fragments of camel routes?

2013-11-15 Thread dunnlow
I am using Spring 3.1 with Camel 10.1. I am working to support multiple environments with my camel/spring XML configuration (using a combination of camel and spring properties and distinct xml files). I have a "common.xml" file that holds routes (some are quite large) that are common between the

Re: Best way to consuming same queue from two brokers?

2013-10-24 Thread dunnlow
Thanks Reji, I understand. My fear with SEDA is that I have a pretty high msg flow at times and if my app goes down and there are messages on the SEDA queue (that is, pulled off of various jms brokers/queues and waiting on a SEDA queue) the msgs will be lost. But I wonder, can a transaction work

Re: Best way to consuming same queue from two brokers?

2013-10-23 Thread dunnlow
Thanks James. Well, yes... sort of. If a producer sends to one broker, I can consume from either as expected...IF both brokers are ok. My concern (that I have from my relayed past experience) is that if I use the failover uri and there is a problem, that my consumer will miss some of the message

Best way to consuming same queue from two brokers?

2013-10-23 Thread dunnlow
Using Camel 2.10.3 My question: What is the best way to consume msgs from multiple brokers/queues and feed those messages through a single route? Explanation: I currently consume from an activemq broker. I have several different routes that consume messages from different queues on that broker.

Re: Using Dead letter channel with ActiveMQ?

2013-02-13 Thread dunnlow
I have a solution that seems to be working. I have assigned a context errorHandler and have a deliverypolicy that has a dead letter uri (a route that dumps to a file), like: When a message fails 5 times (to test I am shutting down the

Re: Using Dead letter channel with ActiveMQ?

2013-02-13 Thread dunnlow
Claus, I've tried to avoid this issue, but it is back upon me. Basically, I'm using camel 2.10.3 now, Spring 3.1.2 and activemq 5.7) I am consuming from an activemq broker which I do not control, and which does not allow use of a DLQ - it is clustered, robust, etc, etc. I want to make sure that

Re: Using Dead letter channel with ActiveMQ?

2012-12-12 Thread dunnlow
Willem, thank you for your response - although I'm sorry, I don't fully understand it. I have a transacted route that pulls a msg from activemq and sends it to another route that multicasts that message to a variety of services. If any of those services throw an exception I want to leave the ms

Using Dead letter channel with ActiveMQ?

2012-12-10 Thread dunnlow
I'm using camel 10.0 and activemq 5.5. I currently have a redelivery policy currently configured on my ConnectionFactory that is being used by my ActiveMQ component (using org.apache.activemq.RedeliveryPolicy). However, what I really want to do is set up redelivery in camel so that after the msg

Re: Set body to length of header string in Spring DSL?

2012-11-28 Thread dunnlow
Claus, I understand that is what the exception indicates; However, as you can see from my code above (which is the actual code from the test) that I have declared the header a Map and am setting the value to the string "John." Thus, I'm confused where the hbase class is being referenced at all. T

Re: Set body to length of header string in Spring DSL?

2012-11-27 Thread dunnlow
Thanks, I have some reading up to do on OGNL (and file language). To my initial question, sorry, I'm still not able to get my test working. Basically, nothing is output if I put a value in the name with the expression you provided. When I put a value in the name, I get the following output depen

Re: Set body to length of header string in Spring DSL?

2012-11-27 Thread dunnlow
Thank you both, huge help. Claus, question for you in the, "teach a man to fish.." category. What is the best way to see all of the methods that simple provides? For example, I had no idea about the Length() method - is that method inherited? Thank you again, -J -- View this message in co

Set body to length of header string in Spring DSL?

2012-11-26 Thread dunnlow
(a simplification of an earlier question - I'm using camel 10.0, spring 3.1) Can someone tell me how, *using Spring DSL*, to set the message body to the size of the message header named "name"? I don't care if it's simple, or a different script language (I can't get any to work). Something li

If header (a string) exists and length is > 5, then.... via Spring DSL?

2012-11-26 Thread dunnlow
With camel 2.10 and Spring 3.1 I am trying to test to see if a string in a header exists OR is too short. The test for null works as expected, but I seem to be unable to check the length. Any thoughts as to why? request.headers.get('name')==null || request.headers.get('name'

Transacting two web services - EIP?

2012-11-13 Thread dunnlow
Hello, I am using camel 2.9 and Spring 3. I have a transacted route in which I am pulling messages from a queue (activemq) and sending messages to two web services (via multicast). The web services are notification services that send messages to users (there is no real roll back strategy - once t

Truncate a bean property string in the body in Spring?

2012-10-25 Thread dunnlow
using camel 2.9 and spring 3.1: I have a bean in the message body and one of the properties is a string. I want to truncate the value of that property (basically make sure it isn't longer than 100 characters). I know I could put a method on the bean to do this, but is there an reasonably easy w

Re: Message Headers to file component?

2012-10-01 Thread dunnlow
Thanks for your response. Unfortunately I don't have JMS as an option in this case. I suppose I'll just use a bean and xstream to save/load the information (was hoping for some oft found camel magic). thanks again. -- View this message in context: http://camel.465427.n5.nabble.com/Message-He

Message Headers to file component?

2012-10-01 Thread dunnlow
Hi, am trying to pass information between two camel apps via file. I envisioned a way to redirect a message (body and headers) to a file and then have the second app consume that file as a message (just as if it had originated on the second system). I tried just sending the original message to

Routes in camel console don't persist?

2012-08-12 Thread dunnlow
I have two issue in the console (using the one bundled with activemq 5.5). 1) I can add a route via the console "create new route" link. It works just fine..until I shut it down (the console/activemq). When I start it back up the routes I added from the console are gone. (Only the routes I pl

Re: Camel - ActiveMQ communication failes in Tomcat

2012-08-12 Thread dunnlow
Did you also just add Spring for activemq? It looks like ContextLoaderListener isn't in your classpath. That class lives in the org.springframework.web-3.xx.jar. -- View this message in context: http://camel.465427.n5.nabble.com/Camel-ActiveMQ-communication-failes-in-Tomcat-tp5716976p571701

Re: How to handle http status code

2012-07-25 Thread dunnlow
I handle that with a try/catch block. http://camel.apache.org/try-catch-finally.html -J -- View this message in context: http://camel.465427.n5.nabble.com/How-to-handle-http-status-code-tp5716346p5716470.html Sent from the Camel - Users mailing list archive at Nabble.com.

Using Camel with JDBCTemplate for Clob

2012-07-10 Thread dunnlow
Hi, I am using Camel 2.9 and Spring 3.1 I have been using the jdbc component to perform (transacted) inserts into my database. It has been working well. However, there is a new test object in the message that needs to be inserted into a Clob. There isn't much information about using camel to in

Bit-wise operators in Simple?

2012-06-11 Thread dunnlow
I just wanted to verify that I'm not missing something. I'd like to do bit arithmetic (i.e. use a bitmapped value). I know I could use javascript, but I like Simple's the null safe operator; however I don't see where bitwise operators exist in Simple. Is that correct? -- View this message in c

Re: How to force rollback in spring DSL route?

2012-06-07 Thread dunnlow
Thanks Claus. And in the vein of "teach a man to fish..." where would one find information about the command (is it safe to assume that if .rollback() exists there is a Spring counterpart)? Also, I had considered throwing an exception but was not sure how to do that in Spring DSL. Creating a

How to force rollback in spring DSL route?

2012-06-06 Thread dunnlow
Hi, I have a transacted route in Spring DSL that calls a service (via HTTP post). I want to examine the response from that service and force a rollback depending on the returned value. Basically something like: POST utf-8 test/xml ${header.CamelHttpRes

Re: Best Practice for splitting on header?

2012-06-02 Thread dunnlow
Thanks for your response; I'm sorry I don't fully understand your example. I looked at recipient list, but that seems to be for sending to multiple endpoints vs. a single endpoint with a mutated value. Basically, I'd like to loop through the values in a "split" header and send a message to the sa

Best Practice for splitting on header?

2012-05-23 Thread dunnlow
I have an existing REST web service that sends an alert based upon the provided "recipient" and "msgtext" (given in the GET url). In camel, I have a route that takes the recipient name and msg from the "sendTo" and "msg" headers and sends a request to the web service. This has been working fine.

Best way to timeout file consumer?

2012-03-20 Thread dunnlow
Hi, I'm using camel 2.9 and spring DSL I'm consuming files from a directory, which normally works great. The problem is that the directory is a network mount and sometimes it gets into an odd state where it exists but can not be read (e.g. I can 'cd' to the directory, but a directory listing 'ls

Re: SQL Component parameter order?

2012-03-06 Thread dunnlow
I wanted to add, I'm using Spring DSL routes. Also after some more thought, I'm thinking of two things to try: 1) come up with a way to create the SQL component parameter definition list on the fly based upon the order of the headers. 2) Create a converter for my POJO bean from Bean to List an

SQL Component parameter order?

2012-03-05 Thread dunnlow
I have an application that stores a POJO to a database. I read the attribute values from a variety of sources (JMS and XML File). I have been using a bean processor to construct the insert statement which I pass to my jdbc endpoint. This has been working, but now I need to insert more complex (H

Re: Accessing a Map header via Simple?

2012-02-01 Thread dunnlow
The answer for anyone else wondering: it turns out that the method above is correct. To access a Map contained in the header, you can use ${in.header.?[]} No quotes around the mapkey. Also, the .? seems to work too. nice. -- View this message in context: http://camel.465427.n5.nabble.com/Acce

Accessing a Map header via Simple?

2012-01-31 Thread dunnlow
Hi. I have a Map in my header and I am trying to access it via Simple in my spring dsl. I see an example using body in the documentation and am extrapolating that for my header purposes. However, I'm getting a NullPointerException, so I am thinking I've got bad syntax. My map holds key/value pa

http4 component

2011-09-29 Thread dunnlow
I am trying to use the http4 component to send information to a web service. I keep getting an error on the http4 endpoint: SendProcessor.java:102 - >>> Endpoint[http4://localhost:9090/service?name=Jay] Exchange[null] CamelLogger.java:186 - Failed delivery for exchangeid: On delivery attempt: 0

Re: Transform header values into jpa bean body?

2011-09-26 Thread dunnlow
Alan, my only thought was that adding the processor to the JPA Entity Bean seems odd to me (for some reason - I'm pretty new to JPA, but the beans I've used thus far have been very clean). It seems like there should be a way in Spring DSL to request that values in the header get passed to the cons

Re: Transform header values into jpa bean body?

2011-09-26 Thread dunnlow
Also, FYI. My current route for testing looks like: I have tracing enabled, and I see that the message going to the jpa component has the values set in the Header (which was passed in via the URL to the servlet), but the Body is null. -- View this message in context: http://camel.46542

Transform header values into jpa bean body?

2011-09-26 Thread dunnlow
Hi, I am using Spring and have a servlet component that is receiving the url parameters and placing them into header values. I have a JPA entity bean and I would like to take those passed in parameters (in the header values from the servlet component) load them into my entity bean and persist it i

Re: TypeConverter not being loaded?

2011-08-25 Thread dunnlow
I should add that I tried loading the converter class as a bean in my app-context.xml but that didn't do the trick either. -- View this message in context: http://camel.465427.n5.nabble.com/TypeConverter-not-being-loaded-tp4735055p4735153.html Sent from the Camel - Users mailing list archive at N

Re: Using a drools server in a route?

2011-08-25 Thread dunnlow
Willem, That is in fact the case - I am just calling the execute. For starters though, I've opted to implement this by creating a method in my pojo that creates a new instance of itself based on information in the header, sends itself to the service using httpclient, and loads the result in to mes

TypeConverter not being loaded?

2011-08-25 Thread dunnlow
I suppose I'm confused about how to load my TypeConverter. I have a Spring web-app running in tomcat (tried glassfish too), have an annotated class, and have placed a TypeConverter in several locations, including /META-INF/services/org/apache/camel, /WEB-INF, and /WEB-INF/classes. However, when C

Re: Using a drools server in a route?

2011-08-23 Thread dunnlow
Thanks for your response. My application is a web-based, stand-alone Camel Spring application. I have a separate server for Drools that should: receive pojo beans from my Camel app via web service, run my business rules, then return the result to my Camel app. My thought on the cxf component is

Using a drools server in a route?

2011-08-22 Thread dunnlow
First, I'm pretty new to camel (and drools) and this question teeters between the two. I've combed the Drools forum for an answer to this question, but the discussions there relate more to using camel within drools - they are not camel centric. So, my question: I'm trying to find out the best be

Re: noob spring testing question

2011-08-05 Thread dunnlow
Taariq, my bad. The version of the code I entered was not the exact version to which I was referring -a symptom of trying so many different things. I'm guessing the issue was with the fact that once I passed something to the route, it was no longer considered a consumer? Anyway, using the noop i

Re: noob spring testing question

2011-08-05 Thread dunnlow
Christian, Thank you! That was exactly what I was missing. As you suggested, I pass the body into the route via InputStream and Camel is smart enough to do the rest. Also, point taken about calling the methods directly for narrower unit tests - plan to do that as well. Thanks again. -J -- V

Re: noob spring testing question

2011-08-05 Thread dunnlow
Taariq, Thanks for getting back. Can you explain your point for #2. When I look at the documentation for the file component (http://camel.apache.org/file2.html) I read it to say that the noop option IS on the consumer. A route that starts with from("file://inbox/?noop=true") wont leave the file

noob spring testing question

2011-08-04 Thread dunnlow
I'm new to Camel (and relatively new to Spring). I've got a route with a bean up and running but I want to perform some unit testing. I'm trying to figure out how to "feed" my test with XML that is contained in a file. My working app has a bean with a method to load XML into the header paramet

Re: Reading XML file into a bean

2011-07-21 Thread dunnlow
The issue WAS with my XPath/name parsing. I ended up using method #3 and as Ashwin mentioned, I did not need to marshall. So the following works: from("file://c:/indir").beanRef("MyBean","fromXML").beanRef("myBean","toJdbc").to("jdbc:dataSource"); My fromXML method loads the Headers so that my

Reading XML file into a bean

2011-07-20 Thread dunnlow
I'd like to read XML files that will have some number of parameters defined for a bean and ultimately store the information into a database. Currently I am reading from a JMS queue and using a toJdbc method on my bean to create the sql to pass on to my database endpoint. That works fine. now I

Re: How to use JMS TextMessage Properties?

2011-07-11 Thread dunnlow
Claus, Doh, I just reread your reply, and set the method declaration in my bean to be: public String toSql(org.apache.camel.Message obj) { } which, (surprise surprise) gives me just what i need. Thanks again! -- View this message in context: http://camel.465427.n5.nabble.com/How-to-use-JMS-

Re: How to use JMS TextMessage Properties?

2011-07-11 Thread dunnlow
Claus, Thanks for the reply (your book has been a HUGE help btw). Sorry, I am still missing something. I understand your comment about the stream component, which clears up one question. However, I tried passing the message to a bean, as: ("activemq:queue:myholdingqueue?testConnectionOnStartup=

How to use JMS TextMessage Properties?

2011-07-11 Thread dunnlow
This seems like it should be easy, but I cannot figure out how to obtain the properties from a JMS TextMessage. I can obtain the body of the message with ConvertBodyTo() but I also need the properties. I'm using an ActiveMQ (v5.5) TestMessage and setting the properties in a different java app lik