Skip to content

ARTEMIS-5372: Add JSON-schema validation for broker properties#6484

Draft
lavocatt wants to merge 1 commit into
apache:mainfrom
lavocatt:jsonschema
Draft

ARTEMIS-5372: Add JSON-schema validation for broker properties#6484
lavocatt wants to merge 1 commit into
apache:mainfrom
lavocatt:jsonschema

Conversation

@lavocatt
Copy link
Copy Markdown
Contributor

@lavocatt lavocatt commented Jun 1, 2026

Generates a JSON Schema (Draft 7) describing all valid broker.properties configuration options. Built from multiple sources: Java reflection on ConfigurationImpl, XSD constraints, JavaDoc, source constants, and factory parameter discovery.

Two-phase IR architecture: build graph via reflection, enrich with metadata from extractors, emit schema with $ref extraction.

Supports factory-based polymorphism (Netty/InVM oneOf variants), class-based polymorphism (AMQP connection element subtypes), and hot-reloadable property flagging.

Externalized configuration in META-INF/schema-generator-config.json.

Add optional JSON Schema validation for broker configuration files. When the artemis-jsonschema JAR is on the classpath and validation is enabled via -Dartemis.config.validate-json=true, JSON broker configs are validated against the generated schema before being applied.

JsonSchemaValidator loads the schema from the classpath resource packaged by artemis-jsonschema. Invalid configurations are rejected with detailed error messages.

Generates a JSON Schema (Draft 7) describing all valid broker.properties
configuration options. Built from multiple sources: Java reflection on
ConfigurationImpl, XSD constraints, JavaDoc, source constants, and
factory parameter discovery.

Two-phase IR architecture: build graph via reflection, enrich with
metadata from extractors, emit schema with $ref extraction.

Supports factory-based polymorphism (Netty/InVM oneOf variants),
class-based polymorphism (AMQP connection element subtypes), and
hot-reloadable property flagging.

Externalized configuration in META-INF/schema-generator-config.json.

Add optional JSON Schema validation for broker configuration files.
When the artemis-jsonschema JAR is on the classpath and validation
is enabled via -Dartemis.config.validate-json=true, JSON broker configs
are validated against the generated schema before being applied.

JsonSchemaValidator loads the schema from the classpath resource
packaged by artemis-jsonschema. Invalid configurations are rejected
with detailed error messages.

Co-authored-by: Cursor <cursoragent@cursor.com>
@lavocatt
Copy link
Copy Markdown
Contributor Author

lavocatt commented Jun 1, 2026

We could also filter the schema, only let it remove paths of configs we don't want to expose.

Enforcing this would prevent people from using the broker properties to configure things they shouldn't.
And it would be quite straightforward code wise to add that capability.

There's already some filtering enabled to ignore some kind of objects, this could be generalized with Location filtering.

I.E allowed to configure a NettyAcceptor under acceptors but not under AMQPConnections for instance (made up example).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant