error handling async instead of sync

2013-07-23 Thread Marco Westermann

Hi,

I have a route with an errorHandler configured. I set it to redeliver 
async. But when an error occures the remaining messages on the queue are 
processed after the redelivery of the failed message ends.


Here is my routebuilder: http://pastebin.com/8fUED75R

Is there something wrong with it? I use camel 2.10.4

the process method which is invoked from the route logs a line: 
processing new order 123123

and my log looks like this: http://pastebin.com/iLE6MqJJ

why is my redelivery sync instead of async?

best regards,

Marco


Re: FTP endpoint failure

2013-07-23 Thread Bart Horré
Hi,

what exactly do you want to handle when the ftp is down?
There won't be an exchange to handle / errorhandle yet since the files on
the ftp can't be accessed


On Tue, Jul 23, 2013 at 6:09 AM, Richa  wrote:

> Hi,
> I have a small camel route where my input endpoint is FTP. I want to handle
> the scenario when FTP is down or the FTP credentials are wrong. But I
> checked that FTP does not throw exception on the consumer side, instead it
> just keeps on retrying after every 5 seconds. Can you please tell me how to
> handle the scenario when FTP is down?
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/FTP-endpoint-failure-tp5736059.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Bart Horré
Anova r&d bvba


Re: Probleme with startorder

2013-07-23 Thread Bovas
thanks for your answer bibryam.

I find a solution, but i think it's not the best solution. 
In my bean, I created a boolean and when the first route finish, I start the
second. 

I did a while loop in my second route before his treatment =>
*while(!isRead);*
isRead become true when my first route finish.




-
regards,
Bovas
--
View this message in context: 
http://camel.465427.n5.nabble.com/Probleme-with-startorder-tp5736034p5736066.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Canonical Way to Create a New Message Given Certain Conditions

2013-07-23 Thread al94781
Hi @claus, @ceposta

Thanks for this.  I'm keenest to ensure we don't go against the grain of
the "Camel-way".  I've pushed against frameworks before and it always ends
badly.  :D

To that end, both options you propose make a lot of sense.  @caposta, your
option sounds like it keeps the handling and creation of the compensatory
message all in one place which I like from a conceptual-code perspective.
 Have you seen others do this?  Most important to us is that it's all
within the same transaction. We can't lose messages (which includes these
compensatory-messages that the onException handler would create.) If so, it
sounds like it might be for us.  if not, I think we go down the route
@claus suggests.

Thanks for your input so far.

Cheers, Andrew

*Andrew Harmel-Law*
twitter: @al94781 
blog: the-music-of-time.blogspot.com
flickr: flickr.com/photos/andrewbrucelaw


On 20 July 2013 14:24, ceposta [via Camel] <
ml-node+s465427n5735933...@n5.nabble.com> wrote:

> Can you just use the regular onException handlers? If there is an error
> processing, throw an exception, and in the onException handler enrich with
> a Failed header and create your new message and send to a queue.
>
> On Saturday, July 20, 2013, Claus Ibsen wrote:
>
> > Hi
> >
> > If its a new inbound message maybe you can use an intercept from and
> > then do your check / whatever you want
> > http://camel.apache.org/intercept
> >
> > On Tue, Jul 16, 2013 at 2:13 PM, al94781 <[hidden 
> > email]>
>
> > wrote:
> > > Hi there,
> > >
> > > We have a situation in our route whereby, when we encounter an error
> in
> > > processing an inbound message, we want to flag the original as
> "Failed"
> > (in
> > > a header) prior to further processing, and also generate a new message
> to
> > > request a tidy up of resources the original failure may have left
> behind
> > > which we put on a new request queue.
> > >
> > > The question I have is therefore: What is the canonical way to achieve
> > this
> > > with Camel?
> > >
> > >  - A splitter isn't the right way as the new (tidy up) message is not
> in
> > the
> > > original message to split it out.
> > >  - A wiretap feels like it might be a possibility, (looking for
> messages
> > > with a "Failed" header, and reacting as a result by creating the new
> > > message) but I'm not clear if this can operate within the original
> > > transaction (we can't lose messages, and want to ensure a failure at
> > least
> > > guarantees a clean up is attempted).
> > >  - Alternatively we can just use a plain old processor, but this feels
> > as if
> > > we're missing something and a little ad-hoc.
> > >
> > > Can anyone help?  We're pretty sure this must be a very common use
> case.
> > >
> > > TIA
> > >
> > > Cheers, Andrew
> > >
> > >
> > >
> > > --
> > > View this message in context:
> >
> http://camel.465427.n5.nabble.com/Canonical-Way-to-Create-a-New-Message-Given-Certain-Conditions-tp5735721.html
> > > Sent from the Camel - Users mailing list archive at Nabble.com.
> >
> >
> >
> > --
> > Claus Ibsen
> > -
> > Red Hat, Inc.
> > Email: [hidden 
> > email]
> > Twitter: davsclaus
> > Blog: http://davsclaus.com
> > Author of Camel in Action: http://www.manning.com/ibsen
> >
>
>
> --
> *Christian Posta*
> http://www.christianposta.com/blog
> twitter: @christianposta
>  http://www.christianposta.com/blog
>
>
> --
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://camel.465427.n5.nabble.com/Canonical-Way-to-Create-a-New-Message-Given-Certain-Conditions-tp5735721p5735933.html
>  To unsubscribe from Canonical Way to Create a New Message Given Certain
> Conditions, click 
> here
> .
> NAML
>




--
View this message in context: 
http://camel.465427.n5.nabble.com/Canonical-Way-to-Create-a-New-Message-Given-Certain-Conditions-tp5735721p5736070.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Custom names for processors within routes

2013-07-23 Thread Andreas Gies
Works like a charm; as expected ;)

Thx
Andreas



Am 7/22/13(30) 5:22 PM schrieb "Claus Ibsen" unter :

>Hi
>
>Yep set the id of the processors. Then that id is used as part of the JMX
>name
>http://camel.apache.org/camel-jmx.html
>
>.process( ... ).id("nameOfMyProcessor")
>
>On Mon, Jul 22, 2013 at 5:19 PM,   wrote:
>>
>> Hello,
>>
>> I apologize if the following is a stupid question.
>>
>> I have a Custom Routebuilder building a route within a Camel Context.
>>The
>> route itself works fine.
>>
>> The code is relatively straight forward:
>>
>>   @Override
>>   public void configure() throws Exception {
>> errorHandler(deadLetterChannel(getErrorUri()));
>>
>> from(getEntryUri())
>> .process(getProcessor())
>> .process(new Processor() {
>>   @Override
>>   public void process(Exchange exchange) throws Exception {
>> exchange.setOut(exchange.getIn());
>>
>> if (dispatcher == null) {
>>   throw new Exception("No dispatcher configured. Have you set
>>the
>> exit prefix ?");
>> }
>>
>> dispatcher.dispatch(exchange);
>>   }
>> });
>>   }
>>
>> I am using Java as I use an OSGI Managed Service to configure the
>>duspatcher
>> at runtime and also to inject a pre processor as a first step.
>> Also I found that injecting those into a Java route builder allowed me
>>to
>> unit test the processors more elegantly.
>>
>> Back to the point...In JVisualVm I can see my processors in the tree
>>beneath
>> a folder named after my route identifier. Beneath this entry i see two
>> processors named processor1 and processor2.
>>
>> Is there any way to influence those last 2 names from my route builder
>>? -
>> Potentially I have overlooked something in the docs ...
>>
>> For convenience I have attached a piece of my JVisualVM screenshot that
>> shows the processors in question.
>>
>> Best regards
>> Andreas
>>
>>
>>
>
>
>
>-- 
>Claus Ibsen
>-
>Red Hat, Inc.
>Email: cib...@redhat.com
>Twitter: davsclaus
>Blog: http://davsclaus.com
>Author of Camel in Action: http://www.manning.com/ibsen




Re: Camel Thread does not terminate

2013-07-23 Thread Andreas Gies
Hi,

It might be my complete ignorance of the problem, but have you considered
to leave your context happily running and take advantage of the many
mechanisms in Camel to leverage Thread pools and the like ?

Just my 2 ct 
Andreas 


Am 7/23/13(30) 7:26 AM schrieb "SyedBhai" unter
:

>No.  That doesn't help.  Because it will shutdown the jvm.
>My project is a web app.  It keeps serving incoming requests.  For serving
>each request it uses camel framework.
>I am creating a thread for each request.  The problem I may be facing is
>that this thread does not terminate because of using camel.  So I wanted
>to
>know how to stop this thread.
>Can someone help please?
>
>Thanks,
>Syed.
>
>
>
>--
>View this message in context:
>http://camel.465427.n5.nabble.com/Camel-Thread-does-not-terminate-tp573604
>5p5736060.html
>Sent from the Camel - Users mailing list archive at Nabble.com.




Re: FTP endpoint failure

2013-07-23 Thread Richa
I want to set the maximum number of retries and after the retries I want to
shut down my route. I cannot do it now because the control never goes to the
onException block as the FTP never throws exception when it is an input
endpoint.



--
View this message in context: 
http://camel.465427.n5.nabble.com/FTP-endpoint-failure-tp5736059p5736073.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: error handling async instead of sync

2013-07-23 Thread Raul Kripalani
You can add the concurrentConsumers option to the JMS consumer. Camel
will then keep consuming messages in other threads even if the first
one is busy doing the redeliveries.

Alternatively, you can configure broker-side redeliveries in AMQ is
you want async behavior. In that case, you should not handle the
exception in Camel so that it propagates back to the broker.

- Raúl.

On 23 Jul 2013, at 08:12, Marco Westermann  wrote:

> Hi,
>
> I have a route with an errorHandler configured. I set it to redeliver async. 
> But when an error occures the remaining messages on the queue are processed 
> after the redelivery of the failed message ends.
>
> Here is my routebuilder: http://pastebin.com/8fUED75R
>
> Is there something wrong with it? I use camel 2.10.4
>
> the process method which is invoked from the route logs a line: processing 
> new order 123123
> and my log looks like this: http://pastebin.com/iLE6MqJJ
>
> why is my redelivery sync instead of async?
>
> best regards,
>
> Marco


Re: FTP endpoint failure

2013-07-23 Thread Claus Ibsen
Hi

See this link
http://camel.apache.org/why-does-my-file-consumer-not-pick-up-the-file-and-how-do-i-let-the-file-consumer-use-the-camel-error-handler.html

On Tue, Jul 23, 2013 at 9:56 AM, Richa  wrote:
> I want to set the maximum number of retries and after the retries I want to
> shut down my route. I cannot do it now because the control never goes to the
> onException block as the FTP never throws exception when it is an input
> endpoint.
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/FTP-endpoint-failure-tp5736059p5736073.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


Re: error handling async instead of sync

2013-07-23 Thread Claus Ibsen
Hi

You have to set asyncConsumer=true on the JMS endpoint.

See details at
http://camel.apache.org/jms

On Tue, Jul 23, 2013 at 9:12 AM, Marco Westermann  wrote:
> Hi,
>
> I have a route with an errorHandler configured. I set it to redeliver async.
> But when an error occures the remaining messages on the queue are processed
> after the redelivery of the failed message ends.
>
> Here is my routebuilder: http://pastebin.com/8fUED75R
>
> Is there something wrong with it? I use camel 2.10.4
>
> the process method which is invoked from the route logs a line: processing
> new order 123123
> and my log looks like this: http://pastebin.com/iLE6MqJJ
>
> why is my redelivery sync instead of async?
>
> best regards,
>
> Marco



-- 
Claus Ibsen
-
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


Re: Is it possible to import Endpoints from a xml file like routeContextRef?

2013-07-23 Thread Claus Ibsen
Do you mean having a bunch of  in the 




If so I dont think its supported yet. There is a JIRA ticket to
improve  to allow defining stuff besides just s

On Tue, Jul 23, 2013 at 12:16 AM, bonnahu  wrote:
> Hey guys,
> We can import routes from other XML files by using routeContextRef. Does
> anyone know whether we could do the same for EndPoints?
>
> thanks
>
>
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Is-it-possible-to-import-Endpoints-from-a-xml-file-like-routeContextRef-tp5736053.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


Re: Camel Example Restlet JDBC Master

2013-07-23 Thread Babak Vahdat
Hi

I assume you mean the following example:

https://github.com/bibryam/camel-example-restlet-jdbc

Which is an ASL 2.0 example about using Apache Camel contributed to the
community by Bilgin Ibryam (A very talented Apache Camel Committer).

I made a pull request to make the example work again:

https://github.com/bibryam/camel-example-restlet-jdbc/pull/3

Until this change is applied into the master branch you can easily take over
the changes I made using the following version:

https://github.com/bvahdat/camel-example-restlet-jdbc/blob/master/pom.xml

Babak



tKronos wrote
> I am trying to get the example called Camel Example Restlet JDBC Master
> working. But everytime I try running it, I get the following error:
> 
> Could not instantiate listener
> org.springframework.web.context.ContextLoaderListener
> 
> Plus a bunch of other errors following that with the class not being found
> and such.
> 
> I think it is a versioning problem with some of the dependencies or
> something. If someone knows what dependencies and what versions I need to
> make this example work I would be very grateful.
> 
> I am using Camel version 2.11.0.
> 
> Thank you very much.





--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-Example-Restlet-JDBC-Master-tp5736048p5736083.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel Example Restlet JDBC Master

2013-07-23 Thread Bilgin Ibryam
Babak,

thanks for the nice introduction and pull request :)
I applied it your changes and the example should be working fine again.

