20.0.0
20.0.0 (2025-06-11)
Features
- solace-message-client: add support for Angular 20 (030314f)
Code Refactoring
- solace-message-client: remove deprecated API to manually connect and disconnect from the broker (9a5b814), closes #70
BREAKING CHANGES
-
solace-message-client: Updating
@solace-community/angular-solace-message-clientto Angular 20 introduced a breaking change.
To migrate:- Update your application to Angular 20. For detailed migration instructions, refer to Angular's update guide: https://v20.angular.dev/update-guide.
- Remove
@types/events,@types/node, andlongfrom the dependencies in yourpackage.jsonas not required anymore (sincesolclientjsversion10.16.0) - Remove
nodefrom thetypesarray in yourtsconfigas not required anymore (sincesolclientjsversion10.16.0)
-
solace-message-client: Angular Solace Message Client now requires
@scion/toolkitversion1.6.0or higher.
For more information, refer to the changelog of@scion/toolkit: https://github.com/SchweizerischeBundesbahnen/scion-toolkit/blob/master/CHANGELOG_TOOLKIT.md. -
solace-message-client: Angular Solace Message Client now requires
solclientjsversion10.18.0or higher.
For more information, refer to the changelog ofsolclientjs: https://products.solace.com/download/JS_API_RN. -
solace-message-client:
provideSolaceMessageClientnow requires a config. Previously, no config was required if the app connected manually to the broker using the removedconnectmethod. -
solace-message-client: Removed deprecated
connectanddisconnectmethods ofSolaceMessageClient.
Initially, they allowed for a flexible configuration of the message client, which can now be done via a config function or separate environments.To migrate, pass a config to
provideSolaceMessageClient, either as an object literal or via a function. The function can callinjectto get any required dependencies and return the configuration synchronously or asynchronously, for example, to load it over the network.Example for loading config asynchronously:
import {provideSolaceMessageClient} from '@solace-community/angular-solace-message-client'; import {bootstrapApplication} from '@angular/platform-browser'; import {HttpClient, provideHttpClient} from '@angular/common/http'; import {inject} from '@angular/core'; bootstrapApplication(AppComponent, { providers: [ provideHttpClient(), provideSolaceMessageClient(() => inject(HttpClient).get('path/to/config')), ], });
A connection to the broker is established when the
SolaceMessageClientis injected for the first time. To manually connect to a broker, create an environment. Different environments can be used to connect to different brokers.Example for manually connecting to the broker:
import {provideSolaceMessageClient, SolaceMessageClient} from '@solace-community/angular-solace-message-client'; import {createEnvironmentInjector, EnvironmentInjector, inject} from '@angular/core'; // Configure the broker. const environment = createEnvironmentInjector( [provideSolaceMessageClient({url: 'wss://broker-url'})], inject(EnvironmentInjector), ); // Connect to the broker by injecting `SolaceMessageClient`. const messageClient = environment.get(SolaceMessageClient); // Interact with the broker. messageClient.publish('topic', 'message'); // Destroy the environment, disconnecting from the message broker. environment.destroy();