How to Validate Schema for Events Published to Solace Event Broker?

Hi everyone,

I’m currently working with Solace Event Broker and using the Designer to define schemas for the events. While I can define the schema in the Designer, I’m trying to understand how schema validation works at runtime—specifically (I did not find on my own), how can I ensure that the messages published by a Publisher to a queue or topic are actually validated against the defined schema?

Is there a built-in mechanism in Solace Event Broker that validates incoming messages against the schema defined in the Designer? Or do I need to implement validation on the Publisher or Subscriber side?

Any guidance or best practices on how to enforce schema validation in this setup would be greatly appreciated!

Regards,
Swap

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

Let me analyze the information about schema validation in the Solace documentation.

The key points from the documentation are:

  1. Event Portal is a design-time tool and does not enforce schema validation during runtime
  2. PubSub+ event brokers are payload agnostic and do not inspect message payloads
  3. Event Portal exposes APIs that can be used by applications to query and enforce schema validation
  4. Schema validation must be handled at the application level

Here’s the summarized answer:

Schema validation is not performed at runtime by PubSub+ event brokers. The event brokers are payload agnostic and do not inspect message contents, similar to how network routers handle packets. While Event Portal allows you to define and manage schemas, it is a design-time tool and does not enforce runtime validation.

To implement schema validation for messages:

  1. Use Event Portal APIs to retrieve schema definitions
  2. Implement validation logic in your publishing and subscribing applications
  3. Consider using application frameworks or middleware that support schema validation

Relevant documentation:

There is a Schema registry to be released: https://solace.com/blog/introducing-solace-schema-registry-beta/

1 Like

Hi Swapnil,

As of now, we dont have a schema registry and validation available for general access. As Yang Sen said, it’s under beta currently and will be released soon.

If you are interested, you can check out this codelab for trying it out : Introduction to Schema Registry using the Solace Messaging API for Java (JCSMP) and Apicurio Registry

Apart from a product feature support, ideally speaking schema validation should be implemented on both the producer and consumer side to ensure that only message conforming to the appropriate schema are published and consumed from the topic/queue. This would help in avoiding invalid or poison messages from blocking business processes and causing disruptions.

Hope this helps.

Regards

Hari