-
Notifications
You must be signed in to change notification settings - Fork 1
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
Support for connecting to multiple brokers in the same application #71
Milestone
Comments
Planned for PI 2024-02. |
danielwiehl
added a commit
that referenced
this issue
May 13, 2024
…ssage brokers An application is not limited to connecting to a single Solace Message Broker. Different environments can be used to connect to different brokers. Example for connecting to two different brokers: ```ts import {createEnvironmentInjector, EnvironmentInjector, inject} from '@angular/core'; import {provideSolaceMessageClient, SolaceMessageClient} from '@solace-community/angular-solace-message-client'; // Configure environment to provide message client for broker 1. const environment1 = createEnvironmentInjector([provideSolaceMessageClient({url: 'broker-1'})], inject(EnvironmentInjector)); // Inject message client. const messageClient1 = environment1.get(SolaceMessageClient); // Publish message to broker 1. messageClient1.publish('topic', 'message for broker 1'); // Configure environment to provide message client for broker 2. const environment2 = createEnvironmentInjector([provideSolaceMessageClient({url: 'broker-2'})], inject(EnvironmentInjector)); // Inject message client. const messageClient2 = environment2.get(SolaceMessageClient); // Publish message to broker 2. messageClient2.publish('topic', 'message for broker 2'); // Destroy environments to destroy provided `SolaceMessageClient` instances. environment1.destroy(); environment2.destroy(); ``` closes #71
danielwiehl
added a commit
that referenced
this issue
May 14, 2024
…ssage brokers An application is not limited to connecting to a single Solace Message Broker. Different environments can be used to connect to different brokers. Example for connecting to two different brokers: ```ts import {createEnvironmentInjector, EnvironmentInjector, inject} from '@angular/core'; import {provideSolaceMessageClient, SolaceMessageClient} from '@solace-community/angular-solace-message-client'; // Configure environment to provide message client for broker 1. const environment1 = createEnvironmentInjector([provideSolaceMessageClient({url: 'broker-1'})], inject(EnvironmentInjector)); // Inject message client. const messageClient1 = environment1.get(SolaceMessageClient); // Publish message to broker 1. messageClient1.publish('topic', 'message for broker 1'); // Configure environment to provide message client for broker 2. const environment2 = createEnvironmentInjector([provideSolaceMessageClient({url: 'broker-2'})], inject(EnvironmentInjector)); // Inject message client. const messageClient2 = environment2.get(SolaceMessageClient); // Publish message to broker 2. messageClient2.publish('topic', 'message for broker 2'); // Destroy environments to destroy provided `SolaceMessageClient` instances. environment1.destroy(); environment2.destroy(); ``` closes #71
danielwiehl
added a commit
that referenced
this issue
May 14, 2024
…ssage brokers An application is not limited to connecting to a single Solace Message Broker. Different environments can be used to connect to different brokers. Example for connecting to two different brokers: ```ts import {createEnvironmentInjector, EnvironmentInjector, inject} from '@angular/core'; import {provideSolaceMessageClient, SolaceMessageClient} from '@solace-community/angular-solace-message-client'; // Configure environment to provide message client for broker 1. const environment1 = createEnvironmentInjector([provideSolaceMessageClient({url: 'broker-1'})], inject(EnvironmentInjector)); // Inject message client. const messageClient1 = environment1.get(SolaceMessageClient); // Publish message to broker 1. messageClient1.publish('topic', 'message for broker 1'); // Configure environment to provide message client for broker 2. const environment2 = createEnvironmentInjector([provideSolaceMessageClient({url: 'broker-2'})], inject(EnvironmentInjector)); // Inject message client. const messageClient2 = environment2.get(SolaceMessageClient); // Publish message to broker 2. messageClient2.publish('topic', 'message for broker 2'); // Destroy environments to destroy provided `SolaceMessageClient` instances. environment1.destroy(); environment2.destroy(); ``` closes #71
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is your feature request related to a problem? Please describe.
The Solace Message Client can only connect to a single broker. It is not possible to have multiple message clients that connect to different brokers.
Describe the solution you'd like
Support for creating a message client instance per broker.
The text was updated successfully, but these errors were encountered: