[GPRO] RE: mqtt-rpc

Residori, Marco Marco_Residori at mentor.com
Tue Feb 6 08:28:26 EST 2018


Hi Gunnar, hi Giovanni,

Implementing the request/response message exchange pattern on top of MQTT is in principle possible.

The following example explains how this could be achieved :

1) Client
- subscribe topic "function-xyz/response/<id>"          //note: <id> is a client unique ID

2) Server
- subscribe topic "function-xyz/request/+"          //note: "+" is a wildcard

3) Client
- publish topic "function-xyz/request/<id>"  payload  <input parameter>       

4) Server
- receive notification "function-xyz/request/<id>" payload <input parameter>
- retrieve <id> from string
- process function-xyz(<input parameter>) 
- publish topic "function-xyz/response/<id> " payload "<response>"

5) Client
- receive notification "function-xyz/response/<id>" payload "<response>"

Best regards,

Marco


Mentor A Siemens Business

Marco Residori, Manager Automotive Software Platform, Mentor Embedded
Mentor Graphics Development (Deutschland) GmbH, Peterzeller Strasse 8, 78048 Villingen-Schwenningen, Germany
Marco_Residori at mentor.com | office: +49(7721)4060-483 | cell: +49(170)6352970

http://www.mentor.com

Mentor Graphics Development (Deutschland) GmbH
Geschaeftsfuehrung: Daniel Trebes, Hanns Windele

Handelsregister: Amtsgericht Freiburg i.Br., HRB 705237
Sitz der Gesellschaft: Peterzeller Strasse 8, 78048 Villingen-Schwenningen
USt-Id Nummer: DE268786819
	
Confidentiality Notice: This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message.

> -----Original Message-----
> From: Gunnar Andersson [mailto:gandersson at genivi.org]
> Sent: Dienstag, 6. Februar 2018 12:35
> To: Residori, Marco
> Cc: Vergine, Giovanni Davide (G.)
> Subject: Re: mqtt-rpc
> 
> On Tue, 2018-02-06 at 11:15 +0000, Residori, Marco wrote:
> > Hi Gunnar, hi Giovanni,
> >
> > I thought this may interest you:
> > https://www.npmjs.com/package/mqtt-rpc
> 
> Cool, so someone has considered this before.  Anything is possible, but the
> question is if it's a good idea.  :-)   Worth looking at a bit more anyway.
> 
> Why not send to the mailing list also?  It should be interesting for others to
> see what we are discussing...
> 
> - Gunnar
> 
> 
> >
> > Best regards,
> >
> > Marco
> >
> 
> 



More information about the genivi-projects mailing list