You can try with pollEnrich as it will consume from an endpoint.

Also poll enrich supports a timeout if the response is not arriving
after X time.

Also you can also use a processor / bean and write some code that
waits for the message from MQTT and then adds that as the response on
the Camel Message

On Mon, Aug 12, 2019 at 11:12 AM Michael Zaugg <[email protected]> wrote:
>
>
> Hi
>
> I would like to implement a request/reply pattern for MQTT 3.1.1, which
> does not support InOut exchange pattern. I have a constant topic for the
> request and a constant topic for the response as follows:
>
> // ROUTE DEFINITION START
>
> rest()
>   .routeId("request")
>   .post("path")
>   .to("mqtt:requestTopic")
> // wait for reply on another route (aggregate?, enrich?)
>   .endRest
>
> from("mqtt:responseTopic")
> .to("notify routeId request")
>
> // ROUTE DEFINITION END
>
> neither aggregate() nor enrich() are blocking. Therefore the rest call
> terminates before the response arrives.
>
> Any advice would be highly appreciated



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

Reply via email to