Consider a situation where our requirement is to listen ActiveMQ Topics and
details of those Topics suppose to be evaluate on base of configuration and
database keeps changing.

Use Case:
1. A initial route start and call External config files and Database to
evaluate topics names.

2. Add the camel consumer routes for above Topic now where application
context already started.

I tried to use pollEnrich but it only pick one message and end the route

        final Main main = new Main();
        main.addRouteBuilder(new MyRoute());
        main.run();

MYRoute:

        from("timer://ipc?repeatCount=1")
        ... *some logic to evaluate topic name* ...
        .setHeader("topic_no",simple("{{env:HOSTNAME}}"))

       .pollEnrich().simple("mqtt:foo?host=tcp://0.0.0.0:1883
        &subscribeTopicNames=${header.topic_no}/status&clientId=ipc")
            .to("log:my?showAll=true&multiline=true");

*** I am not using SpringBoot/Spring so cant use some DI, So looking for
suggestion in JavaDSL.

Reply via email to