RE: Dynamically configuring FTP component from Exchange input msg?

2012-08-24 Thread Graham Little
Hi Charles, Yes this is possible, you can get the value from either the header or the body content as you prefer and then you can use the recipientlist to create the dynamic endpoint. You could use something a little like this: Processor ftpProcesor = new Processor () { public void process(Exc

Re: @XPath evaluation

2012-08-24 Thread Christian Müller
Yes, should be possible. Sent from a mobile device Am 24.08.2012 13:56 schrieb "Joe San" : > The most common language to use is XPath, which allows you to evaluate > XPath > expressions on the message body. For example, suppose the message contains > the following > XML document: > > > in pr

Re: JsonEndpoint and Router

2012-08-24 Thread Marco Mistroni
THanks a lot Yogesh, that's exactly what i was looking for.. w/kindest regards marco On Fri, Aug 24, 2012 at 2:54 AM, ychawla wrote: > Hi Marco, > I have had a similar situation. I grab the JSON input, unmarshall to a > POJO, inspect the payload for a parameter, and then set a camel header fo

Re: UTF-8 and TypeConversionException

2012-08-24 Thread PJ Walstroem
ok, the solution was quite simple by using the charset as a parameter to convertBodyTo .convertBodyTo(String.class, com.google.common.base.Charsets.UTF_8.name()) -- View this message in context: http://camel.465427.n5.nabble.com/UTF-8-and-TypeConversionException-tp5717996p5718032.html Sent fro

Dynamically configuring FTP component from Exchange input msg?

2012-08-24 Thread Charles
I have a requirement to perform FTP operations on behalf of 100's of parties, all of which have their own FTP credentials.  Obviously, it would not be practical to configure 100's of instances of the FTP component with different user's login/password hardcoded in the URI.  I am wondering if ther

Re: Camel JMS to CSV (with Excel Strategy)

2012-08-24 Thread Joe San
Thanks for the suggestion. I was just messing around with the routes and transformations. I will have a look at the EIP's. Regards, Jothi On Fri, Aug 24, 2012 at 2:04 PM, Claus Ibsen wrote: > Hi > > I suggest to read background information about the EIPs you are using, > eg in this case the fi

Defaulting using XSLT.

2012-08-24 Thread anupamsen
Hi, I have a requirement such that I need to merge 2 XMLs, The sources are as follows - 1) XML coming in as an input payload as part of WS 2)The default values stored in DB in form of XML. The problem at hand is if the values of the defaulted tags are not provided in the incoming payload, then

Re: CamelContext autoStartup="false" not working

2012-08-24 Thread livensn
I see. Thanks for the explanation Claus -- View this message in context: http://camel.465427.n5.nabble.com/CamelContext-autoStartup-false-not-working-tp5717994p5718009.html Sent from the Camel - Users mailing list archive at Nabble.com.

Re: CamelContext autoStartup="false" not working

2012-08-24 Thread Claus Ibsen
On Fri, Aug 24, 2012 at 2:11 PM, livensn wrote: > I edited my original post with my camel version : 2.10.0 > > Here's the code of my route : > > public class ContactReportRoute extends RouteBuilder { > private static final Logger LOGGER = > Logger.getLogger(ContactReportRoute.class); > > @

Re: CamelContext autoStartup="false" not working

2012-08-24 Thread livensn
I edited my original post with my camel version : 2.10.0 Here's the code of my route : public class ContactReportRoute extends RouteBuilder { private static final Logger LOGGER = Logger.getLogger(ContactReportRoute.class); @Override public void configure() throws Exception {

Re: onException invoked even when there is no exception

2012-08-24 Thread Claus Ibsen
Hi You should move the onException outside the route. Or if you want it to be route specific, then configure it right after the from(). Not in the middle of the route. On Fri, Aug 24, 2012 at 7:56 AM, Murari Raghavan wrote: > Hello: > > In the below scenario - OnException is invoked every time,

Re: make aggregation time configurable

2012-08-24 Thread Claus Ibsen
Hi A good place to look is the EIP docs http://camel.apache.org/aggregator2 See the section _dynamic completion timeout_ You can then use the simple language as you do below. Or store a timeout in a header, and refer to that etc. There is also unit tests in camel-core, you can check out. On F

Re: CamelContext autoStartup="false" not working

2012-08-24 Thread Claus Ibsen
On Fri, Aug 24, 2012 at 12:38 PM, livensn wrote: > Hi all, > > I have this configuration : > > http://camel.apache.org/schema/spring";> > > > > xmlns="http://camel.apache.org/schema/spring"; autoStartup="false"> > > > > The first camelcontext should start automatically as it d

Re: Camel JMS to CSV (with Excel Strategy)

2012-08-24 Thread Claus Ibsen
Hi I suggest to read background information about the EIPs you are using, eg in this case the filter EIP. The filter is only for routing, its like an if structure: if X { } The filter does not alter, transform, or anyhow change the message. If you want to change the message, then look

CamelContext autoStartup="false" not working

2012-08-24 Thread livensn
Hi all, I have this configuration : http://camel.apache.org/schema/spring";> http://camel.apache.org/schema/spring"; autoStartup="false"> The first camelcontext should start automatically as it does. The second shouldn't start automatically because of autoStartup="false". Bu