Bilgin

On 23 July 2013 09:19, Babak Vahdat  wrote:
> Hi
>
> I assume you mean the following example:
>
> https://github.com/bibryam/camel-example-restlet-jdbc
>
> Which is an ASL 2.0 example about using Apache Camel contributed to the
> community by Bilgin Ibryam (A very talented Apache Camel Committer).
>
> I made a pull request to make the example work again:
>
> https://github.com/bibryam/camel-example-restlet-jdbc/pull/3
>
> Until this change is applied into the master branch you can easily take over
> the changes I made using the following version:
>
> https://github.com/bvahdat/camel-example-restlet-jdbc/blob/master/pom.xml
>
> Babak
>
>
>
> tKronos wrote
>> I am trying to get the example called Camel Example Restlet JDBC Master
>> working. But everytime I try running it, I get the following error:
>>
>> Could not instantiate listener
>> org.springframework.web.context.ContextLoaderListener
>>
>> Plus a bunch of other errors following that with the class not being found
>> and such.
>>
>> I think it is a versioning problem with some of the dependencies or
>> something. If someone knows what dependencies and what versions I need to
>> make this example work I would be very grateful.
>>
>> I am using Camel version 2.11.0.
>>
>> Thank you very much.
>
>
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Camel-Example-Restlet-JDBC-Master-tp5736048p5736083.html
> Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel Example Restlet JDBC Master

2013-07-23 Thread Claus Ibsen
Hi

Maybe the example could be migrated to camel examples so we offer it
out of the box in the kit?
http://camel.apache.org/examples

On Tue, Jul 23, 2013 at 10:58 AM, Bilgin Ibryam  wrote:
> Babak,
>
> thanks for the nice introduction and pull request :)
> I applied it your changes and the example should be working fine again.
>
> Bilgin
>
> On 23 July 2013 09:19, Babak Vahdat  wrote:
>> Hi
>>
>> I assume you mean the following example:
>>
>> https://github.com/bibryam/camel-example-restlet-jdbc
>>
>> Which is an ASL 2.0 example about using Apache Camel contributed to the
>> community by Bilgin Ibryam (A very talented Apache Camel Committer).
>>
>> I made a pull request to make the example work again:
>>
>> https://github.com/bibryam/camel-example-restlet-jdbc/pull/3
>>
>> Until this change is applied into the master branch you can easily take over
>> the changes I made using the following version:
>>
>> https://github.com/bvahdat/camel-example-restlet-jdbc/blob/master/pom.xml
>>
>> Babak
>>
>>
>>
>> tKronos wrote
>>> I am trying to get the example called Camel Example Restlet JDBC Master
>>> working. But everytime I try running it, I get the following error:
>>>
>>> Could not instantiate listener
>>> org.springframework.web.context.ContextLoaderListener
>>>
>>> Plus a bunch of other errors following that with the class not being found
>>> and such.
>>>
>>> I think it is a versioning problem with some of the dependencies or
>>> something. If someone knows what dependencies and what versions I need to
>>> make this example work I would be very grateful.
>>>
>>> I am using Camel version 2.11.0.
>>>
>>> Thank you very much.
>>
>>
>>
>>
>>
>> --
>> View this message in context: 
>> http://camel.465427.n5.nabble.com/Camel-Example-Restlet-JDBC-Master-tp5736048p5736083.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


Re: Probleme with startorder

2013-07-23 Thread Claus Ibsen
Hi

You can also mark the 2nd route to not auto start.
And then from 1st route you can start the 2nd route.

For example just using the controlbus in the route
http://camel.apache.org/controlbus.html

.to("controlbus:route?routeId=idOfRoute2&action=start")

Or do like this FAQ
http://camel.apache.org/how-can-i-stop-a-route-from-a-route.html

On Tue, Jul 23, 2013 at 9:21 AM, Bovas  wrote:
> thanks for your answer bibryam.
>
> I find a solution, but i think it's not the best solution.
> In my bean, I created a boolean and when the first route finish, I start the
> second.
>
> I did a while loop in my second route before his treatment =>
> *while(!isRead);*
> isRead become true when my first route finish.
>
>
>
>
> -
> regards,
> Bovas
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Probleme-with-startorder-tp5736034p5736066.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


Re: Camel Example Restlet JDBC Master

2013-07-23 Thread Bilgin Ibryam
On 23 July 2013 10:01, Claus Ibsen  wrote:
> Hi
>
> Maybe the example could be migrated to camel examples so we offer it
> out of the box in the kit?
> http://camel.apache.org/examples

This was my intend originally, but thought it is not an interesting example.
Now I will move it Camel though

B.

>
> On Tue, Jul 23, 2013 at 10:58 AM, Bilgin Ibryam  wrote:
>> Babak,
>>
>> thanks for the nice introduction and pull request :)
>> I applied it your changes and the example should be working fine again.
>>
>> Bilgin
>>
>> On 23 July 2013 09:19, Babak Vahdat  wrote:
>>> Hi
>>>
>>> I assume you mean the following example:
>>>
>>> https://github.com/bibryam/camel-example-restlet-jdbc
>>>
>>> Which is an ASL 2.0 example about using Apache Camel contributed to the
>>> community by Bilgin Ibryam (A very talented Apache Camel Committer).
>>>
>>> I made a pull request to make the example work again:
>>>
>>> https://github.com/bibryam/camel-example-restlet-jdbc/pull/3
>>>
>>> Until this change is applied into the master branch you can easily take over
>>> the changes I made using the following version:
>>>
>>> https://github.com/bvahdat/camel-example-restlet-jdbc/blob/master/pom.xml
>>>
>>> Babak
>>>
>>>
>>>
>>> tKronos wrote
 I am trying to get the example called Camel Example Restlet JDBC Master
 working. But everytime I try running it, I get the following error:

 Could not instantiate listener
 org.springframework.web.context.ContextLoaderListener

 Plus a bunch of other errors following that with the class not being found
 and such.

 I think it is a versioning problem with some of the dependencies or
 something. If someone knows what dependencies and what versions I need to
 make this example work I would be very grateful.

 I am using Camel version 2.11.0.

 Thank you very much.
>>>
>>>
>>>
>>>
>>>
>>> --
>>> View this message in context: 
>>> http://camel.465427.n5.nabble.com/Camel-Example-Restlet-JDBC-Master-tp5736048p5736083.html
>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>
>
> --
> Claus Ibsen
> -
> Red Hat, Inc.
> Email: cib...@redhat.com
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen


Re: After camelContext shutdown, is any way to exit the Java main() method?

2013-07-23 Thread Claus Ibsen
Hi

Maybe there is a non-daemon thread still hanging around and preventing
the JVM from terminating.

You can do a thread dump to see which threads is alive.

But the system exit also works but just a bit more abrupt than a clean shutdown.

On Mon, Jul 22, 2013 at 5:47 PM, bonnahu  wrote:
> Hi Willem,
> After adding System.exit(1) after exchange.getContext().stop(); , it works
> for me. Thanks again!
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/After-camelContext-shutdown-is-any-way-to-exit-the-Java-main-method-tp5735993p5736042.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


Re: Quartz and enrich seem not to work together...

2013-07-23 Thread Claus Ibsen
You can set idempotent=false on the file to allow it to re-read the
file always. As when you use noop=true that would otherwise imply
idempotent=true. But by setting it explicit to false will always make
the file readable again.


On Mon, Jul 22, 2013 at 8:39 PM, roger_rabbit  wrote:
> Hi,
>
> I read a few things about the subject, but since most of them were 3 years
> old, I guess there are new features that may have changed the issue... so
> here's my 2013 problem.
>
> First of all, I am quite new to camel (20 days experience).
>
> In a previous project, I managed to use a quartz-triggered route to get some
> informations from a http site and send them as messages on a bus topic
> (Fuse).
> This worked fine for me.
>
> Now, I am trying to use the same kind of process to manage a file, in such a
> way I read the file at a time pointed out by a cron expression, and use the
> content of the file to trigger several messages on bus (basicely : one
> message will be triggerd per line in file).
>
> Very basicely, this should look like (from my RouteBuilder-implementing
> class) :
> from("quartz:mytimer?0+0/2+*+*+*")
> .enrich("file:/my/directory/?fileName=myFile.pair&noop=true")
> .split("\n",1)
> .to("activemq:my.topic.out");
>
> My problem is that the file is processed only for the first quartz event,
> and then, never processed again... (even if I change file's content).
> So, what I guess is that it is "consumed" (thus, never read, and that's why
> the route failed during the next quartz events),  and that I have to keep
> the content of the file in some ... place (topic?/seda?/other?) and enrich
> my quartz route from that place without consuming the message...
> My problem is, as a noobie, I don't know how to that.
> I tried to set a previous route such as :
>
>
> from("file:/my/directory/?fileName=myFile.pair&noop=true").to("direct:file");
>
> and then use as as my enrichment source :
>
> from("quartz:mytimer?0+0/2+*+*+*")
> .enrich("direct:file")
> .split("\n",1)
> .to("activemq:my.topic.out");
>
> ... but the problem was the same... since obviously it is still consumed.
>
> I also tried to use a ConsumerTemplate from a processor to enrich the
> exchange with stg like :
>
> Process(Exchange ex){
> ...
> Exchange newEx =
> template.receive("file:/my/directory/?fileName=myFile.pair&noop=true");
> ex.setIn(newEx);
> }
> ... but all the same...
>
> So I tried many things and ended up thinking I .. think the wrong way. So
> any tip here would be welcome.
>
>
> Thanks in advance
>
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Quartz-and-enrich-seem-not-to-work-together-tp5736046.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



--
Claus Ibsen
-
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


Re: Which Component of camel is used for subscriptions or polling?

2013-07-23 Thread cannykanna
Hi Christopher,
The Document link you sent was very helpful.
Thank you so much :)
Does the Camel has any component that supports polling other than EIPs?
Do you have any example where polling is executed?

Regards
Kannaiah



--
View this message in context: 
http://camel.465427.n5.nabble.com/Which-Component-of-camel-is-used-for-subscriptions-or-polling-tp5735709p5736100.html
Sent from the Camel - Users mailing list archive at Nabble.com.


How to Pause Quartz Componenent

2013-07-23 Thread Dayakar
Hi, 

I am using Quartz Component which run Daily at 20:00  I configured it as
from("quartz://myGroup/myTimerName?cron=0+0+20+1/1+*+?+*").routeid("MainRoute").to("jms:queue:outBoundQueue")
 

I need to pause the Route for few Days

Iam using camelContext.suspendRoute("MainRoute");

But still Quartz is firing .

How can i pause Quartz Component

Thanks in Advance

Regards,
Dayakar



--
View this message in context: 
http://camel.465427.n5.nabble.com/How-to-Pause-Quartz-Componenent-tp5736101.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel in Openshift

2013-07-23 Thread James Strachan
I'm working with Ioannis on a Fuse OpenShift cartridge so that folks
can easily run all of Fuse on OpenShift, visualise their camel routes,
edit them on the fly with custom palettes from a web browser,
provision them, do rolling upgrades & view real time metrics etc.

i.e. the full iPaaS demo on OpenShift that I demonstrated at CamelOne
http://macstrac.blogspot.co.uk/2013/06/introducing-apache-camel-based-open.html

I'm hoping to have the first version ready in the next few weeks.

Until then, you should be able to use camel using either the Tomcat or
JBoss quick starts and just add the camel jars to a WAR
https://www.openshift.com/developers/java

e.g. maybe using the contents of the camel-war archetype as the
project inside the jboss/tomcat quickstart openshift app

Hopefully this will all be much easier & documented soon though!


On 18 July 2013 22:56, wcpolicarpio  wrote:
> Hi Everyone,
>
> Is there a Camel quickstart that can be deployed in openshift?
>
> Thanks,
> Walter
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Camel-in-Openshift-tp5735877.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
James
---
Red Hat

Email: jstra...@redhat.com
Web: http://fusesource.com
Twitter: jstrachan, fusenews
Blog: http://macstrac.blogspot.com/

Open Source Integration


Re: Leveraging CXF Asynchronous processing when MEP is InOut

2013-07-23 Thread Edwin
Since my cxf call has an MEP of InOut, is it possible to achieve the cxf
asynchronous behavior? 

Or is the cxf asynchronous behaviour only associated with an MEP of InOnly?

Thanks,
Edwin 



--
View this message in context: 
http://camel.465427.n5.nabble.com/Leveraging-CXF-Asynchronous-processing-when-MEP-is-InOut-tp5735904p5736102.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: conditional uri

2013-07-23 Thread Bart Horré
I often usen a mechanism to conditionally route based on test or production
environment where I load a spring property to identify the environment and
create the endpoints based on the environment.

In Java DSL you could make an abstract route builder to house the common
logic and write to direct: endpoint. You can then create a test or
production routebuilder based on the environment which would read from the
direct: endpoint and forward to the real endpoints


On Tue, Jul 16, 2013 at 9:49 PM, Jan Matèrne (jhm) wrote:

> If your xml-route-definition is inside a spring configuration, spring
> properties should be possible.
>
> Jan
>
> > -Ursprüngliche Nachricht-
> > Von: Chris Wolf [mailto:cwolf.a...@gmail.com]
> > Gesendet: Dienstag, 16. Juli 2013 16:17
> > An: users@camel.apache.org
> > Betreff: Re: conditional uri
> >
> > It depends on what you mean by "conditional" -  if you mean conditional
> > at route-definition time, you can use property placeholders and/or
> > Language Expressions.
> >
> > If you mean conditional at runtime, then I'm pretty sure you can only
> > do that with producer endpoints (i.e. "to" endpoints) see:
> >
> > http://camel.apache.org/how-do-i-use-dynamic-uri-in-to.html
> >
> > If you want conditional runtime consumer endpoints, the only solution I
> > have been able to come up with is dynamically created routes that are
> > created at runtime; this logic is encapsulated in a custom processor.
> >
> > -Chris
> >
> >
> >
> >
> > On Tue, Jul 16, 2013 at 9:46 AM, boris 
> > wrote:
> > > How could I have a conditional uri string?
> > > For example,
> > > I have  > uri="direct:start"
> > > for testing.
> > > I want to have a single xml file for both and manage uri string
> > > conditionally.
> > > Thanks,
> > > Boris
> > >
> > >
> > >
> > > --
> > > View this message in context:
> > > http://camel.465427.n5.nabble.com/conditional-uri-tp5735724.html
> > > Sent from the Camel - Users mailing list archive at Nabble.com.
>
>


-- 
Bart Horré
Anova r&d bvba


Re: After camelContext shutdown, is any way to exit the Java main() method?

2013-07-23 Thread SyedBhai
Hi.
  I am having a simple class with main().  In main() I am executing the
following code:
try {
CamelContext cc=new DefaultCamelContext();
cc.addRoutes(new RouteBuilder()  {
   public void configure()  {
   from("direct:start1").

to("cxf://http://localhost:8080/JAXWS1/MyInterfaceImpl?serviceClass=com.syed.MyInterface&serviceName={http://syed.com/}MyInterfaceImplService&portName={http://syed.com/}MyInterfaceImplPort";);
 
   }
 }
);
cc.start();
ProducerTemplate t=cc.createProducerTemplate();
int annsal=t.requestBody("direct:start1", 1, Integer.class);
System.out.println("annsal:"+annsal);
cc.getShutdownStrategy().setShutdownNowOnTimeout(true);
cc.getShutdownStrategy().setTimeUnit(TimeUnit.SECONDS);
cc.getShutdownStrategy().setTimeout(1);
 
t.stop();  cc.stop();
}catch(Exception x){}

To my surprise I am getting the output but the program is still running.  I
later checked the list of threads running.  This is the list I have:

Thread[main,5,main]
Thread[Reference Handler,10,system]
Thread[Finalizer,8,system]
Thread[default-workqueue-1,5,default-workqueue]
Thread[Thread-1,5,main]
Thread[Signal Dispatcher,9,system]
Thread[GC Daemon,2,system]
Thread[I/O dispatcher 1,5,main]
Thread[I/O dispatcher 2,5,main]
Thread[I/O dispatcher 3,5,main]
Thread[I/O dispatcher 4,5,main]

If I use a mock:test endpoint instead of cxf the program terminates
automatically.  So I believe when I am using some other components such as
cxf then camel is creating some threads and not stopping them.

This may cause memory leaks in my project.  Can you guys help?

Thanks,
Syed.



--
View this message in context: 
http://camel.465427.n5.nabble.com/After-camelContext-shutdown-is-any-way-to-exit-the-Java-main-method-tp5735993p5736105.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: jsf and apache camel

2013-07-23 Thread James Strachan
On 22 July 2013 11:26, lassesvestergaard  wrote:
> Thank you very much James.
>
> I ended up using JSF. I found out how to integrate Camel into a JSF
> application. I'm not sure it's the best way, but it seems to work (please
> enlighten me if you know a better solution).

angularjs is a much better solution for building great HTML5 web apps;
but thats maybe an answer to a different question than you asked ;)


> What I did is making a new
> managed bean (in JSF 2.0), that is application scoped, and through it's
> constructor starting a camelcontext. This way I can access the full Camel
> application in the web layer, and the camelcontext exists as long as the
> webserver is not shut down.
>
> The reason why I want to be able to create anonymous processors on-the-fly,
> is that I want users to be able to create custom routes from the web
> interface.

You can create custom routes on the fly using JMX, jolokia, REST or
Java just fine without using anonymous processors.


> I think anonymous processors are relevant because data formats
> can be more or less arbitrary, and therefore needs to be handled uniquely
> per route definition. I will definitely look into the build-in type
> converter and bean integration though.

I think you're confusing anonymous processors with DI beans. A data
format is mostly just a bean which needs to be registered in some
registry (JNDI, spring, guice, whatever). Those are outside of the
camel DSL and camel looks them up by name. So you don't need anonymous
processors in the Java DSL; you just need a way to load/register beans
by name that you can reference from your dynamic camel routes.

You're web app maybe needs to support letting folks edit, say, spring
XML files to define data formats so they can be loaded dynamically.

--
James
---
Red Hat

Email: jstra...@redhat.com
Web: http://fusesource.com
Twitter: jstrachan, fusenews
Blog: http://macstrac.blogspot.com/

Open Source Integration


Re: Camel routing issue

2013-07-23 Thread prabumc...@gmail.com
Hi

I need one help,I want set JMSExpiration value before routing messages.

i tried setting JMSExpiration in .setHeader

But it didn't work.I still seeing JMSExpiration is zero.

*Thanks*
Prabu.N


On Wed, Apr 24, 2013 at 9:28 PM, Prabu  wrote:

> Please kindly help me.
>
>
> Regards
> Prabu.N
>
>
> On Wed, Apr 24, 2013 at 2:54 PM, Prabu  wrote:
>
>> Hi All,
>>
>> I am facing some issue in my camel code.
>>
>> Initially i have used java code to route messages from one end to another
>> end.
>>
>> I modified code to route message using camel routing insight of java code.
>>
>> After modified code,i am facing issue in my code.
>>
>> 500 Messages stored in DLQ.testQueue
>>
>> When i try to re-delivery all 500 messages using active-mq API *moveMessageTo
>> method.*
>>
>> 250 or 200 or 100 messages still i can see in DLQ.testQueue.
>>
>> I feel messages re-delivering,But due to some message coming back again
>> into DLQ.
>>
>> Please kindly help me.
>>
>> *Regards*
>> Prabu.N
>>
>>
>> On Wed, Apr 17, 2013 at 5:15 PM, Taariq Levack [via Camel] <
>> ml-node+s465427n5731018...@n5.nabble.com> wrote:
>>
>>> Hi
>>>
>>> Looks like java needs a hand[1], after
>>> .to(SCHEDULE_QNAME,ONLINE__QNAME),
>>> you can try endChoice()
>>>
>>> [1]
>>>
>>> http://camel.apache.org/why-can-i-not-use-when-or-otherwise-in-a-java-camel-route.html
>>>
>>> Taariq
>>>
>>>
>>> On Wed, Apr 17, 2013 at 11:00 AM, [hidden 
>>> email]<[hidden
>>> email] 
>>> > wrote:
>>>
>>> > Thanks Claus for your response..
>>> >
>>> > I facing some issue in below code
>>> >
>>> > if condition satisfy i want forward into 2 queues,If not it check
>>> second
>>> > condition forward into next queue.
>>> >
>>> > from(SURVEYINVITATION_QNAME).choice()
>>> > *  .when(SCHEDULE_PREDICATE)*
>>> >.multicast().to(SCHEDULE_QNAME,ONLINE__QNAME)
>>> > *   .when(ACCOUNT_EVENT_CARE_HANDLER_PREDICATE)*
>>> >.to(ACCOUNT_EVENT_CARE_HANDLER_QNAME)
>>> >   .otherwise()
>>> >   .to(ERQ_QNAME)
>>> >  .end();
>>> >
>>> >
>>> > I am getting compilation error,Please correct me what mistake i am
>>> making
>>> > here
>>> >
>>> > *Regards*
>>> > Prabu.N
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> > On Wed, Apr 17, 2013 at 2:21 PM, Claus Ibsen-2 [via Camel] <
>>> > [hidden email] >
>>> wrote:
>>> >
>>> > > Hi
>>> > >
>>> > > If no destinations is returned, then the message is not routed
>>> anywhere.
>>> > >
>>> > > On Tue, Apr 16, 2013 at 3:44 PM, [hidden email]<
>>> > http://user/SendEmail.jtp?type=node&node=5731013&i=0>
>>> > > <[hidden email] <
>>> http://user/SendEmail.jtp?type=node&node=5731013&i=1>>
>>> > > wrote:
>>> > >
>>> > > > *One quick question.*
>>> > > >
>>> > > >
>>> > >
>>> >
>>> from("activemq:queue:HHH.InboundQueue").multicast().beanRef("recipientsGenerator")
>>>
>>> > >
>>> > > >
>>> > > > @RecipientList()
>>> > > >  public Set routeTo(Exchange ex) {
>>> > > >
>>> > > >  final Set destinations = new HashSet();
>>> > > >
>>> > > >  //based on condition we add messages header/content ,We add queue
>>> > names
>>> > > in
>>> > > > destinations varible.
>>> > > >  //destinations.add("activemq:queue:listqueue")
>>> > > >
>>> > > >   return destinations;
>>> > > >  }
>>> > > >
>>> > > > some cases,messages content not satisfy any condition and it
>>> returning
>>> > > > empty destinations set.
>>> > > >
>>> > > > If destinations set is empty where message will go?.
>>> > > >
>>> > > > Because,i can't see messages in HHH.InboundQueue and any queues.
>>> > > >
>>> > > > *Regards*
>>> > > > Prabu.N
>>> > > >
>>> > > >
>>> > > >
>>> > > >
>>> > > > On Mon, Apr 15, 2013 at 10:00 PM, Prabu <[hidden email]<
>>> > http://user/SendEmail.jtp?type=node&node=5731013&i=2>>
>>> > > wrote:
>>> > > >
>>> > > >> So for dynamic queue i have to use only recipientlist correct,we
>>> can't
>>> > > use
>>> > > >> .to
>>> > > >>
>>> > > >> One more question,i can't use otherwise in choice please correct
>>> if my
>>> > > >> syntax is wrong.
>>> > > >>
>>> > > >>
>>> > > >> from(INBOUND_QUEUE)
>>> > > >> .choice().when(header(TYPE).isNotNull())
>>> > > >>   .recipientList(simple("activemq:queue:Inbound.${header.TYPE}"))
>>> > > >> .otherwise()
>>> > > >>.to(ERQ_QNAME)
>>> > > >> .endChoice();
>>> > > >>
>>> > > >> After execute i am getting following error.
>>> > > >>
>>> > > >> Error:
>>> > > >>
>>> > > >> Router.java:22: cannot find symbol
>>> > > >> symbol  : method otherwise()
>>> > > >> location: class
>>> > > >> org.apache.camel.model.RecipientListDefinition>> > > >> model.ChoiceDefinition>
>>> > > >>.otherwise()
>>> > > >>^
>>> > > >>
>>> > > >>
>>> > > >>
>>> > > >> On Mon, Apr 15, 2013 at 8:55 PM, Claus Ibsen-2 [via Camel] <
>>> > > >> [hidden email] <
>>> http://user/SendEmail.jtp?type=node&node=5731013&i=3
>>>
>>> > >>
>>> >

How to get User ID from ActiveMQ to Camel

2013-07-23 Thread Daniel Kleine-Albers

Hi everyone,

I'm trying to get the ActiveMQ username of the sender of a particular 
message into Camel for further processing. However this does not seem to 
work.


I have setup my ActiveMQ broker to populate the JMSXUserID message property.

useShutdownHook="false" useJmx="true"

   persistent="true" dataDirectory="activemq-data"
   populateJMSXUserID="true" 
useAuthenticatedPrincipalForJMSXUserID="true"

xmlns="http://activemq.apache.org/schema/core";>


With debugging enabled I can see that the message contains the userID as 
expected:


13-07-23 13:46:27,916 [INFO] 
(org.apache.activemq.broker.util.LoggingBrokerPlugin) - 
postProcessDispatch :MessageDispatch {commandId = 7, responseRequired = 
false, consumerId = ID:pc22-37613-1374579904970-3:1:1:1, destination = 
queue://fromclient, message = ActiveMQBytesMessage {commandId = 6, 
responseRequired = false, messageId = 
ID:pc22-37613-1374579904970-6:12:-1:1:2, originalDestination = null, 
originalTransactionId = null, producerId = 
ID:pc22-37613-1374579904970-6:12:-1:1, destination = queue://fromclient, 
transactionId = null, expiration = 0, timestamp = 1374579987913, arrival 
= 0, brokerInTime = 1374579987913, brokerOutTime = 1374579987914, 
correlationId = z1hbqqt065, replyTo = null, persistent = false, type = 
null, priority = 4, groupID = null, groupSequence = 0, targetConsumerId 
= null, compressed = false, *userID = 
ws:RoWkBu9W9HrLXyPyOeXLgD3OwtIrW4si*, content = 
org.apache.activemq.util.ByteSequence@6cb2b9ec, marshalledProperties = 
null, dataStructure = null, redeliveryCounter = 0, size = 1028, 
properties = {LMSMessageType=Ping}, readOnlyProperties = true, 
readOnlyBody = true, droppable = false} ActiveMQBytesMessage{ bytesOut = 
null, dataOut = null, dataIn = null }, redeliveryCounter = 0}



Additionally I have a very short route defined that just logs the message:

13-07-23 13:46:27,918 [INFO] (fromclient) - 
Exchange[ExchangePattern:InOnly, 
Properties:{CamelBinding=org.apache.camel.component.jms.JmsBinding@5f41ab78, 
CamelToEndpoint=log://fromclient?showHeaders=true&showProperties=true, 
CamelCreatedTimestamp=Tue Jul 23 13:46:27 CEST 2013, 
CamelExternalRedelivered=false}, Headers:{JMSExpiration=0, 
JMSPriority=4, JMSReplyTo=null, JMSDeliveryMode=1, 
JMSDestination=queue://fromclient, JMSRedelivered=false, JMSType=null, 
JMSMessageID=ID:pc22-37613-1374579904970-6:12:-1:1:2, 
JMSCorrelationID=z1hbqqt065, 
breadcrumbId=ID:pc22-37613-1374579904970-6:12:-1:1:2, JMSXGroupID=null, 
JMSTimestamp=1374579987913}, BodyType:byte[], Body:PING]


--> Here I can't see a user ID (I would expect a JMSXUserID header)

Do you have any idea on why this could happen?


Thanks
Daniel


Re: Quartz and enrich seem not to work together...

2013-07-23 Thread roger_rabbit
Claus,

thanks for your tip. That was that little thingy I was looking for.
I should have read the "noop" option closer... "rtfm" should be my mantra!

Roger.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Quartz-and-enrich-seem-not-to-work-together-tp5736046p5736117.html
Sent from the Camel - Users mailing list archive at Nabble.com.


How to pass the http authentication token?

2013-07-23 Thread zerdo
Hello,
How to pass the http authentication token?

If it could cause the browser POST then he or she would look like this:
http://cms.mycompany.com.pl/myapi/delete_condition/ffad56ea-c000?token=xyz

Is it enough to pass the token as a parameter or header? If so, what is to
be heading?

Please help



--
View this message in context: 
http://camel.465427.n5.nabble.com/How-to-pass-the-http-authentication-token-tp5736116.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: How to pass the http authentication token?

2013-07-23 Thread Bilgin Ibryam
If you are using the http4 component, have a look at

Configuring URI Parameters section on the docs

http://camel.apache.org/http4.html

HTH
Bilgin

On 23 July 2013 13:11, zerdo  wrote:
> Hello,
> How to pass the http authentication token?
>
> If it could cause the browser POST then he or she would look like this:
> http://cms.mycompany.com.pl/myapi/delete_condition/ffad56ea-c000?token=xyz
>
> Is it enough to pass the token as a parameter or header? If so, what is to
> be heading?
>
> Please help
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/How-to-pass-the-http-authentication-token-tp5736116.html
> Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel routing issue

2013-07-23 Thread Claus Ibsen
Hi

