Thanks for your suggestions!

I unfortunately need a correlation id, which I can't set up in
pollEnrich(...). So I think I have to use the 2nd approach.


On 12.08.19 11:56, Claus Ibsen wrote:
> 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
> 
> 
> 

-- 
Michael Zaugg
Softwareingenieur

Puzzle ITC GmbH
www.puzzle.ch

Telefon +41 31 370 22 00
Direkt  +41 31 370 22 15
Mobile  +41 79 289 65 88
Fax     +41 31 370 22 01

Werfen Sie einen Blick in unseren Blog:
<http://www.puzzle.ch/blog>

Reply via email to