Handle multipart/form-data with REST DSL

2019-02-07 Thread Tim Dudgeon
I'm struggling to work out how best to handle a multipart/form-data using the REST DSL. My first attempt was to use Camel's MIME-Multipart  data handler [1] which works, but gave me the problem that it automatically keeps the first part of the message (first form field) as the Exchange body,

Re: HTTP response is not being chunked

2019-01-23 Thread Tim Dudgeon
uot; parameter. HTH On Wed, 16 Jan 2019, 15:17 Tim Dudgeon Hi Luiz, here are the request headers. For Apache HTTPClient: accept -> chemical/x-mdl-sdfile accept-encoding -> gzip breadcrumbId -> ID-6667e3dab68a-38877-1547658276076-0-15 CamelHttpMethod -> POST Cam

Re: HTTP response is not being chunked

2019-01-17 Thread Tim Dudgeon
want Transfer-Encoding to be chunked. So either I'm not aware of any option that allows this, or alternatively it could really be considered a bug. Can any Camel guru comment on this? BTW - I'm using Camel 2.18.0 which I know is a little old. Tim On 17/01/2019 07:44, Tim Dudgeon wrote: Yes

Re: HTTP response is not being chunked

2019-01-16 Thread Tim Dudgeon
onfiguring the headers with curl's "-H" parameter. HTH On Wed, 16 Jan 2019, 15:17 Tim Dudgeon Hi Luiz, here are the request headers. For Apache HTTPClient: accept -> chemical/x-mdl-sdfile accept-encoding -> gzip breadcrumbId -> ID-6667e3dab68a-38877-154765827

Re: HTTP response is not being chunked

2019-01-16 Thread Tim Dudgeon
duardo Valmont wrote: Hi, Tim! I'd suggest trying to intercept / dump the HttpAsyncClient request as well as the curl one. A simple "nc -l -p " in an *NIX OS will do. My guess is that the perceived difference lies in the request headers. Might be in the Accept. Can you post both req

HTTP response is not being chunked

2019-01-16 Thread Tim Dudgeon
I'm hitting a strange problem with a route that is using the servlet component to send a large stream of data in its response. This is part of a route that uses the REST DSL which is set up like this: restConfiguration().component("servlet").host("0.0.0.0"); The route sets the response body as

Re: reading multipart mime dataformat

2018-06-08 Thread Tim Dudgeon
at 6:00 PM, Tim Dudgeon wrote: I'm wanting to send a small set of files to a HTTP server as a POST request and have Camel handle the request. Seems like one way of doing this is to use curl on the sending end to create the POST request and have the Camel MIME-Multipart data format [1] handle

Re: reading multipart mime dataformat

2018-06-08 Thread Tim Dudgeon
at 6:00 PM, Tim Dudgeon wrote: I'm wanting to send a small set of files to a HTTP server as a POST request and have Camel handle the request. Seems like one way of doing this is to use curl on the sending end to create the POST request and have the Camel MIME-Multipart data format [1] handle

reading multipart mime dataformat

2018-06-07 Thread Tim Dudgeon
I'm wanting to send a small set of files to a HTTP server as a POST request and have Camel handle the request. Seems like one way of doing this is to use curl on the sending end to create the POST request and have the Camel MIME-Multipart data format [1] handle the request on the receiving

Re: host not found when using http4 in docker container

2018-06-06 Thread Tim Dudgeon
:35, Willem Jiang wrote: Can you add a link to the camel container just like this ? camel: image: "camel:0.3.0-SNAPSHOT" hostname: camel links: - "otherHost" - "zipkin:zipkin.io" Willem Jiang Twitter: willemjiang Weibo: 姜宁willem On Wed, Jun 6, 2018 at 4:40 AM,

Re: host not found when using http4 in docker container

2018-06-06 Thread Tim Dudgeon
add a link to the camel container just like this ? camel: image: "camel:0.3.0-SNAPSHOT" hostname: camel links: - "otherHost" - "zipkin:zipkin.io" Willem Jiang Twitter: willemjiang Weibo: 姜宁willem On Wed, Jun 6, 2018 at 4:40 AM, Tim Dudgeon wrote: On 05/06/18 20:

Re: host not found when using http4 in docker container

2018-06-05 Thread Tim Dudgeon
On 05/06/18 20:40, Robin Vanderhallen wrote: Are both containers in the same network in the docker compose file? Yes. Both are in the same network environment, but this is not the default network.     networks:     - xxx Tim

