Re: CSV to database

2011-11-23 Thread Romain Manni-Bucau
can you provide the qualified name of classes please? (or a unit test to reproduce the error) - Romain 2011/11/23 Idriss > What I do in my processor is : > > I get the message using this: > Message message = exchange.getIn(); > PccCommoncard pcc = message.getBody(PccCommoncard.class)

Re: CSV to database

2011-11-23 Thread Idriss
What I do in my processor is : I get the message using this: Message message = exchange.getIn(); PccCommoncard pcc = message.getBody(PccCommoncard.class); Then I instanciate OcPccCommoncard : OcPccCommoncard opcc = new OcPccCommoncard(); Then I fill the fields of this insta

Re: CSV to database

2011-11-23 Thread Romain Manni-Bucau
hmm, you can do it in you processor. The problem is the body the jpa endpoint retreives is not the class you specify in the endpoint itself. Either you mispelled it or you have to convert it. - Romain 2011/11/23 Idriss > I don't know how I will do that. > Can you explain that to me, please?

Re: CSV to database

2011-11-23 Thread Idriss
I don't know how I will do that. Can you explain that to me, please? Best, -- View this message in context: http://camel.465427.n5.nabble.com/CSV-to-database-tp4435750p5018467.html Sent from the Camel - Users mailing list archive at Nabble.com.

Re: CSV to database

2011-11-23 Thread Romain Manni-Bucau
try to convert your body from org.apache.camel.example.etl.BOPDEV.PccCommoncard to org.apache.camel.example.etl.IWIBO.OcPccCommoncard before the jpa endpoint. - Romain 2011/11/23 Idriss > I tried with this : > to("jpa:org.apache.camel.example.etl.IWIBO.OcPccCommoncard") > > But I have the foll

Re: CSV to database

2011-11-23 Thread Idriss
I tried with this : to("jpa:org.apache.camel.example.etl.IWIBO.OcPccCommoncard") But I have the following error : [ample.etl.BOPDEV.PccCommoncard] DefaultErrorHandlerERROR Failed delivery for exchangeId: ID-oulmakhzoune-PC-52598-1322086931344-0-459. Exhausted after delivery attempt:

Re: Queue/Dequeue perfomance InOut ExchangePattern

2011-11-23 Thread Christian Müller
Instead of one route which sends the request to the broker, wait for the response and return the response (InOut message exchange pattern), you could use one route which only send the request to the broker (e.g. to queue A) without waiting of a response (InOnly) and a second (InOnly) route which re

Re: CSV to database

2011-11-23 Thread Christian Müller
Why did you use to("org.apache.camel.example.etl.IWIBO.OcPccCommoncard") and not to("jpa:org.apache.camel.example.etl.IWIBO.OcPccCommoncard") ? Best, Christian On Wed, Nov 23, 2011 at 7:01 PM, Idriss wrote: > I tried this method : > > from("jpa:org.apache.camel.example.etl.BOPDEV.PccCommoncard

Re: Defining a CXF bus in Blueprint for use with cxfbean endpoint

2011-11-23 Thread Daniel Kulp
On Wednesday, November 23, 2011 12:03:08 PM Brian Topping wrote: > Some more details about what I am doing. I've distilled the configuration > down to what's below. It's Camel 2.9-SNAPSHOT running on Karaf 2.2.4, with > CXF 2.4.3. > > About five lines from the end, there are two endpoints that I

Re: Defining a CXF bus in Blueprint for use with cxfbean endpoint

2011-11-23 Thread Brian Topping
On Nov 23, 2011, at 12:05 PM, Claus Ibsen wrote: > From the XSD > http://camel.apache.org/schema/blueprint/cxf/camel-cxf.xsd > > I can see a "bus" attribute. Thanks Claus. I guess you must be talking about the element at line 54, as I mentioned that's a child of the cxfEndpoint. It seems lik

Re: CSV to database

2011-11-23 Thread Romain Manni-Bucau
you should at least create the emf only once and put it in your context i think. - Romain 2011/11/23 Idriss > Hi Romain, > > Yes, in my processor I create EntityManagerFactory, EntityManager and > EntityTransaction for each message. > > > Idriss > > -- > View this message in context: > http://

Re: CSV to database

2011-11-23 Thread Idriss
Hi Romain, Yes, in my processor I create EntityManagerFactory, EntityManager and EntityTransaction for each message. Idriss -- View this message in context: http://camel.465427.n5.nabble.com/CSV-to-database-tp4435750p5017515.html Sent from the Camel - Users mailing list archive at Nabble.com.

Re: connecting to new jms implementation

2011-11-23 Thread Christian Schneider
The complexity of the JMSComponent comes from the many options it has and of course the request / reply behaviour. I would start with a purely async component. The camel-xmpp component might be a good starting point. Just change it to use your special jms. Christian Am 23.11.2011 17:21, schr

Re: how to call route from other route?

2011-11-23 Thread Hadrian Zbarcea
Not sure if this was answered. I think you were looking for the enricher pattern. Since you use ftp which uses a poll consumer take a look at pollEnrich [1]. Keep in mind that you can select your file at runtime too, via using a header. Cheers, Hadrian [1] http://camel.apache.org/content-enri

Re: CSV to database

2011-11-23 Thread Idriss
I tried this method : from("jpa:org.apache.camel.example.etl.BOPDEV.PccCommoncard?consumeDelete=false&delay=3000&consumeLockEntity=false") .process(new MyProcessor()) .to("org.apache.camel.example.etl.IWIBO.OcPccCommoncard"); But I get this error: Error occurred wh

Re: connecting to new jms implementation

2011-11-23 Thread Claus Ibsen
Hi Maybe just implement a new Camel component instead of reusing JMS. Then you can still use producer template to send message to endpoints of this component. On Wed, Nov 23, 2011 at 5:21 PM, saiya-jin wrote: > Hello, > I have been given a task to integrate Camel to rather unstandard JMS > impl

Re: Defining a CXF bus in Blueprint for use with cxfbean endpoint

2011-11-23 Thread Claus Ibsen
>From the XSD http://camel.apache.org/schema/blueprint/cxf/camel-cxf.xsd I can see a "bus" attribute. I would assume the blueprint XSD is very similar to the Spring XSD, where you can set a bus etc. On Wed, Nov 23, 2011 at 6:03 PM, Brian Topping wrote: > Some more details about what I am doing

Re: Defining a CXF bus in Blueprint for use with cxfbean endpoint

2011-11-23 Thread Brian Topping
Some more details about what I am doing. I've distilled the configuration down to what's below. It's Camel 2.9-SNAPSHOT running on Karaf 2.2.4, with CXF 2.4.3. About five lines from the end, there are two endpoints that I've been trying to work with. The first one with cxfbean works fine,

Re: setting jms headers and defining daa types

2011-11-23 Thread Claus Ibsen
Hi A in the XML DSL will be a String type. If you are using Camel 2.8 you can use the simple language where you can specify a result type http://camel.apache.org/simple        1234567893214411 You can omit the java.lang when referring to the Java built-in types from java.lang. But you can

setting jms headers and defining daa types

2011-11-23 Thread tnk
Hello, I am setting jms message headers inspring dsl like this: 1234567893214411 and sending message to IBM Websphere MQ. Is it possible to define the value type (for example long)? In my case it is stored in ibm mq message RFH2 like: 1234567893214411 It causes problems other appl

connecting to new jms implementation

2011-11-23 Thread saiya-jin
Hello, I have been given a task to integrate Camel to rather unstandard JMS implementation that is coming with one of core banking packages. It basically serves as a bridge that transforms JMS messages to SQL so queues are in fact tables underneath. I tried simple approach with setting up their int

Re: CAMEL is throwing error

2011-11-23 Thread Taariq Levack
I see. If Server_9900 is the sender/producer/client, then the name Server_9900 is a misnomer, but I understand now server has a different meaning in your program. I would do something like this to send to the consumer, and get a response, copied from a unit test[1]. String reply = template.reques

Re: Is RMS faster than JMS?

2011-11-23 Thread James Strachan
On 23 November 2011 14:02, KingAndrew wrote: > Thanks for the input.  The whole question comes from my clients that have > used corba/rmi for 15 years.  Now that we are switching to > Camel/ActiveMQ/JMS they all say: >  "It might scale better but I don't see how it can be as fast as Corba/RMI" Ma

Re: Is RMS faster than JMS?

2011-11-23 Thread KingAndrew
Thanks for the input. The whole question comes from my clients that have used corba/rmi for 15 years. Now that we are switching to Camel/ActiveMQ/JMS they all say: "It might scale better but I don't see how it can be as fast as Corba/RMI" I couldn't find any performance test results say for:

Re: Catch camel exception in java code

2011-11-23 Thread majiedahamed
Thanks ..it is working,there was problem in my war -- View this message in context: http://camel.465427.n5.nabble.com/Catch-camel-exception-in-java-code-tp5015714p5016667.html Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Catch camel exception in java code

2011-11-23 Thread Claus Ibsen
On Wed, Nov 23, 2011 at 2:18 PM, majiedahamed wrote: > The camel version is 2.4 > There could be an issue with that old Camel release. If you bean has a signature of Exchange as below: public void doSomething(Exchange exchange) { Object caught = exchange.getProperty(Exchange.EXCEPTION_CAUGHT

Re: Catch camel exception in java code

2011-11-23 Thread majiedahamed
Also please suggest how can i use @ExchangeException To bind to an Exception set on the exchange (Camel 2.0) here ..!! -- View this message in context: http://camel.465427.n5.nabble.com/Catch-camel-exception-in-java-code-tp5015714p5016642.html Sent from the Camel - Users mailing list archive a

Re: Catch camel exception in java code

2011-11-23 Thread majiedahamed
The camel version is 2.4 1)the original code is +++ org.apache.camel.processor.validation.SchemaValidationException org.xml.sax.SAXParseException org.apache.camel.ValidationException java.lang.Exception tru

Re: Catch camel exception in java code

2011-11-23 Thread majiedahamed
Sorry class is like this public class MyBean { public void doSomething(Object body, Exception cause) { cause.printStackTrace(); } } -- View this message in context: http://camel.465427.n5.nabble.com/Catch-camel-exception-in-java-code-tp5015714p5016574.h

Re: Catch camel exception in java code

2011-11-23 Thread Claus Ibsen
What version of Camel are you using? On Wed, Nov 23, 2011 at 1:57 PM, majiedahamed wrote: > Thanks.. > > I went through the link > > 1) > > 2) >   .. >   >   > > 3)My class goes like this >        public void doSomething(Object body, Exception cause) { >                cause.printStackTrace();

Re: Catch camel exception in java code

2011-11-23 Thread majiedahamed
Thanks.. I went through the link 1) 2) .. 3)My class goes like this public void doSomething(Object body, Exception cause) { cause.printStackTrace(); } And in the route when the exeption occurs,It is not printing the exception I also tried

Re: CAMEL is throwing error

2011-11-23 Thread newbiee
Tariq, Thanks for the reply. Server_9900 is written to send messages to CAMEL, and to it "java program" needs to be started prior to running CAMEL application (is this not the right thing to do) . How can otherwise, messages be sent to port 9201 for CAMEL to consume? -- View this message in con

Re: CAMEL is throwing error

2011-11-23 Thread Taariq Levack
Server_9900 is claiming the same port as camel, so for sure it's unavailable to camel. Taariq On Wed, Nov 23, 2011 at 1:10 PM, newbiee wrote: > Tariq, > > Attached is the entire program. This is a very simple route and it doesn't > require me to copy code from Hadrian's example. > > http://ca

Re: Catch camel exception in java code

2011-11-23 Thread Claus Ibsen
Hi The bean parameter binding can happen automatic for certain types and conventions. Read more here http://camel.apache.org/bean-binding.html Also chapter 4 in the Camel in Action book covers all about using beans with Camel, incl. the parameter binding rules. So you only need to declare the

Re: How to write or append content to XML file without XML declaration

2011-11-23 Thread Christian Schneider
Hi Santosh, you can use an Aggregator with a custom AggregationStrategy to build your output. One problem with the aggregator is that it needs to determine when to send the aggregated exchange. So in the example I used a timeout. This is not really good though. So if possible for your case the

Re: How to reset the body content before routing to next endpoint

2011-11-23 Thread kanmisc
Thanks for the reply. Yes, i tried that first. But the use case here is different. No need to move the same file(consumed in /ftpIn/ route) to error/success locations. move and moveFailed options worked in this case. But the bean(registrationProcess) creates 2 different files in different locatio

RE: Queue/Dequeue perfomance InOut ExchangePattern

2011-11-23 Thread Carlos Manuel Figueiredo
I managed to get the ConsumerTemplate working like this: private class InOutProcessor implements Processor { public void process(Exchange exchange) throws Exception { exchange.setIn(getContext().createConsumerTemplate().receive("activemq:queue:m

Re: Catch camel exception in java code

2011-11-23 Thread majiedahamed
Thank you so much Can you please elaborate on bean paramater binding with camel for Exception object Fot this case what will be the below details .. Public class MyBean{ // ?? variables types in beans public void doSomething(Object body, Exception cause) { }

RE: Too many OnCompletion threads

2011-11-23 Thread Zhemzhitsky Sergey
Claus, Thanks a lot for shedding light on this issue. Regards, Sergey -Original Message- From: Claus Ibsen [mailto:claus.ib...@gmail.com] Sent: Wednesday, November 23, 2011 2:36 PM To: users@camel.apache.org Subject: Re: Too many OnCompletion threads On Wed, Nov 23, 2011 at 7:50 AM, Z

Re: CAMEL is throwing error

2011-11-23 Thread newbiee
Tariq, Attached is the entire program. This is a very simple route and it doesn't require me to copy code from Hadrian's example. http://camel.465427.n5.nabble.com/file/n5016269/netty.zip netty.zip Attached is the java program that I run prior to executing CAMEL application. http://camel.46

Re: Topic consume with polling (connection, thread) Need exmple

2011-11-23 Thread bvahdat
Hi not sure if I really understand you right, nevertheless I give it a try: looking at the POC code you provided in [1] your (jms) consumer is inside the class you called RouteProducer. For that consumer you could for sure setup connection pooling as well as thread-pooling capabilities, see the "

Re: IBM WAS - Aries 0.1 and Camel

2011-11-23 Thread Claus Ibsen
Hi Would be using plain WAR files an option? Until WAS gets updated to a recent release of Aries. On Tue, Nov 22, 2011 at 11:16 PM, mattmadhavan wrote: > Hello, > I have been struggling with this issue for a while and any help/insights > will be greatly appreciated! > > I'm struck with WAS v7

Re: Is RMS faster than JMS?

2011-11-23 Thread James Strachan
If you can use asynchronous messaging, then messaging is typically much faster (especially when you start to use transaction batching) as you're not sat blocking waiting on RPC calls. e.g. on the consumer side, the message broker will asynchronously stream messages into your process space so there'

Re: Too many OnCompletion threads

2011-11-23 Thread Claus Ibsen
On Wed, Nov 23, 2011 at 7:50 AM, Zhemzhitsky Sergey wrote: > Hello Claus, > > Does it mean that I can export custom ExecutorService as OSGi service and > then reuse it across all the camel applications I have? > Is that way safe enough to avoid different classloading issues in OSGi > environment

Re: Topic consume with polling (connection, thread) Need exmple

2011-11-23 Thread cbenaveen
Babak, >From the [1] PooledConnectionFactory API doc, i understand that the polling can be achieved for the producer, not for the consumer. My requirement is more off pooling consumer connection/sesssion rather than producer. [1] http://activemq.apache.org/maven/activemq-core/apidocs/org/apache/

Re: Is RMS faster than JMS?

2011-11-23 Thread Ioannis Canellos
Hi Andrew, Faster is a tricky term. You can say that runner A is faster than runner B, when you have them both run the same distance. In 100m A might be faster than B, but B might have more stamina and manage to get first in a longer distance say 300m. In your question I can see runner RMI and r

[ANN] Apache Camel 2.8.3 Release

2011-11-23 Thread Willem Jiang
Hi, The Camel PMC is glad to announce the availability of Apache Camel 2.8.3. This release resolved over 60+ JIRA issues (mostly bugs) reported by users. You can download[1] the Camel 2.8.3 now, and please checkout the release notes here[2]. [1]http://camel.apache.org/download.html [2]http

Re: How to write or append content to XML file without XML declaration

2011-11-23 Thread santoshjoshi
Hi Claus, Thanks for replying, I havn't tried spliting using *XPATH*, I Will try and revert. Regards Santosh -- View this message in context: http://camel.465427.n5.nabble.com/How-to-write-or-append-content-to-XML-file-without-XML-declaration-tp5014969p5016047.html Sent from the Camel - Us

Re: How to write or append content to XML file without XML declaration

2011-11-23 Thread santoshjoshi
Hi Christian, My xml is like this, having cities as root element XYZ 1 ABC 1 XYZ 2 ABC 2 and

Re: Accessing OSGI Services from Camel Routes

2011-11-23 Thread Ioannis Canellos
Hi Anurag, Regardless of camel any OSGi service is just an object and its treated no different than other objects. Using spring or blueprint you can obtain a reference to an OSGi service and it can be treat as bean. In Camel things are no different you treat services like beans. Here is an exampl

Re: Catch camel exception in java code

2011-11-23 Thread Claus Ibsen
Hi Just route to a bean in the section. .. And the spring bean And the bean signature uses bean parameter binding with Camel For example the 1st parameter is the message body, the 2nd the caused exception etc. public void doSomething(Object body, Exception cause) { } On Wed, Nov

Re: Accessing OSGI Services from Camel Routes

2011-11-23 Thread Anurag Sharma
Hi Willem, Thanks so much for your response. Would you mind further explaining what you mean when you say "export your Services as a bean component". In Camel, if I access a bean and its not their in camel registry, can we make it search the OSGI registry? I am struggling to find any examples or d

RE: Selective Multicast

2011-11-23 Thread Narita Bagchi
This is how I did it - from("file:inbox") .multicast() .to("seda:a") .choice() .when(header("foo").isEqualTo("one")) .to("log:org.apache.camel.DeadLetterChannel?level=error") .otherwise() .to("file://d://log//camel//output1") .to("seda:

Re: How to write or append content to XML file without XML declaration

2011-11-23 Thread Christian Schneider
Hi Santosh, you should also be aware that a file like the following is no valid xml. XYZ au ABC ad An xml file has to contain exactly one root element. Christian Am 22.11.2011 23:13, schrieb santoshjoshi: Environment Camel:2.8.1 java 6 i have a pojo like @XmlRootEle

Re: Accessing OSGI Services from Camel Routes

2011-11-23 Thread Willem Jiang
On Wed Nov 23 08:31:42 2011, Anurag Sharma wrote: Hi All, We are in the process of porting from JBoss to Karaf. In Jboss we have the concept of SARs (Service Archives). They are essentially services having an MBean interface and they have their own lifecycle. We are planning to model these as OS

Catch camel exception in java code

2011-11-23 Thread majiedahamed
Hi, I have the following exception handling in one of the route,Camel is catching the exception given in the list into the log file.All i want is to catch the same exception in java code to handle with some logic.I wanted to format a response message with the faliure flag and exception description

Re: CSV to database

2011-11-23 Thread Christian Müller
Any good reason not to do it like this? from("jpa://XXX") .process(new MyConverter()) .to("jpa://YYY") or from("jpa://XXX") .transacted() .process(new MyConverter()) .to("jpa://YYY") Best, Christian On Wed, Nov 23, 2011 at 12:39 AM, Idriss wrote: > Hi, > > I mean with long that is