Re: Camel JMS to CSV (with Excel Strategy)

2012-08-24 Thread Joe San
May be I started with a complex example. So I decided to start with a simple xml without namespace definitions: xyz Frankfurt jothi 32 Germany Goal is to read the above xml from inbox, split and extract the person and write that as an

Re: Camel JMS to CSV (with Excel Strategy)

2012-08-24 Thread Joe San
I tried this xpath example in my route and got the below exception: My Route definition: from("file://C:/folders/inbox?noop=true").split(xpath("/*/child::pss:persons/text()")).to("file://C:/folders/outbox"); Caused by: com.sun.org.apache.xpath.internal.domapi.XPathStylesheetDOM3Exception: Prefix

Re: Camel JMS to CSV (with Excel Strategy)

2012-08-24 Thread Joe San
I guess I got the wrong expression for xpath: org.apache.camel.builder.xml.InvalidXPathExpression: Invalid xpath: /*/child::pss:person/text(). Reason: javax.xml.xpath.XPathExpressionException at org.apache.camel.builder.xml.XPathBuilder.evaluateAs(XPathBuilder.java:686) at org.apache.camel

Re: JAXB Data Format

2012-08-24 Thread Joe San
Finally, I got this working. I had my folders in the same location where my java source files were located and I gave it a relative path. But now I moved them to a seperate folder and gave an absolute path which seemed to work. from("file://C:/folders/inbox").to("file://C:/folders/outbox"); Regar

Re: JAXB Data Format

2012-08-24 Thread Joe San
Thanks Claus. I have the following lines being shown in the console. [ main] DefaultCamelContextINFO Route: route1 started and consuming from: Endpoint[file://.?fileName=my.xml] [ main] DefaultCamelContextINFO Total 1 rout

UTF-8 and TypeConversionException

2012-08-24 Thread PJ Walstroem
hello, I have an XML which is UTF-8 encoded (according to itself, at least). The XML (unfortunately) contains a Triple DES encrypted password, which is stored in a database as VARCHAR (encoded in UTF-8 according to the DBA). When Camel (2.10) receives this message, I get an exception and the messag

Re: shutting down Camel, in-flight messages gone

2012-08-24 Thread Babak Vahdat
Hi and have you already checked the content of the dead letter queue? It's name per default is "ActiveMQ.DLQ"? Babak -- View this message in context: http://camel.465427.n5.nabble.com/shutting-down-Camel-in-flight-messages-gone-tp5717930p5717993.html Sent from the Camel - Users mailing list

make aggregation time configurable

2012-08-24 Thread Marco Westermann
Hi, I have a java route which uses the aggregate. I would like to make the completionTimeout configurable via properties. What I already tried is to set the timeout with the simple language, but then I get an error, that the value is not allowed. How could I manage to make the timeout configu

Re: Routing an ObjectMessage in ActiveMQ

2012-08-24 Thread Claus Ibsen
I would assume that when sending a object then AMQ uses a a stream to contain the data. And that stream is possible not re-readable when you send the message to the 2nd destination. AMQ itself have ways of auto forwarding messages, so you can have AMQ send to bar2, when you send to bar1. I am not

Re: Routing an ObjectMessage in ActiveMQ

2012-08-24 Thread jprio
Charles, Thank you for your answer. I tried your proposal. If I remove the '?jmsMapMessage=false' and I sent an ActiveMQTextMessage to 'foo' then I do receive an ActiveMQTextMessage in bar1 AND in bar2 (with jmsMapMessage=false, I receive an ActiveMQMessage). So I guess it should work with my Objec

Re: marshal object make of a hash map

2012-08-24 Thread lorenzo
Thanks, that was quick. I have used extensively xmlBeans in the past, I was not aware there was a support for it in Camel actually... looks like it's a pretty recent addition. I will read the tutorial you pointed to me, thanks and regards -- View this message in context: http://camel.465427.n

Re: marshal object make of a hash map

2012-08-24 Thread Charles Moulliard
Hi Lorenzo, As Apache Camel supports different DatFormat ( http://camel.apache.org/data-format.html) and specifically to handle XML : Object/XML marshalling - Castor - JAXB - XmlBeans

Re: Camel JMS to CSV (with Excel Strategy)

2012-08-24 Thread Joe San
Ok. After a bit of reading about xPath, I have the following. But not sure if this would work as expected. The xml: jothi 32 M The xPath: /*

Re: Camel JMS to CSV (with Excel Strategy)

2012-08-24 Thread Joe San
A small bug in that page: Most of the links under Variables result in a 404. http://camel.apache.org/xml/function/ gives a 404 I do not see anywhere in that page where there is some sample showing the extraction of a set of xml tags using xpath Regards, Jothi On Fri, Aug 24, 2012 at 8:51 AM, Ch

marshal object make of a hash map

2012-08-24 Thread lorenzo
Hello there, I've got a object which essentially is a hashmap representing the equivalent of a resultset for a DB. I would like to move that guy around, presumably under the form of an XML message. I am completely new to xstream, but it seems like this is the way to go for me. Any suggestions abou