Have you read about the preserveMessageQos option?
http://camel.apache.org/jms

On Tue, Jul 23, 2013 at 1:39 PM, prabumc...@gmail.com
 wrote:
> Hi
>
> I need one help,I want set JMSExpiration value before routing messages.
>
> i tried setting JMSExpiration in .setHeader
>
> But it didn't work.I still seeing JMSExpiration is zero.
>
> *Thanks*
> Prabu.N
>
>
> On Wed, Apr 24, 2013 at 9:28 PM, Prabu  wrote:
>
>> Please kindly help me.
>>
>>
>> Regards
>> Prabu.N
>>
>>
>> On Wed, Apr 24, 2013 at 2:54 PM, Prabu  wrote:
>>
>>> Hi All,
>>>
>>> I am facing some issue in my camel code.
>>>
>>> Initially i have used java code to route messages from one end to another
>>> end.
>>>
>>> I modified code to route message using camel routing insight of java code.
>>>
>>> After modified code,i am facing issue in my code.
>>>
>>> 500 Messages stored in DLQ.testQueue
>>>
>>> When i try to re-delivery all 500 messages using active-mq API 
>>> *moveMessageTo
>>> method.*
>>>
>>> 250 or 200 or 100 messages still i can see in DLQ.testQueue.
>>>
>>> I feel messages re-delivering,But due to some message coming back again
>>> into DLQ.
>>>
>>> Please kindly help me.
>>>
>>> *Regards*
>>> Prabu.N
>>>
>>>
>>> On Wed, Apr 17, 2013 at 5:15 PM, Taariq Levack [via Camel] <
>>> ml-node+s465427n5731018...@n5.nabble.com> wrote:
>>>
 Hi

 Looks like java needs a hand[1], after
 .to(SCHEDULE_QNAME,ONLINE__QNAME),
 you can try endChoice()

 [1]

 http://camel.apache.org/why-can-i-not-use-when-or-otherwise-in-a-java-camel-route.html

 Taariq


 On Wed, Apr 17, 2013 at 11:00 AM, [hidden 
 email]<[hidden
 email] 
 > wrote:

 > Thanks Claus for your response..
 >
 > I facing some issue in below code
 >
 > if condition satisfy i want forward into 2 queues,If not it check
 second
 > condition forward into next queue.
 >
 > from(SURVEYINVITATION_QNAME).choice()
 > *  .when(SCHEDULE_PREDICATE)*
 >.multicast().to(SCHEDULE_QNAME,ONLINE__QNAME)
 > *   .when(ACCOUNT_EVENT_CARE_HANDLER_PREDICATE)*
 >.to(ACCOUNT_EVENT_CARE_HANDLER_QNAME)
 >   .otherwise()
 >   .to(ERQ_QNAME)
 >  .end();
 >
 >
 > I am getting compilation error,Please correct me what mistake i am
 making
 > here
 >
 > *Regards*
 > Prabu.N
 >
 >
 >
 >
 >
 >
 > On Wed, Apr 17, 2013 at 2:21 PM, Claus Ibsen-2 [via Camel] <
 > [hidden email] >
 wrote:
 >
 > > Hi
 > >
 > > If no destinations is returned, then the message is not routed
 anywhere.
 > >
 > > On Tue, Apr 16, 2013 at 3:44 PM, [hidden email]<
 > http://user/SendEmail.jtp?type=node&node=5731013&i=0>
 > > <[hidden email] <
 http://user/SendEmail.jtp?type=node&node=5731013&i=1>>
 > > wrote:
 > >
 > > > *One quick question.*
 > > >
 > > >
 > >
 >
 from("activemq:queue:HHH.InboundQueue").multicast().beanRef("recipientsGenerator")

 > >
 > > >
 > > > @RecipientList()
 > > >  public Set routeTo(Exchange ex) {
 > > >
 > > >  final Set destinations = new HashSet();
 > > >
 > > >  //based on condition we add messages header/content ,We add queue
 > names
 > > in
 > > > destinations varible.
 > > >  //destinations.add("activemq:queue:listqueue")
 > > >
 > > >   return destinations;
 > > >  }
 > > >
 > > > some cases,messages content not satisfy any condition and it
 returning
 > > > empty destinations set.
 > > >
 > > > If destinations set is empty where message will go?.
 > > >
 > > > Because,i can't see messages in HHH.InboundQueue and any queues.
 > > >
 > > > *Regards*
 > > > Prabu.N
 > > >
 > > >
 > > >
 > > >
 > > > On Mon, Apr 15, 2013 at 10:00 PM, Prabu <[hidden email]<
 > http://user/SendEmail.jtp?type=node&node=5731013&i=2>>
 > > wrote:
 > > >
 > > >> So for dynamic queue i have to use only recipientlist correct,we
 can't
 > > use
 > > >> .to
 > > >>
 > > >> One more question,i can't use otherwise in choice please correct
 if my
 > > >> syntax is wrong.
 > > >>
 > > >>
 > > >> from(INBOUND_QUEUE)
 > > >> .choice().when(header(TYPE).isNotNull())
 > > >>   .recipientList(simple("activemq:queue:Inbound.${header.TYPE}"))
 > > >> .otherwise()
 > > >>.to(ERQ_QNAME)
 > > >> .endChoice();
 > > >>
 > > >> After execute i am getting following error.
 > > >>
 > > >> Error:
 > > >>
 > > >> Router.java:22: cannot find symbol
 > > >> symbol  : method otherwise()
 > > >> location: class
 > > >> org.apa

Re: Leveraging CXF Asynchronous processing when MEP is InOut

2013-07-23 Thread Claus Ibsen
On Tue, Jul 23, 2013 at 11:57 AM, Edwin  wrote:
> Since my cxf call has an MEP of InOut, is it possible to achieve the cxf
> asynchronous behavior?
>
> Or is the cxf asynchronous behaviour only associated with an MEP of InOnly?
>

No camel-cxf is async by default, unless you force it to be
synchronous with synchronous=true.

The Camel CXF producer uses the org.apache.cxf.endpoint.ClientCallback
from Apache CXF

> Thanks,
> Edwin
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Leveraging-CXF-Asynchronous-processing-when-MEP-is-InOut-tp5735904p5736102.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



--
Claus Ibsen
-
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


Re: Camel routing issue

2013-07-23 Thread prabumc...@gmail.com
if you don't mind can you provide sample how to use this property to set
jmsExpiration time for messages


*Thanks*
Prabu.N


On Tue, Jul 23, 2013 at 6:48 PM, Claus Ibsen-2 [via Camel] <
ml-node+s465427n5736125...@n5.nabble.com> wrote:

> Hi
>
> Have you read about the preserveMessageQos option?
> http://camel.apache.org/jms
>
>
> On Tue, Jul 23, 2013 at 1:39 PM, [hidden 
> email]
> <[hidden email] >
> wrote:
>
> > Hi
> >
> > I need one help,I want set JMSExpiration value before routing messages.
> >
> > i tried setting JMSExpiration in .setHeader
> >
> > But it didn't work.I still seeing JMSExpiration is zero.
> >
> > *Thanks*
> > Prabu.N
> >
> >
> > On Wed, Apr 24, 2013 at 9:28 PM, Prabu <[hidden 
> > email]>
> wrote:
> >
> >> Please kindly help me.
> >>
> >>
> >> Regards
> >> Prabu.N
> >>
> >>
> >> On Wed, Apr 24, 2013 at 2:54 PM, Prabu <[hidden 
> >> email]>
> wrote:
> >>
> >>> Hi All,
> >>>
> >>> I am facing some issue in my camel code.
> >>>
> >>> Initially i have used java code to route messages from one end to
> another
> >>> end.
> >>>
> >>> I modified code to route message using camel routing insight of java
> code.
> >>>
> >>> After modified code,i am facing issue in my code.
> >>>
> >>> 500 Messages stored in DLQ.testQueue
> >>>
> >>> When i try to re-delivery all 500 messages using active-mq API
> *moveMessageTo
> >>> method.*
> >>>
> >>> 250 or 200 or 100 messages still i can see in DLQ.testQueue.
> >>>
> >>> I feel messages re-delivering,But due to some message coming back
> again
> >>> into DLQ.
> >>>
> >>> Please kindly help me.
> >>>
> >>> *Regards*
> >>> Prabu.N
> >>>
> >>>
> >>> On Wed, Apr 17, 2013 at 5:15 PM, Taariq Levack [via Camel] <
> >>> [hidden email] >
> wrote:
> >>>
>  Hi
> 
>  Looks like java needs a hand[1], after
>  .to(SCHEDULE_QNAME,ONLINE__QNAME),
>  you can try endChoice()
> 
>  [1]
> 
> 
> http://camel.apache.org/why-can-i-not-use-when-or-otherwise-in-a-java-camel-route.html
> 
>  Taariq
> 
> 
>  On Wed, Apr 17, 2013 at 11:00 AM, [hidden email]<
> http://user/SendEmail.jtp?type=node&node=5731018&i=0><[hidden
>  email] 
>  > wrote:
> 
>  > Thanks Claus for your response..
>  >
>  > I facing some issue in below code
>  >
>  > if condition satisfy i want forward into 2 queues,If not it check
>  second
>  > condition forward into next queue.
>  >
>  > from(SURVEYINVITATION_QNAME).choice()
>  > *  .when(SCHEDULE_PREDICATE)*
>  >.multicast().to(SCHEDULE_QNAME,ONLINE__QNAME)
>  > *   .when(ACCOUNT_EVENT_CARE_HANDLER_PREDICATE)*
>  >.to(ACCOUNT_EVENT_CARE_HANDLER_QNAME)
>  >   .otherwise()
>  >   .to(ERQ_QNAME)
>  >  .end();
>  >
>  >
>  > I am getting compilation error,Please correct me what mistake i am
>  making
>  > here
>  >
>  > *Regards*
>  > Prabu.N
>  >
>  >
>  >
>  >
>  >
>  >
>  > On Wed, Apr 17, 2013 at 2:21 PM, Claus Ibsen-2 [via Camel] <
>  > [hidden email] <
> http://user/SendEmail.jtp?type=node&node=5731018&i=2>>
>  wrote:
>  >
>  > > Hi
>  > >
>  > > If no destinations is returned, then the message is not routed
>  anywhere.
>  > >
>  > > On Tue, Apr 16, 2013 at 3:44 PM, [hidden email]<
>  > http://user/SendEmail.jtp?type=node&node=5731013&i=0>
>  > > <[hidden email] <
>  http://user/SendEmail.jtp?type=node&node=5731013&i=1>>
>  > > wrote:
>  > >
>  > > > *One quick question.*
>  > > >
>  > > >
>  > >
>  >
> 
> from("activemq:queue:HHH.InboundQueue").multicast().beanRef("recipientsGenerator")
>
> 
>  > >
>  > > >
>  > > > @RecipientList()
>  > > >  public Set routeTo(Exchange ex) {
>  > > >
>  > > >  final Set destinations = new HashSet();
>  > > >
>  > > >  //based on condition we add messages header/content ,We add
> queue
>  > names
>  > > in
>  > > > destinations varible.
>  > > >  //destinations.add("activemq:queue:listqueue")
>  > > >
>  > > >   return destinations;
>  > > >  }
>  > > >
>  > > > some cases,messages content not satisfy any condition and it
>  returning
>  > > > empty destinations set.
>  > > >
>  > > > If destinations set is empty where message will go?.
>  > > >
>  > > > Because,i can't see messages in HHH.InboundQueue and any
> queues.
>  > > >
>  > > > *Regards*
>  > > > Prabu.N
>  > > >
>  > > >
>  > > >
>  > > >
>  > > > On Mon, Apr 15, 2013 at 

Re: After camelContext shutdown, is any way to exit the Java main() method?

2013-07-23 Thread Claus Ibsen
You should give Camel time to shutdown graceful instead of forcing a 1
sec timeout
http://camel.apache.org/graceful-shutdown.html

On Tue, Jul 23, 2013 at 12:08 PM, SyedBhai  wrote:
> Hi.
>   I am having a simple class with main().  In main() I am executing the
> following code:
> try {
> CamelContext cc=new DefaultCamelContext();
> cc.addRoutes(new RouteBuilder()  {
>public void configure()  {
>from("direct:start1").
>
> to("cxf://http://localhost:8080/JAXWS1/MyInterfaceImpl?serviceClass=com.syed.MyInterface&serviceName={http://syed.com/}MyInterfaceImplService&portName={http://syed.com/}MyInterfaceImplPort";);
>}
>  }
> );
> cc.start();
> ProducerTemplate t=cc.createProducerTemplate();
> int annsal=t.requestBody("direct:start1", 1, Integer.class);
> System.out.println("annsal:"+annsal);
> cc.getShutdownStrategy().setShutdownNowOnTimeout(true);
> cc.getShutdownStrategy().setTimeUnit(TimeUnit.SECONDS);
> cc.getShutdownStrategy().setTimeout(1);
>
> t.stop();  cc.stop();
> }catch(Exception x){}
>
> To my surprise I am getting the output but the program is still running.  I
> later checked the list of threads running.  This is the list I have:
>
> Thread[main,5,main]
> Thread[Reference Handler,10,system]
> Thread[Finalizer,8,system]
> Thread[default-workqueue-1,5,default-workqueue]
> Thread[Thread-1,5,main]
> Thread[Signal Dispatcher,9,system]
> Thread[GC Daemon,2,system]
> Thread[I/O dispatcher 1,5,main]
> Thread[I/O dispatcher 2,5,main]
> Thread[I/O dispatcher 3,5,main]
> Thread[I/O dispatcher 4,5,main]
>
> If I use a mock:test endpoint instead of cxf the program terminates
> automatically.  So I believe when I am using some other components such as
> cxf then camel is creating some threads and not stopping them.
>
> This may cause memory leaks in my project.  Can you guys help?
>
> Thanks,
> Syed.
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/After-camelContext-shutdown-is-any-way-to-exit-the-Java-main-method-tp5735993p5736105.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


Re: Is it possible to import Endpoints from a xml file like routeContextRef?

2013-07-23 Thread bonnahu
Hey Claus,
Thanks for your response again. Yeah, that's I am looking for, since I have 
a bunch of , which will be included in several projects. I am
thinking to do it in this way, 
1. Put the id and uri of endpoint in a properties file
2. In a init route, read the properties file then dynamically inject/add the
endpoint to the camelContext

do you think it is a doable solution?

thanks





--
View this message in context: 
http://camel.465427.n5.nabble.com/Is-it-possible-to-import-Endpoints-from-a-xml-file-like-routeContextRef-tp5736053p5736132.html
Sent from the Camel - Users mailing list archive at Nabble.com.


No Consumer available Exception

2013-07-23 Thread Jothi
Camel Users,

I face a strange error when I tried to run one of my routes. Why I say
strange is because, I can see that the consumer for one of the routes is
started, but it still fails when run!

Here is the route;

// Process and send to the aggregator
   
from(DIRECT_PROCESS_REF_DATA_ROUTER).convertBodyTo(String.class).log("in the
choice block!")
   
.setHeader(CORRELATION_HEADER_KEY).constant(CORRELATION_HEADER_VALUE)
.choice()
   
.when().xpath(IRouterConstants.UNIT_MAPPING.getValue()).setHeader(IRouterConstants.EXCHANGE_HEADER_BU.getValue(),
simple("true"))
.convertBodyTo(MappingX.class)
.to(DIRECT_SEND_TO_AGGREGATOR)
   
.when().xpath(IRouterConstants.USER_MAPPING.getValue()).setHeader(IRouterConstants.EXCHANGE_HEADER_BU.getValue(),
simple("false"))
.convertBodyTo(MappingY.class)
.to(DIRECT_SEND_TO_AGGREGATOR)
.otherwise()
.log(LoggingLevel.DEBUG, getClass().getName(), "Nothing
to do") // TODO... Nothing to do does not look nice
//.endChoice()
.routeId(ROUTE_ID_JAXB_TRANSFORMER);

// Send to the Endur GO aggregator
   
from(DIRECT_SEND_TO_AGGREGATOR).setHeader(IRouterConstants.AGGREGATOR_FILE_COUNT.getValue()).constant(2)
   
.aggregate(header(CORRELATION_HEADER_KEY)).aggregationStrategyRef("mappingggregationStrategy").completionTimeout(3000)
.convertBodyTo(String.class)
.setHeader("CamelFileName").simple("${header.payloadFilename}")
.to("file://{{ref.data.csv}}?readLock=rename")
.routeId(ROUTE_ID_DATA_AGGREGATOR);

// Read the files and send to the processor to convert the xml to
jaxb objects
from("file://{{ref.data.staging}}")
.routePolicy(goRoutePolicy).noAutoStartup()
.to(DIRECT_PROCESS_REF_DATA_ROUTER)
.routeId(ROUTE_ID_REF_DATA_ROUTER);

Here is the exception that I get:

org.apache.camel.CamelExchangeException: No consumers available on endpoint:
Endpoint[direct://processRefDataRouter].

The direct://processRefDataRouter is represented as a constant in the
DIRECT_PROCESS_REF_DATA_ROUTER in the class.



--
View this message in context: 
http://camel.465427.n5.nabble.com/No-Consumer-available-Exception-tp5736133.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Probleme with startorder

2013-07-23 Thread Bovas
Thanks Claus, it works perfectly 



-
regards,
Bovas
--
View this message in context: 
http://camel.465427.n5.nabble.com/Probleme-with-startorder-tp5736034p5736134.html
Sent from the Camel - Users mailing list archive at Nabble.com.


padded text and\or static classes in velocity template of velocity component

2013-07-23 Thread javamonkey79
I am trying to pad some text in a velocity template in the camel component.
To do this, I'd like to use the StringUtils class of apache commons. Per
suggestions from other sources, I've tried this:

public class StringUtilsHelper {
public void addStringUtilsToExchange( final Exchange exchange ) {
exchange.setProperty( "StringUtils", new StringUtils() );
exchange.getIn().setHeader( "StringUtils", new StringUtils() );
}
}

and in my template:
${exchange.StringUtils.leftPad("foo", 10)}
${in.StringUtils.leftPad("foo", 10)}
I've also tried:
$exchange.StringUtils.leftPad("foo", 10)
$in.StringUtils.leftPad("foo", 10)

When I call this template by calling velocity without camel it works,
something like this:
Velocity.getTemplate( "string-padding-test.vm" ).merge( new
VelocityContext() {
{
put( "StringUtils", StringUtils.class );
}
}, stringWriter );

My route is pretty simple, and when I add: $body to the template the objects
in the body do render, so I'm at a loss.






${body}





I'm willing to use other things, but I'd prefer not to have to write extra
macros in to my template for padding and other formatting, if it came to
that I'd build a decorator class to wrap my objects to be rendered.

Does anyone have any idea why this is not working?



--
View this message in context: 
http://camel.465427.n5.nabble.com/padded-text-and-or-static-classes-in-velocity-template-of-velocity-component-tp5736136.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: No Consumer available Exception

2013-07-23 Thread Bilgin Ibryam
Strange, can you post the whole route file

Bilgin

On 23 July 2013 14:44, Jothi  wrote:
> Camel Users,
>
> I face a strange error when I tried to run one of my routes. Why I say
> strange is because, I can see that the consumer for one of the routes is
> started, but it still fails when run!
>
> Here is the route;
>
> // Process and send to the aggregator
>
> from(DIRECT_PROCESS_REF_DATA_ROUTER).convertBodyTo(String.class).log("in the
> choice block!")
>
> .setHeader(CORRELATION_HEADER_KEY).constant(CORRELATION_HEADER_VALUE)
> .choice()
>
> .when().xpath(IRouterConstants.UNIT_MAPPING.getValue()).setHeader(IRouterConstants.EXCHANGE_HEADER_BU.getValue(),
> simple("true"))
> .convertBodyTo(MappingX.class)
> .to(DIRECT_SEND_TO_AGGREGATOR)
>
> .when().xpath(IRouterConstants.USER_MAPPING.getValue()).setHeader(IRouterConstants.EXCHANGE_HEADER_BU.getValue(),
> simple("false"))
> .convertBodyTo(MappingY.class)
> .to(DIRECT_SEND_TO_AGGREGATOR)
> .otherwise()
> .log(LoggingLevel.DEBUG, getClass().getName(), "Nothing
> to do") // TODO... Nothing to do does not look nice
> //.endChoice()
> .routeId(ROUTE_ID_JAXB_TRANSFORMER);
>
> // Send to the Endur GO aggregator
>
> from(DIRECT_SEND_TO_AGGREGATOR).setHeader(IRouterConstants.AGGREGATOR_FILE_COUNT.getValue()).constant(2)
>
> .aggregate(header(CORRELATION_HEADER_KEY)).aggregationStrategyRef("mappingggregationStrategy").completionTimeout(3000)
> .convertBodyTo(String.class)
> .setHeader("CamelFileName").simple("${header.payloadFilename}")
> .to("file://{{ref.data.csv}}?readLock=rename")
> .routeId(ROUTE_ID_DATA_AGGREGATOR);
>
> // Read the files and send to the processor to convert the xml to
> jaxb objects
> from("file://{{ref.data.staging}}")
> .routePolicy(goRoutePolicy).noAutoStartup()
> .to(DIRECT_PROCESS_REF_DATA_ROUTER)
> .routeId(ROUTE_ID_REF_DATA_ROUTER);
>
> Here is the exception that I get:
>
> org.apache.camel.CamelExchangeException: No consumers available on endpoint:
> Endpoint[direct://processRefDataRouter].
>
> The direct://processRefDataRouter is represented as a constant in the
> DIRECT_PROCESS_REF_DATA_ROUTER in the class.
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/No-Consumer-available-Exception-tp5736133.html
> Sent from the Camel - Users mailing list archive at Nabble.com.


Exponential BackOff ignored

2013-07-23 Thread zzkozak
Hi,

 I'm using the following route and wonder why the exponential back off isn't
working. Each call to the *orderServiceBean* is performed exactly after
4Minutes (24ms) and not as expected after 4,8,16min, etc.



 Thanks in advance,
Marcin



--
View this message in context: 
http://camel.465427.n5.nabble.com/Exponential-BackOff-ignored-tp5736138.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel routing issue

2013-07-23 Thread prabumc...@gmail.com
Please kindly provide some sample code.

*Thanks*
Prabu.N


On Tue, Jul 23, 2013 at 7:04 PM, Prabu  wrote:

> if you don't mind can you provide sample how to use this property to set
> jmsExpiration time for messages
>
>
> *Thanks*
> Prabu.N
>
>
> On Tue, Jul 23, 2013 at 6:48 PM, Claus Ibsen-2 [via Camel] <
> ml-node+s465427n5736125...@n5.nabble.com> wrote:
>
>> Hi
>>
>> Have you read about the preserveMessageQos option?
>> http://camel.apache.org/jms
>>
>>
>> On Tue, Jul 23, 2013 at 1:39 PM, [hidden 
>> email]
>> <[hidden email] >
>> wrote:
>>
>> > Hi
>> >
>> > I need one help,I want set JMSExpiration value before routing messages.
>> >
>> > i tried setting JMSExpiration in .setHeader
>> >
>> > But it didn't work.I still seeing JMSExpiration is zero.
>> >
>> > *Thanks*
>> > Prabu.N
>> >
>> >
>> > On Wed, Apr 24, 2013 at 9:28 PM, Prabu <[hidden 
>> > email]>
>> wrote:
>> >
>> >> Please kindly help me.
>> >>
>> >>
>> >> Regards
>> >> Prabu.N
>> >>
>> >>
>> >> On Wed, Apr 24, 2013 at 2:54 PM, Prabu <[hidden 
>> >> email]>
>> wrote:
>> >>
>> >>> Hi All,
>> >>>
>> >>> I am facing some issue in my camel code.
>> >>>
>> >>> Initially i have used java code to route messages from one end to
>> another
>> >>> end.
>> >>>
>> >>> I modified code to route message using camel routing insight of java
>> code.
>> >>>
>> >>> After modified code,i am facing issue in my code.
>> >>>
>> >>> 500 Messages stored in DLQ.testQueue
>> >>>
>> >>> When i try to re-delivery all 500 messages using active-mq API
>> *moveMessageTo
>> >>> method.*
>> >>>
>> >>> 250 or 200 or 100 messages still i can see in DLQ.testQueue.
>> >>>
>> >>> I feel messages re-delivering,But due to some message coming back
>> again
>> >>> into DLQ.
>> >>>
>> >>> Please kindly help me.
>> >>>
>> >>> *Regards*
>> >>> Prabu.N
>> >>>
>> >>>
>> >>> On Wed, Apr 17, 2013 at 5:15 PM, Taariq Levack [via Camel] <
>> >>> [hidden email] >
>> wrote:
>> >>>
>>  Hi
>> 
>>  Looks like java needs a hand[1], after
>>  .to(SCHEDULE_QNAME,ONLINE__QNAME),
>>  you can try endChoice()
>> 
>>  [1]
>> 
>> 
>> http://camel.apache.org/why-can-i-not-use-when-or-otherwise-in-a-java-camel-route.html
>> 
>>  Taariq
>> 
>> 
>>  On Wed, Apr 17, 2013 at 11:00 AM, [hidden email]<
>> http://user/SendEmail.jtp?type=node&node=5731018&i=0><[hidden
>>  email] 
>>  > wrote:
>> 
>>  > Thanks Claus for your response..
>>  >
>>  > I facing some issue in below code
>>  >
>>  > if condition satisfy i want forward into 2 queues,If not it check
>>  second
>>  > condition forward into next queue.
>>  >
>>  > from(SURVEYINVITATION_QNAME).choice()
>>  > *  .when(SCHEDULE_PREDICATE)*
>>  >.multicast().to(SCHEDULE_QNAME,ONLINE__QNAME)
>>  > *   .when(ACCOUNT_EVENT_CARE_HANDLER_PREDICATE)*
>>  >.to(ACCOUNT_EVENT_CARE_HANDLER_QNAME)
>>  >   .otherwise()
>>  >   .to(ERQ_QNAME)
>>  >  .end();
>>  >
>>  >
>>  > I am getting compilation error,Please correct me what mistake i am
>>  making
>>  > here
>>  >
>>  > *Regards*
>>  > Prabu.N
>>  >
>>  >
>>  >
>>  >
>>  >
>>  >
>>  > On Wed, Apr 17, 2013 at 2:21 PM, Claus Ibsen-2 [via Camel] <
>>  > [hidden email] <
>> http://user/SendEmail.jtp?type=node&node=5731018&i=2>>
>>  wrote:
>>  >
>>  > > Hi
>>  > >
>>  > > If no destinations is returned, then the message is not routed
>>  anywhere.
>>  > >
>>  > > On Tue, Apr 16, 2013 at 3:44 PM, [hidden email]<
>>  > http://user/SendEmail.jtp?type=node&node=5731013&i=0>
>>  > > <[hidden email] <
>>  http://user/SendEmail.jtp?type=node&node=5731013&i=1>>
>>  > > wrote:
>>  > >
>>  > > > *One quick question.*
>>  > > >
>>  > > >
>>  > >
>>  >
>> 
>> from("activemq:queue:HHH.InboundQueue").multicast().beanRef("recipientsGenerator")
>>
>> 
>>  > >
>>  > > >
>>  > > > @RecipientList()
>>  > > >  public Set routeTo(Exchange ex) {
>>  > > >
>>  > > >  final Set destinations = new HashSet();
>>  > > >
>>  > > >  //based on condition we add messages header/content ,We add
>> queue
>>  > names
>>  > > in
>>  > > > destinations varible.
>>  > > >  //destinations.add("activemq:queue:listqueue")
>>  > > >
>>  > > >   return destinations;
>>  > > >  }
>>  > > >
>>  > > > some cases,messages content not satisfy any condition and it
>>  returning
>>  > > > empty destinations set.
>>  > > >
>>  > > 

Re: No Consumer available Exception

2013-07-23 Thread Claus Ibsen
Sounds like the routes are started in wrong order.

You can try dicate the order.
http://camel.apache.org/configuring-route-startup-ordering-and-autostartup.html


On Tue, Jul 23, 2013 at 5:06 PM, Bilgin Ibryam  wrote:
> Strange, can you post the whole route file
>
> Bilgin
>
> On 23 July 2013 14:44, Jothi  wrote:
>> Camel Users,
>>
>> I face a strange error when I tried to run one of my routes. Why I say
>> strange is because, I can see that the consumer for one of the routes is
>> started, but it still fails when run!
>>
>> Here is the route;
>>
>> // Process and send to the aggregator
>>
>> from(DIRECT_PROCESS_REF_DATA_ROUTER).convertBodyTo(String.class).log("in the
>> choice block!")
>>
>> .setHeader(CORRELATION_HEADER_KEY).constant(CORRELATION_HEADER_VALUE)
>> .choice()
>>
>> .when().xpath(IRouterConstants.UNIT_MAPPING.getValue()).setHeader(IRouterConstants.EXCHANGE_HEADER_BU.getValue(),
>> simple("true"))
>> .convertBodyTo(MappingX.class)
>> .to(DIRECT_SEND_TO_AGGREGATOR)
>>
>> .when().xpath(IRouterConstants.USER_MAPPING.getValue()).setHeader(IRouterConstants.EXCHANGE_HEADER_BU.getValue(),
>> simple("false"))
>> .convertBodyTo(MappingY.class)
>> .to(DIRECT_SEND_TO_AGGREGATOR)
>> .otherwise()
>> .log(LoggingLevel.DEBUG, getClass().getName(), "Nothing
>> to do") // TODO... Nothing to do does not look nice
>> //.endChoice()
>> .routeId(ROUTE_ID_JAXB_TRANSFORMER);
>>
>> // Send to the Endur GO aggregator
>>
>> from(DIRECT_SEND_TO_AGGREGATOR).setHeader(IRouterConstants.AGGREGATOR_FILE_COUNT.getValue()).constant(2)
>>
>> .aggregate(header(CORRELATION_HEADER_KEY)).aggregationStrategyRef("mappingggregationStrategy").completionTimeout(3000)
>> .convertBodyTo(String.class)
>> .setHeader("CamelFileName").simple("${header.payloadFilename}")
>> .to("file://{{ref.data.csv}}?readLock=rename")
>> .routeId(ROUTE_ID_DATA_AGGREGATOR);
>>
>> // Read the files and send to the processor to convert the xml to
>> jaxb objects
>> from("file://{{ref.data.staging}}")
>> .routePolicy(goRoutePolicy).noAutoStartup()
>> .to(DIRECT_PROCESS_REF_DATA_ROUTER)
>> .routeId(ROUTE_ID_REF_DATA_ROUTER);
>>
>> Here is the exception that I get:
>>
>> org.apache.camel.CamelExchangeException: No consumers available on endpoint:
>> Endpoint[direct://processRefDataRouter].
>>
>> The direct://processRefDataRouter is represented as a constant in the
>> DIRECT_PROCESS_REF_DATA_ROUTER in the class.
>>
>>
>>
>> --
>> View this message in context: 
>> http://camel.465427.n5.nabble.com/No-Consumer-available-Exception-tp5736133.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


Re: No Consumer available Exception

2013-07-23 Thread Jothi
That's the whole route what I have posted above! It is definitely strange as
I have another route that does the same thing and that route worked
perfectly fine! I tried changing the names of the route id, direct constants
and its values, but of no help!

What is even more strange is that I can see in the console logs that the
consumer route for the Endpoint[direct://processRefDataRouter] is already
started!





--
View this message in context: 
http://camel.465427.n5.nabble.com/No-Consumer-available-Exception-tp5736133p5736143.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Exponential BackOff ignored

2013-07-23 Thread Claus Ibsen
Hi

Try with a newer versions as we fix stuff in them, as we say here
http://camel.apache.org/support

On Tue, Jul 23, 2013 at 5:13 PM, zzkozak  wrote:
> Hi,
>
>  I'm using the following route and wonder why the exponential back off isn't
> working. Each call to the *orderServiceBean* is performed exactly after
> 4Minutes (24ms) and not as expected after 4,8,16min, etc.
>
>
>
>  Thanks in advance,
> Marcin
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Exponential-BackOff-ignored-tp5736138.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


Re: padded text and\or static classes in velocity template of velocity component

2013-07-23 Thread javamonkey79
This post helped me get it:

http://camel.465427.n5.nabble.com/How-to-use-escape-tool-esc-xml-somestrwithspclchars-in-camel-velocity-template-td5505668.html

This works for me:

in template:
$headers.StringUtils.leftPad("foo", 10)

java:
public class StringUtilsHelper {
public void addStringUtilsToExchange( final Exchange exchange ) {
exchange.getIn().setHeader( "StringUtils", new StringUtils() );
}
}

Spring xml, application context:






--
View this message in context: 
http://camel.465427.n5.nabble.com/padded-text-and-or-static-classes-in-velocity-template-of-velocity-component-tp5736136p5736147.html
Sent from the Camel - Users mailing list archive at Nabble.com.


MINA and Buffering

2013-07-23 Thread Ephemeris Lappis
Hello.

After few tests with MINA using TCP, I've observed that MINA or Camel seem
to put a lot of data in a buffer. In some cases with the sync option set to
false, injecting big flows of data to my TCP server, thousands of messages
seem to be processed many minutes late. All seem ok at the end, without any
altered or lost data.

I've been looking Camel and MINA documentations to find some explanation and
a posible way to control this buffering feature, but nothing.

Any idea ?

Thanks for your help.

Regards.



--
View this message in context: 
http://camel.465427.n5.nabble.com/MINA-and-Buffering-tp5736148.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: After camelContext shutdown, is any way to exit the Java main() method?

2013-07-23 Thread SyedBhai
Hello Claus,
  As per your instruction I removed all the statements that force the
shutdown of camelcontext.
  I let the camel take its time and shutdown gracefully.
  To my surprise even though the default timeout is 300 secs I gave the
application about ten minutes.  Still it did not shutdown and I had to
forcibly terminate the program by clicking the close button.
  I think this is a bug in camel framework.  I am using camel 2.11.0.
  What is your idea?

Thanks,
Syed.



--
View this message in context: 
http://camel.465427.n5.nabble.com/After-camelContext-shutdown-is-any-way-to-exit-the-Java-main-method-tp5735993p5736152.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel in Openshift

2013-07-23 Thread wcpolicarpio
Hi James,

That would be awesome! I will definitely anticipate your new cartridge.

I saw the hawt.io interface and it looks cool.
(http://macstrac.blogspot.co.uk/2013/06/introducing-apache-camel-based-open.html).

I have a follow-up question. Is it possible to deploy the camel route in a
jboss/tomcat gear and communicate to another gear(e.g. php with a mysql)?

Regards,
Walter



--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-in-Openshift-tp5735877p5736158.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: How to Pause Quartz Componenent

2013-07-23 Thread Christian Müller
I would suggest using camelContext.stopRoute("MainRoute").

Best,
Christian
Am 23.07.2013 11:48 schrieb "Dayakar" :

> Hi,
>
> I am using Quartz Component which run Daily at 20:00  I configured it as
>
> from("quartz://myGroup/myTimerName?cron=0+0+20+1/1+*+?+*").routeid("MainRoute").to("jms:queue:outBoundQueue")
>
> I need to pause the Route for few Days
>
> Iam using camelContext.suspendRoute("MainRoute");
>
> But still Quartz is firing .
>
> How can i pause Quartz Component
>
> Thanks in Advance
>
> Regards,
> Dayakar
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/How-to-Pause-Quartz-Componenent-tp5736101.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Camel routing issue

2013-07-23 Thread Christian Müller
It's not really so difficult to find an example, if you spend only a few
minutes:
https://git-wip-us.apache.org/repos/asf?p=camel.git;a=blob;f=components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsProducerWithJMSHeaderTest.java;h=52b430b17a7ffc0ca977864ea8c6238050f90a57;hb=HEAD

Best,
Christian
-

Software Integration Specialist

Apache Camel committer: https://camel.apache.org/team
V.P. Apache Camel: https://www.apache.org/foundation/
Apache Member: https://www.apache.org/foundation/members.html

https://www.linkedin.com/pub/christian-mueller/11/551/642


Re: After camelContext shutdown, is any way to exit the Java main() method?

2013-07-23 Thread Christian Posta
Do you want to post your complete main function?
As you've posted it, I cannot reproduce...


On Tue, Jul 23, 2013 at 2:39 PM, SyedBhai wrote:

> Hello Claus,
>   As per your instruction I removed all the statements that force the
> shutdown of camelcontext.
>   I let the camel take its time and shutdown gracefully.
>   To my surprise even though the default timeout is 300 secs I gave the
> application about ten minutes.  Still it did not shutdown and I had to
> forcibly terminate the program by clicking the close button.
>   I think this is a bug in camel framework.  I am using camel 2.11.0.
>   What is your idea?
>
> Thanks,
> Syed.
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/After-camelContext-shutdown-is-any-way-to-exit-the-Java-main-method-tp5735993p5736152.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
*Christian Posta*
http://www.christianposta.com/blog
twitter: @christianposta


Re: MINA and Buffering

2013-07-23 Thread Christian Posta
Is it something that happens consistently? Or randomly?
Maybe you can post your route and I can take a look.


On Tue, Jul 23, 2013 at 12:40 PM, Ephemeris Lappis <
ephemeris.lap...@gmail.com> wrote:

> Hello.
>
> After few tests with MINA using TCP, I've observed that MINA or Camel seem
> to put a lot of data in a buffer. In some cases with the sync option set to
> false, injecting big flows of data to my TCP server, thousands of messages
> seem to be processed many minutes late. All seem ok at the end, without any
> altered or lost data.
>
> I've been looking Camel and MINA documentations to find some explanation
> and
> a posible way to control this buffering feature, but nothing.
>
> Any idea ?
>
> Thanks for your help.
>
> Regards.
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/MINA-and-Buffering-tp5736148.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
*Christian Posta*
http://www.christianposta.com/blog
twitter: @christianposta


Re: After camelContext shutdown, is any way to exit the Java main() method?

2013-07-23 Thread SyedBhai
public static void main(String str[]) {
try {
CamelContext cc = new DefaultCamelContext();
cc.addRoutes(new RouteBuilder() {
public void configure() {
from("direct:start1").
   
to("cxf://http://localhost:8080/JAXWS1/MyInterfaceImpl?serviceClass=com.syed.MyInterface&serviceName={http://syed.com/}MyInterfaceImplService&portName={http://syed.com/}MyInterfaceImplPort";);
 
// 
}
});

cc.start();
ProducerTemplate t = cc.createProducerTemplate();
int annsal = t.requestBody("direct:start1", 1,
Integer.class);
System.out.println("annsal:" + annsal);
//cc.getShutdownStrategy().setTimeUnit(TimeUnit.SECONDS);
//cc.getShutdownStrategy().setTimeout(1);
t.stop();
cc.stop();
//cc.getShutdownStrategy().setShutdownNowOnTimeout(true);
//Thread.sleep(3000);
} catch (Exception i) {
i.printStackTrace();
}
}



--
View this message in context: 
http://camel.465427.n5.nabble.com/After-camelContext-shutdown-is-any-way-to-exit-the-Java-main-method-tp5735993p5736172.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel in Openshift

2013-07-23 Thread James Strachan
On 23 July 2013 20:13, wcpolicarpio  wrote:
> Hi James,
>
> That would be awesome! I will definitely anticipate your new cartridge.

Cool, I'll reply to this thread when I've got a blog on how to get started.


> I saw the hawt.io interface and it looks cool.

Thanks!


> (http://macstrac.blogspot.co.uk/2013/06/introducing-apache-camel-based-open.html).
>
> I have a follow-up question. Is it possible to deploy the camel route in a
> jboss/tomcat gear and communicate to another gear(e.g. php with a mysql)?

Yes.

On OpenShift each 'gear' is a separate virtual computer (or unix
lightweight container - LxC) on some hardware somewhere. An
'application' is zero to many gears (depending on auto-scaling or
manual-scaling).

The easiest way to communicate between gears is to use HTTP; since
each application gets its own domain name (which abstracts the
auto-scaling & HTTP load balancing underneath), so any gear/app can
talk to any other gear/app via https://appname-username.rhcloud.com/
for example if using OpenShift Online.

In Camel terms there are a few different endpoints which under the
covers use HTTP (e.g. http, http4, netty-http, jetty, cxf, restlet
etc)
http://camel.apache.org/components.html

For non-HTTP communication (e.g. messaging), we're working on nicer
ways to perform inter-gear communication in the Fuse cartridge & with
the OpenShift team...

--
James
---
Red Hat

Email: jstra...@redhat.com
Web: http://fusesource.com
Twitter: jstrachan, fusenews
Blog: http://macstrac.blogspot.com/

Open Source Integration


Re: MINA and Buffering

2013-07-23 Thread Ephemeris Lappis
Hello.

It seems to do it always.

Here is the part of the blueprint. The test just takes received data and
puts them into a map. In the future project, the map will be a more
realistic external OSGi service that will store, process and manage big
counts of rows (about 10 millions rows)... In my tests, a simple log
produces the same strange buffering, but with the additional cost of file
writing, that in our case changes the performance evaluation...



Thanks for your help.



--
View this message in context: 
http://camel.465427.n5.nabble.com/MINA-and-Buffering-tp5736148p5736174.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Camel File Polling Exception

2013-07-23 Thread Jothi
When I read several files from a directory using the file component, should
any exception occur, I can see in the log that Camel tries to read the files
multiple times and constantly writes the exception to the log and eventually
run into a OutOfMemory problem. How to instruct Camel to stop reading the
file in case of an exception and avoid trying it multiple times? I have an
OnException block defined in my route, but that does not seem to take effect
in my case.

Regards,
Joe



--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-File-Polling-Exception-tp5736155.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: No Consumer available Exception

2013-07-23 Thread Jothi
What even confuses me is that I have another route that looks more or less
the same, the only difference being a couple of more choice blocks. That
route works perfectly fine. Spent about 3 hours trying to analyze the
problem but fruitless. I'm calling it a day! Will work on it with a fresh
mind tomorrow!



--
View this message in context: 
http://camel.465427.n5.nabble.com/No-Consumer-available-Exception-tp5736133p5736150.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: No Consumer available Exception

2013-07-23 Thread Jothi
Seriously, I do not understand what is happening with this particular route!
I added the startup order and it did not help either. Baffled now!



--
View this message in context: 
http://camel.465427.n5.nabble.com/No-Consumer-available-Exception-tp5736133p5736146.html
Sent from the Camel - Users mailing list archive at Nabble.com.