You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Router <ro...@trash-mail.com> on 2014/10/29 12:51:39 UTC

MQTT Request/Reply

Hi,

I'm trying to figure out the best practice for the communication between a
client and a broker over mqtt. I assume n different clients sending data to
my broker expecting to send a custom response for every received message in
return.

My current understanding is that every client must publish to a topic (e.g.
TargetTopic) configured in my broker. To be able to get any response the
client must also subscribe a topic where the response is queued (e.g.
ResponseTopic).

To be able to identify which response is for a certain client I need to
create a unique response topic for each client (ResponseTopic.client1
;ResponseTopic.client2 etc.) 

*Is that right?*

Due to the fact that I don't know how many clients will be there in future,
I'm afraid to maintain thousands of response topics in my broker. 

*Thus, would it be also possible to send a custom response back to a certain
client without a unique response topic for this client? *

Thanks for your experience ;)



--
View this message in context: http://camel.465427.n5.nabble.com/MQTT-Request-Reply-tp5758293.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: MQTT Request/Reply

Posted by Router <ro...@trash-mail.com>.
Thanks for your answer!

Indeed, my concern to manage all exclusive topics might be a question for
the ActiveMQ mailing list. I was hoping to get around exclusive topics
sending the response directly after the camel route like in this description
(didn't work for me): 

Reference:
http://camel.465427.n5.nabble.com/Understanding-Request-Reply-EIP-in-Spring-DSL-td5662809.html

Response config:

<camelContext xmlns="http://camel.apache.org/schema/spring">
  <route>
    <from uri="cxf:bean:orderEndpoint" />
    <to uri="seda:incomingOrders" />
*    <transform>
      <constant>OK</constant>
    </transform>*
  </route>
</camelContext>



--
View this message in context: http://camel.465427.n5.nabble.com/MQTT-Request-Reply-tp5758293p5758298.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: MQTT Request/Reply

Posted by Henryk Konsek <he...@gmail.com>.
Hi,

> My current understanding is that every client must publish to a topic (e.g.
> TargetTopic) configured in my broker.

Yeah, I believe that exclusive reply topic is the best (only?) option
for MQTT to achieve In/Out communication.

> Due to the fact that I don't know how many clients will be there in future,
> I'm afraid to maintain thousands of response topics in my broker.

This is really a better question for the ActiveMQ mailing list, as
this is broker specific issue. In AMQ for example you can control the
eviction policy [1] of the topics, so you don't have to worry about
leaking topics.

Cheers.

[1] http://activemq.apache.org/delete-inactive-destinations.html

-- 
Henryk Konsek
http://henryk-konsek.blogspot.com