-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple connections #145
Comments
Yes, you could use a factory for creating the service. Adapting the code to support multiple connections/clients In the current service architecture would lead to many questions like which subscription should be made in which client and which publication publishes to which client and so on. Could you elaborate how you want to use multiple connections to different brokers? |
Thank you for your answer. I will try your solution! Because we have a high availability setup for our platform, we stumble across certain issues where it comes down to losing messages if we only have one WebSocket open in one zone. |
I don‘t think exposing high availability nodes to endpoints is a good idea, except you really don’t care about duplicate messages. For your special requirements I actually would suggest changing the code so you can add multiple connections and subscribe and publish to all at once. I think this should not be incorporated in the master of this project, but it might be a solution for your issue. |
This would be very cool, I have also the requirement to connect to multiple brokers. Regards |
@sclausen is there any example that we could to this repo, for example in the examples folder? |
An example for usage is here or what do you mean? |
Sorry the comment was related to the one above. Illustrating the factory patttern. |
I posted a link to stackoverflow on an example how to use the factory pattern in the comment above |
yes I know, and it works, I was just suggesting for upcoming users of your library, it might be good to document it inside the repo. So they do not end searching in the issue list (as what I've been doing). From my opinion it's overkill to implement this feature into the source of your library. The dependency injection is good enough, but should be documented.. |
Probably we can use https://www.emqx.io/mqtt/public-mqtt5-broker to avoid installing local broker for testing |
I'm submitting a...
Current behavior
Is it currently possible to connect to multiple brokers in the same Angular app?
Everytime I open a 2nd connection with a different hostname or port or query params, the old websocket gets closed.
Expected behavior
Connecting to multiple websocket brokers.
Environment
The text was updated successfully, but these errors were encountered: