streamnative / mop

MQTT on Pulsar implemented using Pulsar Protocol Handler
Apache License 2.0
171 stars 54 forks source link

ping request #662

Open hujie6 opened 2 years ago

hujie6 commented 2 years ago

Is your enhancement request related to a problem? Please describe. Current: when using mqtt proxy, client will send ping request to proxy , then proxy will send this request to broker. when broker receives this ping request , it will return repsonse to proxy, and proxy will write this response to client.

Question: if a client has thusands of topics, proxy will write many ping requests to broker, then proxy will receive many responses. of course ,this client will also receive many ping responses.

Describe the solution you'd like

  1. Is it possible to consider returing ping response to client directly at the proxy node?
  2. or can we deduplicate the ping response on the proxy side to avoid sending many response to the client?
mattisonchao commented 2 years ago

Maybe we can use two mechanisms:

  1. Client <=> Proxy
  2. Proxy <=> Broker
hujie6 commented 2 years ago

Maybe we can use two mechanisms:

  1. Client <=> Proxy
  2. Proxy <=> Broker

Yes, I can not agree more. I think we can return ping response to client directly at proxy node, and we can use timed heartbeat between proxy and broker .