Skip to content

Pulsar: per-consumer / per-producer customization hooks (#3179)#3200

Merged
jeremydmiller merged 1 commit into
mainfrom
feat/pulsar-consumer-producer-hooks-3179
Jun 22, 2026
Merged

Pulsar: per-consumer / per-producer customization hooks (#3179)#3200
jeremydmiller merged 1 commit into
mainfrom
feat/pulsar-consumer-producer-hooks-3179

Conversation

@jeremydmiller

Copy link
Copy Markdown
Member

Part of the Pulsar re-evaluation epic #3176. Fixes #3179.

Adds per-endpoint ConfigureConsumer / ConfigureProducer hooks that run against DotPulsar's IConsumerBuilder / IProducerBuilder immediately before the consumer/producer is created. Previously only the global IPulsarClientBuilder (via UsePulsar) was exposed, so per-endpoint knobs (consumer/producer name, receive-queue size, priority, compression, batching, routing mode, …) weren't reachable. Analogue of Kafka's ConfigureConsumer/ConfigureProducer.

Changes

  • PulsarEndpoint.ConfigureConsumer / ConfigureProducer hooks.
  • PulsarListener applies ConfigureConsumer to the main and retry consumers; PulsarSender applies ConfigureProducer (also covers the listener's internal requeue sender).
  • PulsarListenerConfiguration.ConfigureConsumer(...) / ConfigureProducer(...) and PulsarSubscriberConfiguration.ConfigureProducer(...).

Tests

  • Config unit tests (hooks stored on the endpoint).
  • Integration test: both callbacks run while building the real consumer/producer (set a consumer/producer name) and the customized pair still delivers end-to-end.

Docs

New "Customizing Consumers & Producers" section.

Unblocks #3180 (acknowledgment strategy).

🤖 Generated with Claude Code

Adds per-endpoint ConfigureConsumer / ConfigureProducer hooks that run against DotPulsar's
IConsumerBuilder / IProducerBuilder immediately before the consumer/producer is created — so
users can tune consumer name, receive-queue size, priority, compression, batching, routing mode,
etc. per endpoint (previously only the global IPulsarClientBuilder was exposed). Analogue of
Kafka's ConfigureConsumer/ConfigureProducer.

- PulsarEndpoint.ConfigureConsumer / ConfigureProducer hooks.
- PulsarListener applies ConfigureConsumer to the main and retry consumers; PulsarSender applies
  ConfigureProducer (covers the listener's internal requeue sender too).
- PulsarListenerConfiguration.ConfigureConsumer(...)/ConfigureProducer(...) and
  PulsarSubscriberConfiguration.ConfigureProducer(...).

Tests: config unit tests + integration test proving both callbacks run while building the real
consumer/producer and the customized pair still deliver end to end. Docs updated. Unblocks #3180.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@jeremydmiller
jeremydmiller merged commit 1bfa9fc into main Jun 22, 2026
25 checks passed
This was referenced Jun 23, 2026
This was referenced Jul 9, 2026
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.

Pulsar: per-consumer / per-producer customization hooks

1 participant