host not found when using http4 in docker container

2018-06-05 Thread Tim Dudgeon
I'm running camel inside a Docker container and trying to use the HTTP4 component to post a request to a service running in a different container (both containers are managed through Docker compose). Essentially I'm trying to do a post to a route like this:

Writing to message body

2017-12-11 Thread Tim Dudgeon
I have a payload that is generated in a Camel Processor that allows its data to be obtained with a writeTo(OutputStream out) method. Is there an easy way to use this to write to the output Message's body using this method? e.g. Normally you might have an InputStream and and set it using

Re: MIME-Mutipart DataFormat streaming?

2017-12-11 Thread Tim Dudgeon
is stream capbable, but for unmarshalling, I think that the javamail component will create ByteArrayDataSources at least for the attachments. Best regards Stephan -Original Message- From: Tim Dudgeon [mailto:tdudgeon...@gmail.com] Sent: Dienstag, 25. Oktober 2016 14:21 To: users

Re: Specifying file names using Dropbox component

2017-01-30 Thread Tim Dudgeon
JIRA issue: https://issues.apache.org/jira/browse/CAMEL-10768 -- View this message in context: http://camel.465427.n5.nabble.com/Specifying-file-names-using-Dropbox-component-tp5793105p5793222.html Sent from the Camel - Users mailing list archive at Nabble.com.

Specifying file names using Dropbox component

2017-01-27 Thread Tim Dudgeon
I'm trying to use the Dropbox component and got the basics working. The docs for this component suggest that when working with files (e.g. using the get operation) the file name have to be included in the route URL e.g. like this: to("dropbox://get?accessToken=XXX=XXX=/root/folder1/file1.tar.gz")

Re: Using Box component

2017-01-27 Thread Tim Dudgeon
So I looked at using Dropbox instead, and found that Camel is using a deprecated version of that API that will be turned off this year. I created https://issues.apache.org/jira/browse/CAMEL-10754 for this. -- View this message in context:

Re: Using Box component

2017-01-27 Thread Tim Dudgeon
Here is the JIRA issue: https://issues.apache.org/jira/browse/CAMEL-10753 -- View this message in context: http://camel.465427.n5.nabble.com/Using-Box-component-tp5792922p5793098.html Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Using Box component

2017-01-26 Thread Tim Dudgeon
What I've found out so far is that the box library used by Camel is an old project. The one currently recommended by box.com is this this GitHub project https://github.com/box/box-java-sdk which has maven coordinates of com.box:box-java-sdk:2.1.1

Re: Using Box component

2017-01-26 Thread Tim Dudgeon
Any thoughts on how to address this? As the box route starts OK and I'm only getting this error when I trigger an event on the box.com side it seems to me that the authentication is working OK (but how can I be sure of this?). I checked the version of the box java library being used and Camel

Re: MIME-Mutipart DataFormat streaming?

2016-10-29 Thread Tim Dudgeon
, but for unmarshalling, I think that the javamail component will create ByteArrayDataSources at least for the attachments. Best regards Stephan -Original Message- From: Tim Dudgeon [mailto:tdudgeon...@gmail.com] Sent: Dienstag, 25. Oktober 2016 14:21 To: users@camel.apache.org Subject

MIME-Mutipart DataFormat streaming?

2016-10-25 Thread Tim Dudgeon
I was looking at the MIME-Mutipart DataFormat and it looks very useful: https://camel.apache.org/mime-multipart.html But I was not sure if it fully streams the data for the body and attachments, or whether it holds the content in memory (this is for both marshalling and unmarshalling).

old javadocs on website?

2016-10-22 Thread Tim Dudgeon
This page on the website: https://camel.apache.org/javadoc.html links to here http://camel.apache.org/maven/current/camel-core/apidocs/index.html for the core javadocs. But that page is for the 2.15.0 version, so it a bit out of date. Are the current versions available, and can web site be

regression with REST DSL PUT operations using auto binding?

2016-05-30 Thread Tim Dudgeon
I think I've hit a regression in 2.17.1 (worked in 2.16.2) with PUT operations with REST DSL. When the input contains a body (and only if it does, and only with PUT) the auto binding of the output does not seem to work. Something like: .put("/some/path").description("Update something")

Re: swagger injects empty headers in 2.17.0

