Skip to content

Add IHandlerConfiguration interface for compile-time safe Configure(HandlerChain) (#2466)#2491

Merged
jeremydmiller merged 2 commits intomainfrom
feature/2466-ihandler-configuration-interface
Apr 9, 2026
Merged

Add IHandlerConfiguration interface for compile-time safe Configure(HandlerChain) (#2466)#2491
jeremydmiller merged 2 commits intomainfrom
feature/2466-ihandler-configuration-interface

Conversation

@jeremydmiller
Copy link
Copy Markdown
Member

Closes #2466

Summary

  • Introduces IHandlerConfiguration in Wolverine.Configuration with static abstract void Configure(HandlerChain chain) — a C# 12 static abstract interface member
  • Handler types implementing this interface get a compiler error if they misspell Configure or use the wrong parameter type, instead of being silently ignored
  • Updates Chain.applyAttributesAndConfigureMethods to invoke interface implementors first (via GetInterfaceMap), then fall back to convention-based detection for all other types — no double-invocation
  • Convention-based discovery is fully backward compatible — existing handlers without the interface continue to work unchanged
  • Adds documentation with code sample to the middleware guide

Test plan

  • the_configure_method_via_interface_is_found_and_used — verifies the interface path invokes Configure
  • convention_based_configure_still_works — verifies the naming convention still works alongside the interface
  • All existing can_customize_handler_chain_through_Configure_call_on_HandlerType tests still pass
  • dotnet build succeeds with no errors

🤖 Generated with Claude Code

jeremydmiller and others added 2 commits April 9, 2026 17:55
Adds wolverine.saga.id, wolverine.saga.type, wolverine.stream.id, and
wolverine.stream.type Activity tags so operators can query all telemetry
for a specific saga instance or aggregate stream.

- Envelope.WriteTags() now sets wolverine.saga.id from Envelope.SagaId
  (covers existing-saga messages where the header is already populated)
- SetSagaIdFrame and SetSagaIdFromSagaFrame emit wolverine.saga.id and
  wolverine.saga.type via code-gen, covering both new and existing sagas
  where the ID is resolved from the command message
- TagAggregateOtelFrame is injected into AggregateHandling.Apply() to
  emit wolverine.stream.id and wolverine.stream.type for every aggregate
  handler workflow

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…andlerChain) convention (#2466)

Introduces `IHandlerConfiguration` with `static abstract void Configure(HandlerChain chain)`,
giving handler types a compile-time-validated alternative to the naming convention. Misspellings
or wrong signatures now produce compiler errors instead of being silently ignored. The convention-based
approach continues to work unchanged for backward compatibility.

Co-Authored-By: Claude Sonnet 4.6 <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.

Add static interface for Configure(HandlerChain) convention

1 participant