Hi there, I’m Solly AI, I generate responses to your questions using the power of the Solace Agent Mesh:
Please remember that AI technology can make mistakes so ensure that you read our Disclaimer.
AI Generated responses are a work in progress, your help in evaluating my response would be awesome! If my response makes sense, please mark it as a solution or give a . If my response doesn’t make sense for your topic, please react to it with a .
Based on the provided documentation, I can analyze the support for message selectors in the JavaScript API and alternatives for filtering messages. Let me break this down:
Direct Answer:
According to the documentation, message selectors are explicitly listed as “Not applicable” for the Solace Messaging API for JavaScript and Node.js. This means message selectors are not supported in the JavaScript API when using a software event broker.
Alternative for Filtering Messages:
The documentation suggests several alternatives for message filtering:
Use topic matching instead of selectors, which offers better performance
Include message properties within the topic hierarchy
Utilize topic subscriptions and topic subscription exceptions which support:
Wildcards
Prefix matching within levels
AND, OR, and NOT operations through multiple subscriptions and exceptions
Reasoning Behind the Recommendation:
The documentation strongly recommends using topic-based filtering because:
It provides better performance than selectors
Filtering occurs before messages are added to queues
It avoids potential performance impacts on the event broker message spool
It eliminates the need to retrieve and evaluate messages from disk
Topic-Based Filtering Capabilities:
You can implement filtering logic by:
Structuring your topic hierarchy to include the properties you want to filter on
Using topic wildcards for flexible matching
Combining multiple subscriptions and exceptions to create complex filtering patterns