Solclientjs does NOT support message selectors even though documentation for other APIs shows selector support

Problem Description

I am using solclientjs (Solace JavaScript SMF API) in a Node.js application.

I attempted to configure a message selector on a queue consumer, but the selector is ignored by the broker and does not appear in the Solace UI under:

Queue → Consumers → Selector

This indicates that the selector is not being applied at all.

Evidence That solclientjs Does Not Support Selectors

According to a Solace engineer’s response in the Solace Community (Feb 2023):

“The Solace Javascript API does not support Selectors.”
Solace Engineer: amackenzie

The engineer also referred to the API support matrix, confirming that selectors are not supported in the JavaScript API.

Selectors Are Supported in Other Solace APIs

Official Solace documentation for other APIs (Java, C, .NET) states:

“Selectors enable clients to specify which messages they are interested in … Selectors can be set for flows bound to a queue or topic endpoint.”

So selector support exists in other Solace APIs like:

  • JCSMP (Java)

  • C API

  • .NET API

…but not in solclientjs.

What I Need Clarification On

  1. Is message selector support officially not available in solclientjs as of today?

  2. Is there any planned support on the roadmap for the JavaScript API?

  3. Is there any recommended workaround for filtering messages on the broker side (instead of application-level filtering)?

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 :+1:. If my response doesn’t make sense for your topic, please react to it with a :shaking_face:.

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:

  1. 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.

  2. 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
  1. 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
  1. 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

Sources: