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 via email to