2016-04-07 Thread Tim Dudgeon
On 07/04/2016 06:12, Claus Ibsen wrote: Hi Ah can you log that in the JIRA Done: https://issues.apache.org/jira/browse/CAMEL-9828

swagger injects empty headers in 2.17.0

2016-04-06 Thread Tim Dudgeon
I'm hit a wierd problem when trying to upgrade from 2.16.2 to 2.17.0 I have routes built using REST DSL, and this includes swagger definitions. With 2.1.6.2 all was good. On switching to 2.17.0 I find that having a swagger query parameter definition causes a header property to be defined as an

Re: CDI questions

2016-04-06 Thread Tim Dudgeon
pgrade your Camel dependencies to 2.17.0 version? That should solve the issues. Antonin On 06 Apr 2016, at 18:13, Tim Dudgeon <tdudgeon...@gmail.com> wrote: Hi Antonin I tried your suggestion for problem 2, but couldn't get it to work. I've put an example that illustrates both problems

Re: CDI questions

2016-04-06 Thread Tim Dudgeon
. To reproduce the second one uncomment line 25 from the same class. Tim On 06/04/2016 16:09, Antonin Stefanutti wrote: Hi Tim, On 06 Apr 2016, at 16:19, Tim Dudgeon <tdudgeon...@gmail.com> wrote: I've found a couple of things I don't understand when using the camel-cdi compone

CDI questions

2016-04-06 Thread Tim Dudgeon
I've found a couple of things I don't understand when using the camel-cdi component. 1. The @ContextName("customname") annotation can be used to specify a custom name for the camel context. But I'm finding that this annotation is essential. e.g. if my app comprise just of a couple of classes

Re: security requirement using swagger java

2016-03-24 Thread Tim Dudgeon
Done: https://issues.apache.org/jira/browse/CAMEL-9751 On 24/03/2016 07:51, Claus Ibsen wrote: Hi No its not included currently. You are welcome to log a JIRA about this so we can add it in a future release http://camel.apache.org/support.html On Wed, Mar 23, 2016 at 9:59 PM, Tim Dudgeon

security requirement using swagger java

