You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by labo <jo...@larbig.net> on 2017/07/03 15:16:05 UTC
How can I start more than one Camel Context in Spring Boot ?
Hello,
I want to start more than one camel context in a spring boot application.
I declare two contexts like
@ContextName("multi-one")
class MultiOneCamelContext extends DefaultCamelContext {
@PostConstruct
void customize() {
SimpleRegistry reg = new SimpleRegistry();
PropertiesComponent pc = new PropertiesComponent();
and create the routes like
@Component
@ContextName("multi-one")
public class MultiOneRoute extends RouteBuilder{
@Override
public void configure() throws Exception {
but my routes are always assigned to context camel-1
Thank you
--
View this message in context: http://camel.465427.n5.nabble.com/How-can-I-start-more-than-one-Camel-Context-in-Spring-Boot-tp5805707.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: How can I start more than one Camel Context in Spring Boot ?
Posted by Claus Ibsen <cl...@gmail.com>.
You can in spring boot then create your camel context's manually and
then add the route builders to those camel contexts also manually.
Then dont use @Component or @ContextName on the RouteBuilder classes.
On Sun, Jul 9, 2017 at 9:35 PM, labo <jo...@larbig.net> wrote:
> We have a huge amount of integration routes and a migration to spring boot
> with one camel root per app would end with hundreds of virtual machines.
> Therefore I think about spring boot apps with functional grouped routes. I
> know that I can start / stop routes with jolokia but when I split a route
> and connect them with direct endpoints I have to start / stop the "main"
> route and all subroutes by myself. Starting the whole (single) context would
> stop all routes which does not fulfil the requirements. A spring boot app
> with multiple contexts would....
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/How-can-I-start-more-than-one-Camel-Context-in-Spring-Boot-tp5805707p5806668.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
--
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2
Re: How can I start more than one Camel Context in Spring Boot ?
Posted by labo <jo...@larbig.net>.
We have a huge amount of integration routes and a migration to spring boot
with one camel root per app would end with hundreds of virtual machines.
Therefore I think about spring boot apps with functional grouped routes. I
know that I can start / stop routes with jolokia but when I split a route
and connect them with direct endpoints I have to start / stop the "main"
route and all subroutes by myself. Starting the whole (single) context would
stop all routes which does not fulfil the requirements. A spring boot app
with multiple contexts would....
--
View this message in context: http://camel.465427.n5.nabble.com/How-can-I-start-more-than-one-Camel-Context-in-Spring-Boot-tp5805707p5806668.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: How can I start more than one Camel Context in Spring Boot ?
Posted by Claus Ibsen <cl...@gmail.com>.
I don't recommend doing that.
Keep 1 camel context per spring boot app, to keep it simple. Spring
Boot is not like an app server where you host X apps, its intended for
1 app only.
On Mon, Jul 3, 2017 at 5:16 PM, labo <jo...@larbig.net> wrote:
> Hello,
>
> I want to start more than one camel context in a spring boot application.
>
> I declare two contexts like
>
> @ContextName("multi-one")
> class MultiOneCamelContext extends DefaultCamelContext {
> @PostConstruct
> void customize() {
>
> SimpleRegistry reg = new SimpleRegistry();
> PropertiesComponent pc = new PropertiesComponent();
>
>
> and create the routes like
>
> @Component
> @ContextName("multi-one")
> public class MultiOneRoute extends RouteBuilder{
>
> @Override
> public void configure() throws Exception {
>
>
> but my routes are always assigned to context camel-1
>
> Thank you
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/How-can-I-start-more-than-one-Camel-Context-in-Spring-Boot-tp5805707.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
--
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2