You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Gnanaguru S <gn...@wipro.com> on 2013/09/05 19:16:37 UTC

Web based camel route automation

Hello,

I have two file endpoints, I need to route the files using camel routes. 

I have a web UI where I will provide the two file endpoints detail, One I
submit the details It has to create a camel context file. 

1. I am able to achieve this using route builder, but this is in-memory.
When the JVM crashes, I have to re-run the program. Is there any solution
which keep the camel context even when the JVM gets restarted ?

2. It would be helpful, if I can create routes dynamically in spring dsl. 

Any thoughts ?

Thanks
Guru
gnanaguru.com



--
View this message in context: http://camel.465427.n5.nabble.com/Web-based-camel-route-automation-tp5738797.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Web based camel route automation

Posted by AlanFoster <al...@alanfoster.me>.
Hi there,

My suggestion would be to host your camel application in a container such as
Karaf/SMX and run it as a OS service. This will allow you to restart your
container automatically on a failure etc.

It would be advisable to make use of Transactions in your routes and a
persisted transport mechanism to ensure information is not lost on error.

Finally; You can easily avoid the need for a 'dynamic endpoint' if you treat
your application as a service, and take advantage of SOA - Service
Orientated Architecture. As such, you will benefit from having a WS/RS which
exposes the required operation for your use case, and you simply treat your
'file endpoints' as data for this operation. This enables you to become
completely decoupled from Camel and any other architectural choices you may
have chosen.

Alan



--
View this message in context: http://camel.465427.n5.nabble.com/Web-based-camel-route-automation-tp5738797p5738849.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Web based camel route automation

Posted by Andreas Gies <an...@wayofquality.de>.
Hi,

in theory you could configure a generic camel route between two files 
and use a property resolver
to route from file1 to file2. Then its a matter of sticking the 
properties into the right location on disk
and initialize your Camel route accordingly on startup.

This having said, the JVM could still crash between collecting the file 
names and writing the property
file.

As Charles pointed out, a CamelContext is an Object in memory, so it 
comes down to having a somewhat dynamic
initializer.


Bet regards
Andreas


On 09/05/2013 07:27 PM, Charles Moulliard wrote:
> Guru,
>
> A CamelContext is a java object which is not persisted or replicated
> between different JVM. So this is not possible to achieve what you would
> like to do. The question here is not the CamelContext or RouteBuilder
> object but what you transport (= files). They must be persisted (using
> ActiveMQ, RDBMS, NoSQL, ...) to avoid to loose if JVM crashes.
>
> Regards,
>
> Charles
>
>
> On Thu, Sep 5, 2013 at 7:16 PM, Gnanaguru S <gnanaguru.sattanathan@wipro.com
>> wrote:
>> Hello,
>>
>> I have two file endpoints, I need to route the files using camel routes.
>>
>> I have a web UI where I will provide the two file endpoints detail, One I
>> submit the details It has to create a camel context file.
>>
>> 1. I am able to achieve this using route builder, but this is in-memory.
>> When the JVM crashes, I have to re-run the program. Is there any solution
>> which keep the camel context even when the JVM gets restarted ?
>>
>> 2. It would be helpful, if I can create routes dynamically in spring dsl.
>>
>> Any thoughts ?
>>
>> Thanks
>> Guru
>> gnanaguru.com
>>
>>
>>
>> --
>> View this message in context:
>> http://camel.465427.n5.nabble.com/Web-based-camel-route-automation-tp5738797.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>
>


Re: Web based camel route automation

Posted by Charles Moulliard <ch...@gmail.com>.
Guru,

A CamelContext is a java object which is not persisted or replicated
between different JVM. So this is not possible to achieve what you would
like to do. The question here is not the CamelContext or RouteBuilder
object but what you transport (= files). They must be persisted (using
ActiveMQ, RDBMS, NoSQL, ...) to avoid to loose if JVM crashes.

Regards,

Charles


On Thu, Sep 5, 2013 at 7:16 PM, Gnanaguru S <gnanaguru.sattanathan@wipro.com
> wrote:

>
> Hello,
>
> I have two file endpoints, I need to route the files using camel routes.
>
> I have a web UI where I will provide the two file endpoints detail, One I
> submit the details It has to create a camel context file.
>
> 1. I am able to achieve this using route builder, but this is in-memory.
> When the JVM crashes, I have to re-run the program. Is there any solution
> which keep the camel context even when the JVM gets restarted ?
>
> 2. It would be helpful, if I can create routes dynamically in spring dsl.
>
> Any thoughts ?
>
> Thanks
> Guru
> gnanaguru.com
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Web-based-camel-route-automation-tp5738797.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Charles Moulliard
Apache Committer / Architect @RedHat
Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com

Re: Web based camel route automation

Posted by Andreas Gies <an...@wayofquality.de>.
I don't want to be nagging, but personally I wouldn't go down the route 
(hmm...nice play of words) of
creating routes dynamically from the application. Personally I would 
stick to having the route in my
source code and therefore tagged and released and tested etc.

Generating the config can only break so much ...

In other words, leave the structure untouched, but keep the endpoints 
flexible. For example, what if
you wanted to add a wiretap later on for some kind of auditing ?

In one of my applications I use a similar pattern and have the endpoints 
flexible and reconfigurable via JMS
control messages.

My 2ct
Andreas

On 09/06/2013 09:48 AM, Gnanaguru S wrote:
> Thanks for the clarification Charles & Andreas, I understand. I hope there
> is a roadmap for this in Camel 3.0 .
>
> Claus, This is the best available solution as of now, which I consider using
> it.
>
> Cheers,
> Guru
> gnanaguru.com
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Web-based-camel-route-automation-tp5738797p5738829.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Web based camel route automation

Posted by Gnanaguru S <gn...@wipro.com>.
Thanks for the clarification Charles & Andreas, I understand. I hope there
is a roadmap for this in Camel 3.0 . 

Claus, This is the best available solution as of now, which I consider using
it. 

Cheers, 
Guru
gnanaguru.com



--
View this message in context: http://camel.465427.n5.nabble.com/Web-based-camel-route-automation-tp5738797p5738829.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Web based camel route automation

Posted by Claus Ibsen <cl...@gmail.com>.
Ad 2)
spring dsl is just a xml file so you can write that to disk. And then
on restart you can load the routes from the xml file(s).

See also
http://camel.apache.org/loading-routes-from-xml-files.html

On Thu, Sep 5, 2013 at 7:16 PM, Gnanaguru S
<gn...@wipro.com> wrote:
>
> Hello,
>
> I have two file endpoints, I need to route the files using camel routes.
>
> I have a web UI where I will provide the two file endpoints detail, One I
> submit the details It has to create a camel context file.
>
> 1. I am able to achieve this using route builder, but this is in-memory.
> When the JVM crashes, I have to re-run the program. Is there any solution
> which keep the camel context even when the JVM gets restarted ?
>
> 2. It would be helpful, if I can create routes dynamically in spring dsl.
>
> Any thoughts ?
>
> Thanks
> Guru
> gnanaguru.com
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Web-based-camel-route-automation-tp5738797.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



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