bsergean opened a new issue #8584:
URL: https://github.com/apache/pulsar/issues/8584


   **Is your enhancement request related to a problem? Please describe.**
   If a client need to publish to 2 different topics, it will take 2 tcp 
connections between the client and the broker. 3 topics, 3 tcp connections 
etc... if ssl is enabled this is more costly.
   
   **Describe the solution you'd like**
   
   It would be very handy to be able to specify all the url info in the 
websocket message instead. There are multiple websocket apis that do that, like 
[wamp](https://wamp-proto.org/), [wamp publish 
doc](https://wamp-proto.org/_static/gen/wamp_latest.html#publish-0) or 
[cobra](https://machinezone.github.io/cobra/api/). I'm trying to look at the 
[pusher 
api](https://pusher.com/docs/channels/library_auth_reference/pusher-websockets-protocol)
 but cannot find the details, however it looks possible to make multiple 
subscriptions with a single client.
   
   For publishing, instead of doing this:
   
   url: 
*/ws/v2/producer/persistent/:tenant/:namespace/:topic?param1=too&param2=bar
   ```
   {
     "payload": "SGVsbG8gV29ybGQ=",
     "properties": {"key1": "value1", "key2": "value2"},
     "context": "1"
   }
   ```
   
   Do this:
   
   url: */ws/v2/producer/persistent/:tenant/:namespace/:topic*
   ```
   {
     "payload": "SGVsbG8gV29ybGQ=",
     "properties": {"key1": "value1", "key2": "value2"},
     "context": "1",
     ---------- Extra args ---------
     "action": "producer",
     "persistence": true,
     "tenant": "a tenant",
     "namespace": "a namespace",
     "topic": "a topic"
     "params": {
        "param1": "foo",
        "param2": "bar"
     }
   }
   ```
   
   **Describe alternatives you've considered**
   Writing a proxy broker that does this ?
   
   **Additional context**
   If a client needs to publish to 10 topics, or 50, it will need to create 10, 
50 tcp connections to the broker which is not scalable.
   
   Thanks !


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to