Re: VM queue for 2 camel context

2013-07-29 Thread nirro
You can try embedded ActiveMQ broker with "VM connector" (i.e.vm://default) to organize cross war communication. It's a heavier than VM component, but much powerful solution. 2013/7/30 keesvandieren [via Camel] > Have the same need here: > > We need to do transparent publish-subscribe from one

AW: Camel testing

2013-07-29 Thread jhm
And the configure()-methode in the test class just returns a RouteBuilder. It doesn't have to return a new created one ... public class MyTest extends CamelTestSupport { @Override protected RouteBuilder createRouteBuilder() { RouteBuilder rb = new MyRouteBuilder(); // adviceWith

Re: best practice for logging execution time

2013-07-29 Thread salemi
I like to identify the average execution time spent in Camel. I have a aggregator that aggregate 10 messages before it send them out to the endpoint. Would EventNotifier still work? - Alireza Salemi -- View this message in context: http://camel.465427.n5.nabble.com/best-practice-for-logging

Re: VM queue for 2 camel context

2013-07-29 Thread keesvandieren
Have the same need here: We need to do transparent publish-subscribe from one producer to multiple consumers across multiple war applications in one container. The problem I am facing: only the consumers of one of the wars is notified, never consumers of both wars are notified. Is this supported

how to consume messages by timestamp

2013-07-29 Thread shin938
I have a simple route spring DSL ,activemq queue. I want to consume messages that are 2 minutes old and more. what would be my best approach? -- View this message in context: http://camel.465427.n5.nabble.com/how-to-consume-messages-by-timestamp-tp5736463.html Sent from the Camel - Users mailin

Re: SEDA with PriorityBlockingQueue

2013-07-29 Thread Christian Posta
+1 ... good idea Claus On Mon, Jul 29, 2013 at 4:32 PM, Raul Kripalani wrote: > +1. It would enable many interesting solutions. > On 29 Jul 2013 15:48, "Christian Müller" > wrote: > > > +1 > > > > Best, > > Christian > > Am 29.07.2013 11:00 schrieb "Claus Ibsen" : > > > > > Hi > > > > > > Yeah

Re: Camel testing

2013-07-29 Thread Christian Posta
So keep in mind that the "endpoints" to a route are just java.lang.String... So you can do: String startRoute = "jms:incoming"; String endRoute = "jms:outgoing"; from(startRoute)..to(endRoute) And then have that string injectable, so you can do setEndRoute("mock:endpointName")... But even i

Re: Camel route only dealing with headers

2013-07-29 Thread Christian Posta
You may wish to take a look at 'forceSendOriginalMessage' on the camel jms endpoint... eg: For example, the following does what you're asking: from("jms:incoming?mapJmsMessage=false").to("jms:outgoing?forceSendOriginalMessage=true"); May have to play with the config a bit if you have other parts

Re: SEDA with PriorityBlockingQueue

2013-07-29 Thread Raul Kripalani
+1. It would enable many interesting solutions. On 29 Jul 2013 15:48, "Christian Müller" wrote: > +1 > > Best, > Christian > Am 29.07.2013 11:00 schrieb "Claus Ibsen" : > > > Hi > > > > Yeah if you use java code and create the SedaEndpoints manually. You > > can pass in the queue instance of your

Re: Use MessageFilter to process files that are 30 or more days old

2013-07-29 Thread Christian Müller
Use the file component option "filter" [1], not the filter EIP. Implement the org.apache.camel.component.file.GenericFileFilter class. Create a new Calendar instance, subtract 30 days and take the time in millis. If it's higher than the "CamelFileLastModified" header value, return true. Otherwise,

Re: Use MessageFilter to process files that are 30 or more days old

2013-07-29 Thread John D. Ament
Karim, Did you try date.minusDays(30).getMillis()? Typically long formats for dates/times are in milliseconds. On Mon, Jul 29, 2013 at 4:45 PM, Karim Garza wrote: > Hi, > > I am trying to use the MessageFilter to process files that are 30 days or > older. I came up with this code to do the wor

Re: Camel route only dealing with headers

2013-07-29 Thread Christian Posta
Object message is not a very good way to send payload for various reasons. Is your use case constrained to scenarios where ObjectMessages are being used and cannot be changed? The more versatile choice would otherwise be BytesMessage. On Mon, Jul 29, 2013 at 2:20 PM, jduncan wrote: > I have

Re: Camel route only dealing with headers

2013-07-29 Thread Christian Müller
Hello Jared! If you have to propagate the body to a downstream service, you have to care about the body. You have to make sure the body has a format ActiveMQ can serialize (String, byte array, map, ...). Otherwise, how should ActiveMQ be able to send your body over the wire? Best, Christian -

Camel route only dealing with headers

2013-07-29 Thread jduncan
I have a route that listens on an ActiveMQ endpoint and only manipulates exchange headers. I don't care about the body of the exchange at all. Consequently, I don't want to have to marshal/unmarshal/serialize/deserialize the body at all, but just send it along to anything downstream. Particularl

Use MessageFilter to process files that are 30 or more days old

2013-07-29 Thread Karim Garza
Hi, I am trying to use the MessageFilter to process files that are 30 days or older. I came up with this code to do the work, but it appears that the CamelFileLastModified header is a long and I do not know how to use to compare it with a date. public void configure() throws Exception { DateTime

Re: Is it Camel Bug?

2013-07-29 Thread James Carman
Well, you said all you needed to do was call a web service. If that's all you need, Camel is overkill. Now, if you have other points of integration, sure Camel's the right choice. On Mon, Jul 29, 2013 at 2:48 PM, SyedBhai wrote: > Sir, > You asked "why do you need camel at all"? > The answe

Re: Is it Camel Bug?

2013-07-29 Thread SyedBhai
Sir, You asked "why do you need camel at all"? The answer is firstly I know camel not cxf. Secondly I need to communicate with external programs which could be tcp services, udp services, web services, servlets, etc. So using camel I can write uniform code to communicate with all the above

Camel testing

2013-07-29 Thread Costash
Hi, I've just started to use camel, and I'm trying to understand and create some unit tests, but i don t understand how Mok is working or how unit tests should look like (i've read the tutorials and documentation about camel test). What do i mean by not understanging is: i have a defined route: =

Aggregator message redelivery issues

2013-07-29 Thread piotrsl
Hi Guys I'm struggling with the following issue and maybe you will be able to help me. Recently i have noticed that messages which are aggregated by camel Aggregator2 with hawtdb persistence store are lost because the following exception 2013-07-29 10:02:18,478 | ERROR | Failed delivery for exch

Camel Spring DSL - FTP consumerTemplate.receive gives FTP time out

2013-07-29 Thread hardikdesai81
Hi folks, I am using Camel with Spring DSL. I have implemented the FTP producer correctly and I am able to generated a JSON object at runtime and send it to an FTP Endpoint. However, when trying to consume that same JSON using Consumer Template, I am facing an FTP connection timeout problem when

Camel Spring DSL - FTP consumerTemplate.receive gives null Exchange

2013-07-29 Thread hardikdesai81
Hi folks, I am using Camel with Spring DSL. I have implemented the FTP producer correctly and I am able to generated a JSON object at runtime and send it to an FTP Endpoint. However, when trying to consume that same JSON using Consumer Template, I am facing a sporadic problem. Following is my Spr

Re: SEDA with PriorityBlockingQueue

2013-07-29 Thread Christian Müller
+1 Best, Christian Am 29.07.2013 11:00 schrieb "Claus Ibsen" : > Hi > > Yeah if you use java code and create the SedaEndpoints manually. You > can pass in the queue instance of your choice. > > Though maybe we should have an interface for a queue factory so people > can configure this once on the

Re: FTP Consumer, move file to failed directory

2013-07-29 Thread Ayache Khettar
Hi Many thanks Claus for your help. I will certainly be posting the messages in the malling list in the future. Regards, Ayache On 27 July 2013 09:03, Claus Ibsen wrote: > Hi > > Signup and use the mailing list instead of the nabble forum to post > quicker. > From nabble ppl have to moderate

Re: JMS properties to In message headers

2013-07-29 Thread gquintana
I think you should extend the JmsHeaderFilterStrategy -- View this message in context: http://camel.465427.n5.nabble.com/JMS-properties-to-In-message-headers-tp5736433p57364

Re: Adding MultiConsumer support to a ScheduledPollEndpoint/ScheduledPollConsumer

2013-07-29 Thread cgiera
Yes, that's a good hint. >From your experience is it a viable way to implement it like this? It looks strange to me to add new consumers in a consumer class. Maybe there is some impact on the general functionallity if I don't create consumers with the endpoint.createConsumer method or something

JMS properties to In message headers

2013-07-29 Thread Marco Crivellaro
Hi all, I am using Camel 2.11.1 By default Camel adds the a list of JMS properties to the In message headers when it receives a JMS message, for instance: JMSTimestamp, JMSType, JMSXGroupID... is there a way to extend this list without having to create a Processor to the route? I would like to a

Re: Adding MultiConsumer support to a ScheduledPollEndpoint/ScheduledPollConsumer

2013-07-29 Thread Claus Ibsen
ScheduledPollConsumer is by default a single threaded consumer. You would need to schedule more tasks yourself, see the startScheduler method in ScheduledPollConsumer. You can override that and schedule more tasks. By default only 1 task is scheduled. On Mon, Jul 29, 2013 at 2:52 PM, cgiera wro

Re: Adding MultiConsumer support to a ScheduledPollEndpoint/ScheduledPollConsumer

2013-07-29 Thread cgiera
Yes, but I haven't found an easy way to add my consumer(when I extend from ScheduledPollConsumer it is a Runnable) to the underlying executerService. I think there should be an easy way but I haven't found it. kind regards, Christoph -- View this message in context: http://camel.465427.n5.nabb

Re: Adding MultiConsumer support to a ScheduledPollEndpoint/ScheduledPollConsumer

2013-07-29 Thread Claus Ibsen
You have to implement this logic yourself in your custom component. On Mon, Jul 29, 2013 at 1:46 PM, cgiera wrote: > Claus Ibsen-2 wrote >> They are not the same. The former is for allowing 2+ routes with the >> same endpoint, eg multiple consumers, eg: >> >> from A >> to B >> >> from A >> to

Long <-> Date TypeConverter

2013-07-29 Thread Marco Zapletal
Hi folks, I recently encountered the situation that we required a Long (unix timestamp) to java.util.Date conversion. I was pretty sure that such a converter will exist in core-camel, but it doesn't. Furthermore, I came across some pieces of code in camel-core, where this conversion is done

Re: Adding MultiConsumer support to a ScheduledPollEndpoint/ScheduledPollConsumer

2013-07-29 Thread cgiera
Claus Ibsen-2 wrote > They are not the same. The former is for allowing 2+ routes with the > same endpoint, eg multiple consumers, eg: > > from A > to B > > from A > to C > > > concurrentConsumers is for the same consumer, eg > > from A concurrentConsumers = 10 > to B > >> I have looked

Re: Invoking Servlet from Camel

2013-07-29 Thread SyedBhai
Hello. But how can I ensure that the body I am passing is connected to the parameter 'message'? Thanks, Syed. -- View this message in context: http://camel.465427.n5.nabble.com/Invoking-Servlet-from-Camel-tp5736417p5736426.html Sent from the Camel - Users mailing list archive at Nabble.com.

Re: What is the best practice for trigger

2013-07-29 Thread zzkozak
I just learned that there exist a JMX Endpoint which I can use in this case, since our shop system offers an MBean with a method for reloading the discounts. -- View this message in context: http://camel.465427.n5.nabble.com/What-is-the-best-practice-for-trigger-tp5736422p5736427.html Sent from

What is the best practice for trigger

2013-07-29 Thread zzkozak
Hi, I have the following route: It's running in my, so called, "integration server". It is handling discount updates from other system. At the end of the processing I would like to trigger the shopping system to update the discount (because they are cached). What is the best practice to do it?

Re: Invoking Servlet from Camel

2013-07-29 Thread James Carman
If you just set the query string using the header Exchange.HTTP_QUERY, then it will use GET automatically. Also, if you just use an expression (as Claus was suggesting) to bind the body of the message to the query parameter, it will use GET automatically also. On Mon, Jul 29, 2013 at 6:58 AM, Bil

Re: Invoking Servlet from Camel

2013-07-29 Thread Bilgin Ibryam
Hi Syed, what you have done should work. If you set a message body http4 component will use POST method to do the http call and sent the message body as post body. Have a look here http://camel.apache.org/http4.html You can also set the http method manually if you prefer, like this: .setHeader(

Re: Is it Camel Bug?

2013-07-29 Thread James Carman
Why do you need Camel here at all? If you're just calling a web service, that's simple enough using just cxf. On Monday, July 29, 2013, SyedBhai wrote: > Hello Willem, > Yes. This is what I wanted. > When I add the option "synchronous=true" it shutsdown gracefully > immediately. > > Thanks,

Re: Invoking Servlet from Camel

2013-07-29 Thread Claus Ibsen
Hi See this page http://camel.apache.org/how-do-i-use-dynamic-uri-in-to.html On Mon, Jul 29, 2013 at 12:38 PM, SyedBhai wrote: > Hi guys, > I am having a servlet. It expects one parameter, say 'message'. > I want to invoke it using camel. > I am able to invoke it successfully as a HTTP GE

Invoking Servlet from Camel

2013-07-29 Thread SyedBhai
Hi guys, I am having a servlet. It expects one parameter, say 'message'. I want to invoke it using camel. I am able to invoke it successfully as a HTTP GET method as follows: from("direct:start").to("http://192.168.221.109:8080/DSP1/ServletDsp?message=HelloCamel";); String response=t

Re: SEDA with PriorityBlockingQueue

2013-07-29 Thread Claus Ibsen
Hi Yeah if you use java code and create the SedaEndpoints manually. You can pass in the queue instance of your choice. Though maybe we should have an interface for a queue factory so people can configure this once on the seda component once, and have it work out of the box? On Mon, Jul 29, 2013

SEDA with PriorityBlockingQueue

2013-07-29 Thread gquintana
Hi, Is it possible to configure a SEDA endpoint so as to handle priorities using a PriorityBlockingQueue instead of LinkedBlockingQueue, and optionally provide a Comparator to sort messages? Thanks, Gérald -- View this message in context: http://camel.465427.n5.nabble.com/SEDA-with-PriorityBl

Re: How to get User ID from ActiveMQ to Camel

2013-07-29 Thread Daniel Kleine-Albers
Hi, thank you very much! I had already tried to override the Header Filter Strategy, but I have not been successful with this method. However, I was able to create a small ActiveMQ Plugin that puts the authenticated username in another header - and voila, this is perfectly visible in Camel.

Re: Setting header with simple

2013-07-29 Thread Bob Jolliffe
Oops sorry I just solved it: ${body.get('properties').get('Dhis2UID')} Constant is constant :-) On 29 July 2013 09:34, Claus Ibsen wrote: > constant is 100% constant, eg exactly what you type. > > For dynamic values use a scripting language like simple, groovy etc > > > On Mon, Jul 29, 2013 at

Re: Setting header with simple

2013-07-29 Thread Claus Ibsen
constant is 100% constant, eg exactly what you type. For dynamic values use a scripting language like simple, groovy etc On Mon, Jul 29, 2013 at 10:25 AM, Bob Jolliffe wrote: > I am trying to set the value of a header in a route like: > > ... > > >${body.get('properties').get('Dhis2UID')}

Re: Using {date:..} placeholder in camel-context endpoint

2013-07-29 Thread Claus Ibsen
Hi Yeah use baseFolder as the starting directory. And then use /${date:now:MMdd} as prefix for the the file name. ?fileName=${date:now:MMdd}/${file:name} For the name of the file you can use the file language (part of simple language), see http://camel.apache.org/file-language.html

Setting header with simple

2013-07-29 Thread Bob Jolliffe
I am trying to set the value of a header in a route like: ... ${body.get('properties').get('Dhis2UID')} ... The log message displays the expected value. But the header is being populated with the literal text "${body.get('properties').get('Dhis2UID')}". Any idea what I am doing wrong? Reg

Re: Using {date:..} placeholder in camel-context endpoint

2013-07-29 Thread roger_rabbit
Thank you for your answer. I understand I can use a custom filter to filter directory based including the date I want to process, but not sure it is suited for creating a directory with such rule : => "write to a directory named /tmp/${MMdd} and create it if it does not exist". For the momen