Documentation for SupervisingRouteController

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Documentation for SupervisingRouteController

imranrazakhan
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();
Reply | Threaded
Open this post in threaded view
|

Re: Documentation for SupervisingRouteController

Claus Ibsen-2
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 <[hidden email]> 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
Reply | Threaded
Open this post in threaded view
|

Re: Documentation for SupervisingRouteController

tadayosi
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 <[hidden email]> 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 <[hidden email]>
> 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