2016-03-23 Thread Tim Dudgeon
Hi Is it possible to specify swagger security requirements (http://swagger.io/specification/#securityRequirementObject) using the swagger java component? I can't figure it out and can't find any examples. Tim

Re: Camel - CDI and Servlet Context Implementation

2016-01-26 Thread Tim Dudgeon
I didn't see any answer to this, and have hit the same. I've got Camel running in Tomcat using camel-servlet and camel-servletlistener as described here: http://camel.apache.org/servletlistener-component.html Also, independently I've used the new camel-cdi stuff found here:

Re: State of the camel-cdi component

2016-01-04 Thread Tim Dudgeon
and switch back to the official one once that gets merged and released into the official component. Antonin On 04 Jan 2016, at 19:37, Tim Dudgeon <tdudgeon...@gmail.com> wrote: Hi, Was wondering what the latest status was here (read below)? I'm trying to adapt a camel-servlet app to u

Re: State of the camel-cdi component

2016-01-04 Thread Tim Dudgeon
Hi, Was wondering what the latest status was here (read below)? I'm trying to adapt a camel-servlet app to use CDI and it's not clear how to best go about this. Thanks Tim On 11/12/2014 16:07, Charles Moulliard wrote: Hi Jason, I'm working with Antonin on that new camel-cdi. when the code

manual ack with rabbitmq

2016-01-03 Thread Tim Dudgeon
What is the way to do manual acknowledgement using the RabbitMQ component? I see you can set autoAck=false in the component properties, and the rabbitmq.DELIVERY_TAG header gives the delivery tag. But how does one get hold of the channel to do a manual acknowledgement? Thanks Tim

Re: manual ack with rabbitmq

2016-01-03 Thread Tim Dudgeon
Thanks. So it looks like it will get acknowledged by Camel as long as the route doesn't throw an exception. That's good! Tim On 03/01/2016 17:09, Preben.Asmussen wrote: manuel acknowlendgement using channel.basicAck is done internally by the RabbitMQConsumer when the message is processed. See

what's happening to camel extra?

2015-08-19 Thread Tim Dudgeon
Now that the Google code site is about to switch to read only (https://code.google.com/a/apache-extras.org/p/camel-extra/) I wondered what is going to happen to the Camel Extras stuff? Tim

Re: using spock to test camel

2015-07-03 Thread Tim Dudgeon
Spock works fine with camel. After all camel is just java. The only downside I see is the limited refactoring capabilities the IDE can provide resulting from it using groovy. Tim On 02/07/2015 16:08, Wilson MacGyver wrote: Hi, Has anyone ever used spock to test camel before? I notice only

Re: use gradle to build apache camel application

2015-07-03 Thread Tim Dudgeon
The gradle tomcat plugin works fine for running a camel based project. https://github.com/bmuschko/gradle-tomcat-plugin I've been using gradle with camel for ages and am very happy with it. The only major thing that I miss sometimes is the camel maven archetype projects. But on the plus side I

Re: route specification in web.xml

2015-06-28 Thread Tim Dudgeon
Thanks. That's what I need. But are you aware that all the code snippets are missing from that page? Tim On 27/06/2015 09:30, Claus Ibsen wrote: Hi Yes there is more documentation here http://camel.apache.org/servletlistener-component.html On Thu, Jun 25, 2015 at 1:40 PM, Tim Dudgeon

Re: nonsense ClassCastException

2015-06-26 Thread Tim Dudgeon
do not match the API used by your Tomcat. Cheers! czw., 25.06.2015 o 19:11 użytkownik Tim Dudgeon tdudgeon...@gmail.com napisał: I'm trying to run some routes in tomcat using the servlet component (CamelHttpTransportServlet in the web.xml) In a simple example I've got it running fine, but when

route specification in web.xml

2015-06-25 Thread Tim Dudgeon
I was trying to get some servlets working, based on the camel-example-servlet-tomcat-no-spring example. I'm a bit confused by this section: context-param param-namerouteBuilder-MyRoute/param-name !-- define the routes as a resource from the classpath by prefixing the value with

nonsense ClassCastException

2015-06-25 Thread Tim Dudgeon
I'm trying to run some routes in tomcat using the servlet component (CamelHttpTransportServlet in the web.xml) In a simple example I've got it running fine, but when I try this in the real example I get a startup exception that makes no sense at all. Marking servlet CamelServlet as unavailable

Re: swagger + jetty with REST DSL

2015-06-24 Thread Tim Dudgeon
want /hello then add /hello to the jetty route. On Wed, Jun 24, 2015 at 12:34 PM, Tim Dudgeon tdudgeon...@gmail.com wrote: I'm struggling with this, so I tried setting up a dead simple servlet example and can't even get that working. Using plain Jetty its fine, but I don't seem able to wire

Re: swagger + jetty with REST DSL

2015-06-24 Thread Tim Dudgeon
the api. There is an example in the examples dir using tomcat. On Mon, Jun 22, 2015 at 4:24 PM, Tim Dudgeon tdudgeon...@gmail.com wrote: Can someone provide some info on how to get swagger set up with the REST DSL in a simple jetty environment. e.g. something very similar to what Christian described

REST DSL conundrum

2015-06-22 Thread Tim Dudgeon
I'm struggling with a REST DSL. It handles a POST request for a file upload, so the request body is binary type, and the response is JSON describing the result. The container is Jetty. My DSL looks like this: rest(/rest/v1/datasets) .post().description(Upload file to create new dataset)

Re: REST DSL conundrum

2015-06-22 Thread Tim Dudgeon
wrote: Hi If it works without the log, then see this http://camel.apache.org/why-is-my-message-body-empty.html On Mon, Jun 22, 2015 at 7:18 PM, Tim Dudgeon tdudgeon...@gmail.com wrote: I'm struggling with a REST DSL. It handles a POST request for a file upload, so the request body is binary

swagger + jetty with REST DSL

2015-06-22 Thread Tim Dudgeon
Can someone provide some info on how to get swagger set up with the REST DSL in a simple jetty environment. e.g. something very similar to what Christian described here: http://blog.christianposta.com/camel/easy-rest-endpoints-with-apache-camel-2-14/ e.g. Java only, no Spring. Thanks Tim

routing slip with InOut pattern

2015-06-18 Thread Tim Dudgeon
Is is possible to use routing slip so that it always waits for response? For instance if the routing slip specifies a seda route then it seems to execute asynchronously and the routing slip returns immediately. If instead I route to a direct endpoint it waits as desired, but that direct route

Re: Is there a tools to convert java dsl to xml ?

2015-06-12 Thread Tim Dudgeon
I was playing with just this a few weeks ago. Here's an example of what I got working. The one gotcha I encountered was that you can't use beans inline in the Java DSL. Instead you need to put the bean in the registry and reference it from there. Other than that it seems to work as expected.

Tooling for Idea and Netbeans?

2015-06-11 Thread Tim Dudgeon
At today's (really great) Red Hat Microservices Architecture Developer Day in London [1] Claus Ibsen mentioned that there is now tooling support available for IntelliJ Idea and Netbeans as well as Eclipse (presumably what used to be Fuse IDE). If so this is awesone, but I can't find any info

Re: Trace from and to endpoints

2015-06-11 Thread Tim Dudgeon
I believe Camel tracks this automatically at the exchange level (assuming you are wanting this on a per-exchange basis). e.g. when you get an exception this information is written to the logs, so its already there. Try looking at the Exchange properties. Tim On 10/06/2015 16:51, rwijngaa

Re: deleting jms queue

2015-06-09 Thread Tim Dudgeon
to be deleted. Tim On 09/06/2015 07:07, Claus Ibsen wrote: Hi Afair temp queues are affilianted with the jms session and automatic deleted by the broker when the session is closed - eg AMQ should do this. On Mon, Jun 8, 2015 at 5:31 PM, Tim Dudgeon tdudgeon...@gmail.com wrote: I'm using a temp

Re: deleting jms queue

2015-06-09 Thread Tim Dudgeon
So back to the question about how to delete them :-) On 09/06/2015 07:54, Claus Ibsen wrote: Yes then you should use regular queues. On Tue, Jun 9, 2015 at 8:47 AM, Tim Dudgeon tdudgeon...@gmail.com wrote: Well, maybe I'm wrong to call it a temp queue. This is not an InOut pattern. Its

programatic access to jms queue

2015-06-08 Thread Tim Dudgeon
I'm wanting to programatically access a JMS queue on a dynamic basis, but use the Camel infrastructure to do this. I've tried something like this: JmsEndpoint jms = getCamelContext().getEndpoint(activemq:queue:myqueue, JmsEndpoint.class); JmsConsumer consumer = jms.createConsumer((Exchange

deleting jms queue

2015-06-08 Thread Tim Dudgeon
I'm using a temp JMS queue to return some results. Once I've finished processing I want to delete the queue. What's the best approach? I'm assuming its best to manually generate the temp queue at the start and then manually delete it when finished. I notice I could use JmsTemporaryQueueEndpoint

Re: monitoring JMS

2015-06-07 Thread Tim Dudgeon
Hi Carsten Yes, that's what I kinda figured. I did find BrowsableEndpoint, as described here which actually give me most of what I need. http://camel.465427.n5.nabble.com/Issue-trying-to-browse-a-activemq-queue-td477750.html Beyond that it looks like I need JMX. Tim On 06/06/2015 06:21,

monitoring JMS

2015-06-05 Thread Tim Dudgeon
Camel provides a nice way to submit and consume from JMS queues. I also need to be able to monitor those queues. Does The JMS Component provide and nice hooks for inspecting those queues, or do I need to fall back to raw JMS or JMX? Example: I have a service that uses a Camel route to submit

Re: route - XML - route

2015-05-26 Thread Tim Dudgeon
Yes, but how to specify the bean that is referenced? Can that be specified in the XML using a bean element as if it was being using on startup, or does it need to be added to the registry manually? Tim On 26/05/2015 07:49, Claus Ibsen wrote: On Mon, May 25, 2015 at 3:01 PM, Tim Dudgeon

Re: route - XML - route

2015-05-26 Thread Tim Dudgeon
: Hi Yeah bean On Tue, May 26, 2015 at 9:02 AM, Tim Dudgeon tdudgeon...@gmail.com wrote: Yes, but how to specify the bean that is referenced? Can that be specified in the XML using a bean element as if it was being using on startup, or does it need to be added to the registry manually? Tim

Re: route - XML - route

2015-05-26 Thread Tim Dudgeon
context is superfast (about 0.01s), hence the preferred option. Tim Best regards Pontus On Tue, 26 May 2015 16:28 Tim Dudgeon tdudgeon...@gmail.com wrote: The beans are defined at runtime, so can't go in the spring xml that is used on startup (and I'm not actually using spring, though could

Re: route - XML - route

2015-05-26 Thread Tim Dudgeon
Ibsen wrote: Hi If you are using spring xml then the beans need to go in the spring xml file as bean. You may be able to add those beans later using some spring java api. On Tue, May 26, 2015 at 2:21 PM, Tim Dudgeon tdudgeon...@gmail.com wrote: Sorry, not clear on this. Where does the bean

route - XML - route

2015-05-25 Thread Tim Dudgeon
Hi, I'm wanting some guidance on how to generate a route definition using the API in a way that allows it to be converted to XML and then executed. I've got the basics sorted, but struggling on how to handle processors and beans. For instance, if I generate a route like this: // generate

metadata for components, processors etc

2015-05-01 Thread Tim Dudgeon
Is there any mechanism for specifying metadata that describes what inputs and outputs components, processors ... can consume/produce. I'm thinking of this from the perspective of a GUI builder tool that allows a route to be assembled so for this it's necessary to know which nodes are compatible

TypeConverter with generics

2015-03-09 Thread Tim Dudgeon
I may be missing something obvious here, but I'm can't find a way to do a type conversion that uses generics. For instance, I want to do a conversion of an InputStream into a Collection of Foo objects. So my convert method might look like this: @Converter public ListFoo

Re: REST DSL - including documents

2015-02-01 Thread Tim Dudgeon
in the context handler, should be #contextHandler I also had to redefine that handler, you'll find the working code in your gist. Taariq On Sat, Jan 31, 2015 at 8:56 PM, Tim Dudgeon tdudgeon...@gmail.com wrote: Pinging again on this. I looked over my attempts to add a ContextHandler to Jetty

Re: REST DSL - including documents

2015-01-31 Thread Tim Dudgeon
Pinging again on this. I looked over my attempts to add a ContextHandler to Jetty to serve up static content and can't find what's wrong. Here's the gist again: https://gist.github.com/tdudgeon/2f242578fd0742e713a7 The mechanism for adding a ContextHandler does work in standalone Jetty though I

http caller's IP address

2015-01-29 Thread Tim Dudgeon
When using REST DSL with jetty/restlet/etc is it possible to know the caller's IP address? I can't see any header property for this. Tim

Re: http caller's IP address

2015-01-29 Thread Tim Dudgeon
native type, such as HttpRequest, and use that to get the caller ip, just as you would have to do if you use the components without rest-dsl. On Thu, Jan 29, 2015 at 5:41 PM, Tim Dudgeon tdudgeon...@gmail.com wrote: When using REST DSL with jetty/restlet/etc is it possible to know the caller's IP

Re: REST DSL - including documents

2015-01-23 Thread Tim Dudgeon
Thanks, That's an interesting example. I'll take a look over it. In the meantime I kept bashing away at doing it the Jetty way, but don't quite have it working. I created this gist to try to illustrate it: https://gist.github.com/tdudgeon/2f242578fd0742e713a7 (note I backed away slightly from

Re: REST DSL - including documents

2015-01-23 Thread Tim Dudgeon
pages without setting up a full blown web server. Tim On 23/01/2015 01:33, Anton Hughes wrote: On Fri, Jan 23, 2015 at 6:58 AM, Tim Dudgeon tdudgeon...@gmail.com wrote: I'm successfully using REST DSL to serve up some simple services and want to include some simple HTML docs to describe

Re: REST DSL - including documents

2015-01-23 Thread Tim Dudgeon
If using jetty you can also use the jetty api to add a handler to service static files. So I'm looking at doing this. I think I worked out how to create a Jetty ContextHandler and associated ResourceHandler. But I'm not totally sure how to set these. I can get the JettyHttpComponent using

Sending route for execution

2015-01-03 Thread Tim Dudgeon
I am trying to work out best approaches to sending a route to a remote CamelContext for execution. e.g. I have a client that generates the route definition and then needs to send it to a sever for execution. I notice that you can apply a new route to an existing context:

streaming results using rest dsl

2015-01-02 Thread Tim Dudgeon
Is there a way to stream output using the Rest DSL? Something like using the JAC-RS StreamingOutput class? http://docs.oracle.com/javaee/6/api/javax/ws/rs/core/StreamingOutput.html I have large amount of data (split into multiple Exchanges) and don't want to wait for all to be processed before

Re: general approach to streaming

2014-12-03 Thread Tim Dudgeon
and provides a queue (BlockingQueue) in between resources to buffer the flow and provides options such as max size and blockWhenFull to limit memory usage and slow a producer as needed, etc... http://camel.apache.org/seda.htm Tim Dudgeon wrote I've got various cases where I have large number of results

POJO binding with the Rest DSL

2014-11-21 Thread Tim Dudgeon
I'm having problems getting POJO binding working with the Rest DSL. I put together a simple example in Groovy, but it fails: package com.im.examples.search import org.apache.camel.CamelContext import org.apache.camel.ProducerTemplate import org.apache.camel.builder.RouteBuilder import

Re: POJO binding with the Rest DSL

2014-11-21 Thread Tim Dudgeon
at 5:56 PM, Tim Dudgeon tdudgeon...@gmail.com wrote: I'm having problems getting POJO binding working with the Rest DSL. I put together a simple example in Groovy, but it fails: package com.im.examples.search import org.apache.camel.CamelContext import org.apache.camel.ProducerTemplate import

general approach to streaming

2014-11-21 Thread Tim Dudgeon
I've got various cases where I have large number of results (POJOs) and want to stream them so that: 1. initial results are returned immediately 2. memory utilisation is kept under control I was expecting to use something like using a BlockingQueue [1] but according to the Javadocs: A

Re: Strange issue with JDBC add Postgres

2014-11-12 Thread Tim Dudgeon
I already did. Described here: http://camel.465427.n5.nabble.com/Strange-issue-with-JDBC-add-Postgres-tp5758548p5758657.html Tim On 12/11/2014 19:26, Claus Ibsen wrote: There is a resetAutoCommit option, you can try set that to false On Mon, Nov 10, 2014 at 1:54 PM, Tim Dudgeon tdudgeon

Re: Strange issue with JDBC add Postgres

2014-11-10 Thread Tim Dudgeon
is your use case? You want to select * from a table, but only the first 1000 rows? On Wed, Nov 5, 2014 at 10:05 PM, Tim Dudgeon tdudgeon...@gmail.com wrote: On 05/11/2014 19:07, Claus Ibsen wrote: maxRowSize ??? do you mean fetchSize? Sorry, I mean maxRows (as in the example here: http

Re: Strange issue with JDBC add Postgres

2014-11-07 Thread Tim Dudgeon
. Tim On 06/11/2014 18:57, Claus Ibsen wrote: So maybe its your maxRows=1000 that is the problem, so when you are trying to get rows 1000 then it throws that exception. What is your use case? You want to select * from a table, but only the first 1000 rows? On Wed, Nov 5, 2014 at 10:05 PM, Tim

Re: Strange issue with JDBC add Postgres

2014-11-06 Thread Tim Dudgeon
On 06/11/2014 18:57, Claus Ibsen wrote: So maybe its your maxRows=1000 that is the problem, so when you are trying to get rows 1000 then it throws that exception. What is your use case? You want to select * from a table, but only the first 1000 rows? No, it happens without maxRows. I was just

Re: Strange issue with JDBC add Postgres

2014-11-05 Thread Tim Dudgeon
On 05/11/2014 19:07, Claus Ibsen wrote: maxRowSize ??? do you mean fetchSize? Sorry, I mean maxRows (as in the example here: http://camel.apache.org/jdbc.html). So something like: .to('jdbc:myDataSoruce?outputType=StreamListstatement.fetchSize=100statement.maxRows=1000') Also which

Writing Jetty response to stream.

2014-10-06 Thread Tim Dudgeon
I can see how to set the jetty response as text - just set the body to the text. But what if there is a large amount of data? Don't want to build it into an in-memory String. Want to write it to a stream. How can I do this? I need to get a handle on an OutputStream that I can write to? Thx Tim

Can't grok event driven consumer

2014-09-24 Thread Tim Dudgeon
I'm wanting to create a Component that acts as a simple from: endpoint, just like, for instance, direct: does. I want to be able to send an Exchange to it, handle it in some way, and send the outcomes (plural) to the downstream processor. Most of it makes sense, but I just can't work out how to

endpoint patterns for database

2014-09-16 Thread Tim Dudgeon
Hi all! I'm needing to write a new Camel Component for accessing a database. I've looked at the various database related components and see that there is no consistent pattern among these. I was wondering if there were recommendations as to what works best. So my component would need to be

Re: Return Value from Python Script Not In Message Body

2014-07-05 Thread Tim Dudgeon
I created a JIRA issue for this: https://issues.apache.org/jira/browse/CAMEL-7582 Tim -- View this message in context: http://camel.465427.n5.nabble.com/Return-Value-from-Python-Script-Not-In-Message-Body-tp5724056p5753387.html Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Return Value from Python Script Not In Message Body

2014-06-29 Thread Tim Dudgeon
I'd like to follow up on this as I've just hit the same issue. I know this thread dates from a year and a half ago, but it seems unanswered. The issue is that if you are using a Python script using the language component, it works fine if the script is a one line piece of text. e.g. the whole

How to stream to file

2014-05-26 Thread Tim Dudgeon
I'm having problems working out how to write my output to file. I'm wanting something that can work with the File component so that I get the benefit of its flexibility (and can use FTP etc.). But the problem is that I need to write the data using a class that uses a File or OutputStream. Its

Re: lazyLoad with CSV blows up on last line?

2014-05-05 Thread Tim Dudgeon
) Twitter: willemjiang Weibo: 姜宁willem On May 4, 2014 at 11:26:27 PM, Tim Dudgeon (tdudgeon...@gmail.com) wrote: I'm trying to use the CSV data format to handle a large file. Thinking I should use CsvDataFormat.setLazyLoad(true) I sort of got it working but it blows up on the last line

lazyLoad with CSV blows up on last line?

2014-05-04 Thread Tim Dudgeon
I'm trying to use the CSV data format to handle a large file. Thinking I should use CsvDataFormat.setLazyLoad(true) I sort of got it working but it blows up on the last line of the file with a java.io.IOException: Stream closed exception. Is this a bug, or am I dong it wrong? This is with Camel

Re: MalformedObjectNameException when starting camel context

2012-12-31 Thread Tim Dudgeon
, 2012 at 2:38 PM, Willem Jiang willem.ji...@gmail.com wrote: Hi, It looks something is wrong with you host name. Can you just change it? Willem 在 2012-12-30,下午11:45,Tim Dudgeon tdudgeon...@gmail.com 写道: I'm seeing a strange error when starting a camel context. Its dependent on the machine

MalformedObjectNameException when starting camel context

2012-12-30 Thread Tim Dudgeon
I'm seeing a strange error when starting a camel context. Its dependent on the machine I'm running on. On one machine (Windows) the same context and simple route runsfine, but on a different machine (Mac) the context fails to start. The key part seems to be this:

Re: lifecycle of components

2012-10-04 Thread Tim Dudgeon
is the only option? Tim On 02/10/2012 15:03, Claus Ibsen wrote: On Tue, Oct 2, 2012 at 3:38 PM, Tim Dudgeon tdudgeon...@gmail.com wrote: Are there any tricks or patterns to use when it comes to needing to manage the lifecyle of components used in Camel routes. For instance if I write a custom

lifecycle of components

2012-10-02 Thread Tim Dudgeon
Are there any tricks or patterns to use when it comes to needing to manage the lifecyle of components used in Camel routes. For instance if I write a custom Processor that creates something like a PreparedStatement how can I make sure its is close()'d when the CamelContext shuts down. Thanks

Reading CSV as Map not List

2012-10-02 Thread Tim Dudgeon
Is it possible to use the CSV component to read a CSV file and return a ListMapString,String? The keys being the values in the first line of the file. I can only see a way to get it to generate a ListListString. Thanks Tim

Re: Reading CSV as Map not List

2012-10-02 Thread Tim Dudgeon
a mobile device Am 02.10.2012 17:05 schrieb Tim Dudgeon tdudgeon...@gmail.com: Is it possible to use the CSV component to read a CSV file and return a ListMapString,String? The keys being the values in the first line of the file. I can only see a way to get it to generate a ListListString. Thanks Tim

Re: SEDA and concurrentConsumers

2012-09-12 Thread Tim Dudgeon
Great. That works. Thanks. BTW, the example in the Camel in Action book (p 322) seems wrong then as it describes it the way I originally had it. Tim On 12/09/2012 03:34, Willem jiang wrote: You need set the seda endpoint parameter on the first one endpoint, because Camel will pickup the

Must File component write the body?

2012-09-12 Thread Tim Dudgeon
When using the File component to write to a file is it always the message body that is written, or is it possible to use an expression (e.g. simple)? Of course body can be replaced with new content using an expression, but is that the only way to do this? Tim

  1   2   >