You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by mikes300 <mi...@yahoo.com> on 2015/03/16 17:33:21 UTC

Java DSL kick-starting routes, is this possible yet?

I can kick-start a route (for example by a file or message/q or timer input)
automatically in Spring and read in a couple posts that doing this via a
pure Java DSL implementation was possible but still find no evidence of it.

Is this possible yet does anyone know?  Or if anyone has gotten something
like that actually working without using Spring?

Thanks!



--
View this message in context: http://camel.465427.n5.nabble.com/Java-DSL-kick-starting-routes-is-this-possible-yet-tp5764227.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Java DSL kick-starting routes, is this possible yet?

Posted by mikes300 <mi...@yahoo.com>.
Actually Yogesh, 
I may have just figured out my own answer here, and I have been fighting
this for months.  I was operating under the assumption that I should be
stopping the route.  And in all my tests I always stopped the route. 
Figuring that if I was creating the object, i needed to take care of it,
stop the route, etc.  But apparently not.  Simply by starting it, letting it
run, it will eat whatever messages you send to it (a queue is the input
endpoint), each as a separate route path.  And I can envision creating
something that initializes all these route instances at startup.  That make
sense?

I hope so, this really may be a breakthrough for me!



--
View this message in context: http://camel.465427.n5.nabble.com/Java-DSL-kick-starting-routes-is-this-possible-yet-tp5764227p5764377.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Java DSL kick-starting routes, is this possible yet?

Posted by yogu13 <yo...@gmail.com>.
Hello Mike,

>From what i understand you need a dynamic jms message consumer. You can
achieve this by using Java DSL using the code fragments shown @
http://camel.apache.org/walk-through-an-example.html

I am hoping there is a event which will help u in creation of this endpoint
dynamically.

Hope this helps!

-Yogesh

On Wed, Mar 18, 2015 at 1:40 AM, mikes300 [via Camel] <
ml-node+s465427n5764299h98@n5.nabble.com> wrote:

> Thanks Yogesh.....Well, sorta helps.  The problem is that I have an
> application running on Wildfly, not using Spring, and while i can create
> the context & run a route like the example shows, i have to provide the
> inputs to the queue programatically, as the route isn't just sitting there
> waiting for the messages to show up in the queue and pick them up & route
> them as they show up.
>
> I have tried a contextloaderlistener but best I could do was it ran the
> route as soon as the application context started up (upon server startup
> for example), but it ran once & done.  I need it to listen for
> files/messages to come in as a trigger.
>
> That make sense?
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://camel.465427.n5.nabble.com/Java-DSL-kick-starting-routes-is-this-possible-yet-tp5764227p5764299.html
>  To unsubscribe from Java DSL kick-starting routes, is this possible yet?, click
> here
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5764227&code=eW9ndTEzQGdtYWlsLmNvbXw1NzY0MjI3fC04ODQzODQxMjM=>
> .
> NAML
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://camel.465427.n5.nabble.com/Java-DSL-kick-starting-routes-is-this-possible-yet-tp5764227p5764306.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Java DSL kick-starting routes, is this possible yet?

Posted by mikes300 <mi...@yahoo.com>.
Thanks Yogesh.....Well, sorta helps.  The problem is that I have an
application running on Wildfly, not using Spring, and while i can create the
context & run a route like the example shows, i have to provide the inputs
to the queue programatically, as the route isn't just sitting there waiting
for the messages to show up in the queue and pick them up & route them as
they show up.

I have tried a contextloaderlistener but best I could do was it ran the
route as soon as the application context started up (upon server startup for
example), but it ran once & done.  I need it to listen for files/messages to
come in as a trigger.

That make sense?



--
View this message in context: http://camel.465427.n5.nabble.com/Java-DSL-kick-starting-routes-is-this-possible-yet-tp5764227p5764299.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Java DSL kick-starting routes, is this possible yet?

Posted by yogu13 <yo...@gmail.com>.
https://git-wip-us.apache.org/repos/asf?p=camel.git;a=blob;f=examples/camel-example-jms-file/src/main/java/org/apache/camel/example/jmstofile/CamelJmsToFileExample.java;h=bf0c708d9a67f7bc5c7a6e2f1e17a90ca7821c01;hb=HEAD

Hope this helps!

Regards,
-Yogesh



--
View this message in context: http://camel.465427.n5.nabble.com/Java-DSL-kick-starting-routes-is-this-possible-yet-tp5764227p5764242.html
Sent from the Camel - Users mailing list archive at Nabble.com.