You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Imran Raza Khan <im...@gmail.com> on 2019/11/19 12:53:30 UTC

Documentation for SupervisingRouteController

I have MQTT route like below

    from("paho:mytopic?brokerUrl=tcp://0.0.0.0:1883&clientId=ipc)
    .routeId("myroute")
    .to("log:my?showAll=true&multiline=true");

it starts only if broker is available and after that if it lost
connectivity with broker it handle it very well and resume.

But my concern is how i can start first time if broker is not available?

I searched on google and got to know  "SupervisingRouteController" might
help in this regard, But no document is available how i can use it.
By some hit and trial i reach this point but what further i can do as no
document available

    final Main main = new Main();
    main.addRouteBuilder(new MyMqttRoute());
    SupervisingRouteController controller =
main.getCamelContexts().get(0).getRouteController().unwrap(SupervisingRouteController.class);
    main.run();

Re: Documentation for SupervisingRouteController

Posted by Tadayoshi Sato <sa...@gmail.com>.
Hi,

It's not documentation but there is an example that tells how to use
Supervising Route Controller. You might find it helpful:
https://github.com/apache/camel/tree/camel-3.0.0-RC3/examples/camel-example-spring-boot-supervising-route-controller

On Tue, Nov 19, 2019 at 10:28 PM Claus Ibsen <cl...@gmail.com> wrote:

> Hi
>
> If you use camel-main then there is a JIRA about making configuring
> this out of the box better
> https://issues.apache.org/jira/browse/CAMEL-13535
>
> For spring-boot there is already an example you can look at.
>
> But yeah we should get this done for camel main, so keep an eye on
> that JIRA ticket
>
> On Tue, Nov 19, 2019 at 1:53 PM Imran Raza Khan <im...@gmail.com>
> wrote:
> >
> > I have MQTT route like below
> >
> >     from("paho:mytopic?brokerUrl=tcp://0.0.0.0:1883&clientId=ipc)
> >     .routeId("myroute")
> >     .to("log:my?showAll=true&multiline=true");
> >
> > it starts only if broker is available and after that if it lost
> > connectivity with broker it handle it very well and resume.
> >
> > But my concern is how i can start first time if broker is not available?
> >
> > I searched on google and got to know  "SupervisingRouteController" might
> > help in this regard, But no document is available how i can use it.
> > By some hit and trial i reach this point but what further i can do as no
> > document available
> >
> >     final Main main = new Main();
> >     main.addRouteBuilder(new MyMqttRoute());
> >     SupervisingRouteController controller =
> >
> main.getCamelContexts().get(0).getRouteController().unwrap(SupervisingRouteController.class);
> >     main.run();
>
>
>
> --
> Claus Ibsen
> -----------------
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2
>


-- 
Tadayoshi Sato

Re: Documentation for SupervisingRouteController

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

If you use camel-main then there is a JIRA about making configuring
this out of the box better
https://issues.apache.org/jira/browse/CAMEL-13535

For spring-boot there is already an example you can look at.

But yeah we should get this done for camel main, so keep an eye on
that JIRA ticket

On Tue, Nov 19, 2019 at 1:53 PM Imran Raza Khan <im...@gmail.com> wrote:
>
> I have MQTT route like below
>
>     from("paho:mytopic?brokerUrl=tcp://0.0.0.0:1883&clientId=ipc)
>     .routeId("myroute")
>     .to("log:my?showAll=true&multiline=true");
>
> it starts only if broker is available and after that if it lost
> connectivity with broker it handle it very well and resume.
>
> But my concern is how i can start first time if broker is not available?
>
> I searched on google and got to know  "SupervisingRouteController" might
> help in this regard, But no document is available how i can use it.
> By some hit and trial i reach this point but what further i can do as no
> document available
>
>     final Main main = new Main();
>     main.addRouteBuilder(new MyMqttRoute());
>     SupervisingRouteController controller =
> main.getCamelContexts().get(0).getRouteController().unwrap(SupervisingRouteController.class);
>     main.run();



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2