Skip to content

Add ExternallyOwned() for Kafka topics to skip auto-provisioning and teardown#3062

Merged
jeremydmiller merged 1 commit into
JasperFx:mainfrom
lyall-sc:support-externally-owned-topic
Jun 10, 2026
Merged

Add ExternallyOwned() for Kafka topics to skip auto-provisioning and teardown#3062
jeremydmiller merged 1 commit into
JasperFx:mainfrom
lyall-sc:support-externally-owned-topic

Conversation

@lyall-sc

Copy link
Copy Markdown
Contributor

Some topics on a Kafka cluster may be owned by an external system where the calling identity only holds consume/produce ACLs, not CreateTopics or DeleteTopics. With AutoProvision() enabled, Wolverine would try to create every declared topic at startup (failing with Authorization failed) and delete them on resources teardown.

This change adds an ExternallyOwned() option, exposed on the listener, subscriber, and topic-group listener configurations, that marks a topic's lifecycle as external. An IsExternallyOwned topic is skipped in SetupAsync, TeardownAsync, and InitializeAsync across KafkaTopic and KafkaTopicGroup, so it is never created at startup nor deleted at teardown.

The behavior is covered in externally_owned_topics_are_skipped and documented with an "Externally-Owned Topics" section in the Kafka transport guide.

…teardown

Some topics on a Kafka cluster are owned by an external system where the calling identity only holds consume/produce ACLs, not CreateTopics or DeleteTopics. With AutoProvision() enabled, Wolverine would try to create every declared topic at startup (failing with Authorization failed) and delete them on resources teardown.

Add an ExternallyOwned() option, exposed on the listener, subscriber, and topic-group listener configurations, that marks a topic's lifecycle as external. An IsExternallyOwned topic is skipped in SetupAsync, TeardownAsync, and InitializeAsync across KafkaTopic and KafkaTopicGroup, so it is never created at startup nor deleted at teardown.

Cover the behavior in externally_owned_topics_are_skipped and document it with an "Externally-Owned Topics" section in the Kafka transport guide.
@jeremydmiller jeremydmiller merged commit 2c0d511 into JasperFx:main Jun 10, 2026
23 checks passed
jeremydmiller added a commit that referenced this pull request Jun 10, 2026
…lowup

docs(kafka): polish ExternallyOwned() section (follow-up to #3062)
Ferchke7 pushed a commit to Ferchke7/wolverine that referenced this pull request Jun 10, 2026
Three small follow-ups to the docs added in JasperFx#3062:

- Add the version Badge (6.7) on the section heading, matching the
  convention every other recent section in this file uses.
- Cross-reference the "Topic Creation Options" section just above so
  Specification() / TopicCreation() / ExternallyOwned() are positioned
  as the same-spectrum APIs they are.
- Document that 'dotnet run -- resources check' is NOT skipped for
  externally-owned topics — CheckAsync sends a Produce probe to verify
  each topic, which has an observable consequence users should know
  before running the command against a host with externally-owned
  endpoints.

No API changes.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Ferchke7 pushed a commit to Ferchke7/wolverine that referenced this pull request Jun 10, 2026
Wolverine could already mark a Kafka topic as ExternallyOwned() (JasperFxGH-3062) so
that the topic is never declared at startup nor deleted on teardown. This adds
the same escape hatch to the RabbitMQ transport for queues and exchanges that
are owned by another system, where the connecting identity lacks the
configure/delete permissions to create or remove the resource.

When an endpoint is marked ExternallyOwned():
- it is never declared at startup, even with AutoProvision() on
- it is never deleted during a resources teardown
- its bindings are neither set up nor torn down

Exposed as ExternallyOwned() on RabbitMqListenerConfiguration,
RabbitMqSubscriberConfiguration, and RabbitMqExchangeConfiguration, and as an
IsExternallyOwned setter on RabbitMqExchangeConfigurationExpression (alongside
the existing DeclarePassive setter).

Also fixes a teardown asymmetry surfaced by this work: a DeclarePassive
exchange only verifies existence at startup (it never creates the exchange), so
it is now left alone on teardown rather than being deleted.

Adds externally_owned_rabbit_topology_is_skipped with broker-side existence
checks covering queue/exchange setup-skip, owned-alongside-external, and the
listener/exchange/DeclarePassive teardown paths. Documents the feature in the
RabbitMQ object-management guide, including the DeclarePassive distinction.

Closes JasperFx#3064

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

2 participants