JSON to POJO using Apache Camel and hibernate

2013-05-13 Thread bartleemans
Apache camel is using a route wich is listening to a specific url. the json from this url is then transformed to pojo classes and inserted in a mySQL database. Everything is working fine, except my foreign key still remains null. I'm using spring framework btw. Here is the url where you can find t

Re: Numbers of lines in a flat file

2013-05-13 Thread Claus Ibsen
Hi Seems a bit overkill to use EIP patterns to count the number of lines in a file. Maybe use a java method call for that instead with code to read the lines, and then at the end you can append the data also http://javarevisited.blogspot.se/2012/07/read-file-line-by-line-java-example-scanner.html

Re: Simple Example of Using Redis Subscriber Doesn't work

2013-05-13 Thread Claus Ibsen
Hi Thanks for letting us know. I can see there is a 1.0.4 release of spring-data-redis. I wonder if that release works out of the box? On Mon, May 13, 2013 at 10:11 PM, soumya_sd wrote: > I've posted a solution on the stackoverflow thread in case someone needs it > in the future. > > > > -- > V

How to make route wait for aggregator to aggregate?

2013-05-13 Thread Paulius Gasėnas
Hi guys, I‘m new to this forum. We have an issue with multicast and aggregation. Before calling route direct:putEvent, header correlationId is also set, so correlation is working. Goal, that we are trying to achieve here, is that we need, that after message is sent to routeX, which sends messa

Re: How do I change message body without changing response status

2013-05-13 Thread kalyan
I'm sorry.. but I have just found the solution. what I needed was: HttpOperationFailedException ex = exchange.getProperty(Exchange.EXCEPTION_CAUGHT, HttpOperationFailedException.class); ex.getStatusCode(); Thank you. -- View this message in context: http://camel.465427.n5.nab

Re: How do I change message body without changing response status

2013-05-13 Thread kalyan
Thank you for the reply Claus. However, the HTTP response code received is not constant. It changes with the input url (like 400, 404, 500, 503 etc). handled(true) is changing it to 200. Is there a way to preserve the response code with out getting to know its value ? -- View this message in

Re: Slow startup of routes

2013-05-13 Thread hussainpirosha
Thanks Willem, I am not clear how can we use caching for component creation, please elaborate on it. Need to set the soTimeout per endpoint since each dispatch message contain its endpoint and timeOut settings. Thanks, Hussain -- View this message in context: http://camel.465427.n5.nabble.co

Re: impliedDecimalSeparator not working for numbers starting with 0

2013-05-13 Thread Willem jiang
I just found there are some bugs in the code, so I fill a JIRA[1] for it. [1]https://issues.apache.org/jira/browse/CAMEL-6358 -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://w

Re: Numbers of lines in a flat file

2013-05-13 Thread Baalu
CamelSplitSize (or equivalent) is not part of headers. -- View this message in context: http://camel.465427.n5.nabble.com/Numbers-of-lines-in-a-flat-file-tp5732455p5732458.html Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Numbers of lines in a flat file

2013-05-13 Thread Christian Posta
Try getting it from the headers. On Mon, May 13, 2013 at 7:27 PM, Baalu wrote: > Hello, > > I am trying to count the number of the lines in a flatfile, once I get that > value I need to write it back to the flat file as part of the file footer. > > For now I did this: > > from("direct:fileLinec

Re: Steps to replace a direct call by a JMS proxy?

2013-05-13 Thread Christian Posta
May want to take a look at some of the intro material: http://camel.apache.org/getting-started.html Essentially, you'll need to define a route builder that a builds a route like: from("direct:endpoint").throttle().to("jms:queueName") http://camel.apache.org/cookbook.html http://camel.apache.org/

Numbers of lines in a flat file

2013-05-13 Thread Baalu
Hello, I am trying to count the number of the lines in a flatfile, once I get that value I need to write it back to the flat file as part of the file footer. For now I did this: from("direct:fileLinecount").routeId("fileCount") .pollEnrich("file://C:/fil

Re: impliedDecimalSeparator not working for numbers starting with 0

2013-05-13 Thread Willem jiang
It looks we need to add a rounding mode when calling the divide method. The default value which is used in the divide method is RoundingMode.UNNECESSARY. You will get the exception when the divide method don't know how to round. -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat

interceptFrom with a new consumer

2013-05-13 Thread samslara
Hello, I have a problem which I'm unsure on how to solve. So I have a route, say R1, that's pretty simple: http://localhost:8080/test"/> Now someProcessor may take a long time to return, so I want to alter the route's behavior such that it's more "async". What I mean by this is I want

Using CamelContextHelper the DataHandler cannot getInputStream

2013-05-13 Thread Josiah Mangiameli
Hey All, I am seeing some unexpected behaviour when using the CamelContextHelper. I am using the CamelContextHelper to generate an endpoint and receive an exchange. The exchange is an email message with a normal pdf attached. However when I attempt to get the Input Stream from the attachment I

Re: Slow startup of routes

2013-05-13 Thread Willem jiang
Hi, It looks like Camel takes lots of time to create a new Http endpoint, maybe you need to consider to do some caching work for it. BTW, whyou you need to se the soTimeout per endpoint. -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://w

Re: Route with doTry calling service does not have exchange.in=exchange.out does not work

2013-05-13 Thread apatel
Would you please check same issue exist in or not? -- View this message in context: http://camel.465427.n5.nabble.com/Route-with-doTry-calling-service-does-not-have-exchange-in-exchange-out-does-not-work-tp5732293p5732427.html Sent from the Camel - Users mailing list archive at Nabble.com.

onException: Global declaration at CamelHttpTransportServlet

2013-05-13 Thread kalyan
When a RouteBuilder defines onException in the following way, is it available for all RouteBuilders of the same CamelContext ? RouteBuilder routeBuilder = new RouteBuilder() { @Override public void configure() { onException(HttpOperationFailedException.class

Steps to replace a direct call by a JMS proxy?

2013-05-13 Thread Al Ferguson
Hi, I currently have a Java application that sends directly messages to a queue using a Spring JmsTemplate: I would like to take advantage of the facilities of Camel Throttling but I do not see how to define my route. Could someone help me and tell me what I have to do? Regards, Al. F -- View

impliedDecimalSeparator not working for numbers starting with 0

2013-05-13 Thread double_nill
With Camel 2.11 the impliedDecimalSeparator appears to have a problem with numbers starting with 0. For example: @DataField(pos = 1, precision = 10, length = 11, impliedDecimalSeparator = true) private BigDecimal foobar; value: 0123567 Throws an error Non-terminating decimal expans

Re: Simple Example of Using Redis Subscriber Doesn't work

2013-05-13 Thread soumya_sd
I've posted a solution on the stackoverflow thread in case someone needs it in the future. -- View this message in context: http://camel.465427.n5.nabble.com/Simple-Example-of-Using-Redis-Subscriber-Doesn-t-work-tp5732138p5732445.html Sent from the Camel - Users mailing list archive at Nabble.

Re: large war or several smaller wars

2013-05-13 Thread Christian Posta
Sorry, sent before pasting the link... https://community.jboss.org/wiki/IntegratingActiveMQWithJBoss On Mon, May 13, 2013 at 12:47 PM, Christian Posta wrote: > can you try with the activemq resource adapter? I found this, might be > useful: > > > > On Mon, May 13, 2013 at 11:34 AM, Preben.Asmu

Re: large war or several smaller wars

2013-05-13 Thread Christian Posta
can you try with the activemq resource adapter? I found this, might be useful: On Mon, May 13, 2013 at 11:34 AM, Preben.Asmussen wrote: > have you tried activemq resource adapters > > It should work with jboss > If you run into any trouble wi

Re: large war or several smaller wars

2013-05-13 Thread Preben.Asmussen
have you tried activemq resource adapters It should work with jboss If you run into any trouble with this try the activemq forum they should be able to help with activemq set

Re: large war or several smaller wars

2013-05-13 Thread anoordover
My JNDI solution doesn't seem to work. It seems as though I get a serialized object from JNDI. As I start producing messages new connections are created. Instead of reusing the pooledConnections. What i did is: 1. created a separate project that registers a org.apache.activemq.pool.AmqJNDIPooledCon

Re: add bean to registry in custom endpoint?

2013-05-13 Thread javamonkey79
Hmm, would it make sense for the Spring registry to be mutable? I can definitely see the case for unit testing (as I have submitted: https://issues.apache.org/jira/browse/CAMEL-6342), however, I'm not sure about the "live" registry. It seems that non-Spring allows for additional objects to be added

How to persist data from aggregator?

2013-05-13 Thread RTernier
I'm having an issue with aggregator. I have an incoming Web Service request that will be split into 2 messages and have the responses of both web requests aggregated together. This works fine, and I do get a good aggregated message within the aggregation route. However, once I'm out of that rout

Re: How do I change message body without changing response status

2013-05-13 Thread Claus Ibsen
Just set a header with the key Exchange.HTTP_RESPONSE_CODE and the integer for the code you want to use. Then Camel will use that. On Mon, May 13, 2013 at 6:53 PM, kalyan wrote: > I have a simple RouteBuilder as follows: > > RouteBuilder routeBuilder = new RouteBuilder() > { > @Override

How do I change message body without changing response status

2013-05-13 Thread kalyan
I have a simple RouteBuilder as follows: RouteBuilder routeBuilder = new RouteBuilder() { @Override public void configure() { onException(HttpOperationFailedException.class).handled(true) .process(new Processor() { @Override

Re: How to use camel servlet as httpproxy

2013-05-13 Thread kalyan
I noticed that there was a problem in stub implementation and so GET requests were not working properly. I don't think it is an issue with camel anymore. However, I notice that Camel specifically removes Content-Type header for GET requests even when the incoming request (to say "servlet:///test"

Re: Route with doTry calling service does not have exchange.in=exchange.out does not work

2013-05-13 Thread Claus Ibsen
Hi I found the source of the problem and logged a ticket to fix/improve this https://issues.apache.org/jira/browse/CAMEL-6357 On Mon, May 13, 2013 at 6:08 PM, Claus Ibsen wrote: > Hi > > Okay found the problem. > > When you copy the headers from IN to OUT in your custom code, you > should do lik

Re: Route with doTry calling service does not have exchange.in=exchange.out does not work

2013-05-13 Thread Claus Ibsen
Hi Okay found the problem. When you copy the headers from IN to OUT in your custom code, you should do like this exchange.getOut().getHeaders().putAll(headers); On Mon, May 13, 2013 at 3:25 PM, apatel wrote: > Claus, > > I am wondering why responses are difference when i use try-catch

Re: Route with doTry calling service does not have exchange.in=exchange.out does not work

2013-05-13 Thread Claus Ibsen
Hi If you use instead of then it ought to work. It seems like a little bug in On Mon, May 13, 2013 at 3:25 PM, apatel wrote: > Claus, > > I am wondering why responses are difference when i use try-catch and when i > remove the try-catch? > > > Thanks, > Amit Patel > > > > -- > View this messa

Re: rest webservice can't read parameteres

2013-05-13 Thread takidean
thanks for the reply but i have to send many qyeryparams and i cant extract them in the message body .i have to resolve the problem from camel -- View this message in context: http://camel.465427.n5.nabble.com/rest-webservice-can-t-read-parameteres-tp5732407p5732411.html Sent from the Camel -

Re: camel-stax use a custom bean handler not a class

2013-05-13 Thread timactive
Hi Romain, cool!! thank, i test this now!!! Le 13/05/2013 15:33, Romain Manni-Bucau [via Camel] a écrit : > Hi > > created https://issues.apache.org/jira/browse/CAMEL-6356 > > *Romain Manni-Bucau* > *Twitter: @rmannibucau * > *Blog: > **http://rmannibucau.wordpre

Camel-mongodb with Scala and JndiRegistry

2013-05-13 Thread Sven Richter
Hi, i am fairly new to camel and scala and try to get the hang of it. For this i want to write a small scala application which takes some input and writes it into a mongodb database. Looking at the camel-mongodb documentation i see i have to define a Mongo bean somewhere in my application so that

Re: rest webservice can't read parameteres

2013-05-13 Thread Sergey Beryozkin
This is because you mistyped the type of the parameter, the 2nd parameter should be annotated with @PathParam instead Sergey On 13/05/13 14:45, takidean wrote: Hi i use to send many parameters in my url but i find that message body catch only the first parameters this is my code: MessageResou

rest webservice can't read parameteres

2013-05-13 Thread takidean
Hi i use to send many parameters in my url but i find that message body catch only the first parameters this is my code: MessageResource @GET @Path("/id/{type}") @Produces("text/xml") public String getCustomer(@QueryParam("id") String n,@QueryParam("type") String s) { return "ok"; }

Re: How to use camel servlet as httpproxy

2013-05-13 Thread Claus Ibsen
Hi If you have a small sample project as a .zip or .tar then if some people have the time, they can take a look. Though no promises, as most of us is busy with all sorts of work stuff. The query parameters (assuming you refer to foo=bar&me=you, then they ought to be transferred when bridging. Th

Re: camel-stax use a custom bean handler not a class

2013-05-13 Thread Romain Manni-Bucau
Hi created https://issues.apache.org/jira/browse/CAMEL-6356 *Romain Manni-Bucau* *Twitter: @rmannibucau * *Blog: **http://rmannibucau.wordpress.com/* *LinkedIn: **http://fr.linkedin.com/in/rmannibucau* *Github: https://github.co

Re: Route with doTry calling service does not have exchange.in=exchange.out does not work

2013-05-13 Thread apatel
Claus, I am wondering why responses are difference when i use try-catch and when i remove the try-catch? Thanks, Amit Patel -- View this message in context: http://camel.465427.n5.nabble.com/Route-with-doTry-calling-service-does-not-have-exchange-in-exchange-out-does-not-work-tp5732293p5732

Re: Streaming a PDF from remote machine

2013-05-13 Thread Willem jiang
Are you using FTP to download the file? I'm not sure how the BufferedInputStream is involved. If the file is downloaded, the BufferedInputStream will never time out. If the BufferedInputStream has the timeout mechanism, I don't think you need to check if the File is download. -- Willem Jian

Re: Load balancing in Camel

2013-05-13 Thread nikagra
Hi Is there any updates on how to use load balancer with dynamic router. Thanks in advance -- View this message in context: http://camel.465427.n5.nabble.com/Load-balancing-in-Camel-tp473773p5732402.html Sent from the Camel - Users mailing list archive at Nabble.com.

Streaming a PDF from remote machine

2013-05-13 Thread Chinababu Illa
Hi All, I have a requirement to read a pdf as binary stream from remote application within specified time. My application code is using BufferedInputStream to read from remote application, code is implemented in Java. While reading the data, I need to apply 2 different timeouts: 1) a timeout fo

Re: camel-stax use a custom bean handler not a class

2013-05-13 Thread timactive
Thank Claus. Indeed, the code source camel-stax say : In processor ContentHandler handler = contentHandlerClass.newInstance(); In Component processor.setContentHandler(getCamelContext().getClassResolver(), remaining); So it is not possible actually. I am currently discussing with Romain Manni-Buc

Re: camel-stax use a custom bean handler not a class

2013-05-13 Thread Claus Ibsen
Hi Not sure if its possible to refer to a bean from the registry. Feel free to dive into the source code of camel-stax and see what needs to be done to support your use-case. We love contributions http://camel.apache.org/contributing.html So we could maybe just try to lookup a bean from the regi

Re: Amazon DynamoDB Support

2013-05-13 Thread Bilgin Ibryam
Hi eugene, I added ddb component some time ago. You are right, it doesn't have consumer, because I couldn't identify good use cases for it: like polling an entity or getting some callbacks from DynamoDB. But many components have only a producer with operations for retrieving data. That's also the

camel-stax use a custom bean handler not a class

2013-05-13 Thread timactive
Hi, I have a generic bean handler(extend DefaultHandler), this bean need a param to work correctly such as the nodeRoot, nodeItem etc.. I want use this bean with camel-stax but i think is not possible : In the documentation of camel-stax http://camel.

Re: Synchronous InOnly with new message

2013-05-13 Thread nikagra
Thanks for the reply I need the body. Message processing requires some steps (i.e. XSL transformation or some XML related processing with custom processors). I want on each of this step update processing status (i.e. QUEUED, STARTED, IN_PROGRESS, DONE). Task processing is performed asynchronously