You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
IncludeHandlers does not filter stream request handlers #52
While working on a project that uses DispatchR with a limited handler set, I noticed an issue with handler registration.
In this project, one service only needs to register two handlers, so DispatchR is configured with IncludeHandlers, and I expected DispatchR to register only those handlers from the assembly. However, stream request handlers from the same assembly were still being registered.
After checking the registration logic, it looks like IncludeHandlers / ExcludeHandlers are only applied to concrete IRequestHandler<,> implementations. Concrete IStreamRequestHandler<,> implementations are included through otherHandlerTypes, so they bypass IsHandlerIncluded(...).
This causes applications that intentionally register only a small subset of handlers to pull unrelated stream handlers into DI. In my case, the service started requiring dependencies for handlers it does not use.
The expected behavior is that IncludeHandlers / ExcludeHandlers should apply to both:
concrete IRequestHandler<,>
concrete IStreamRequestHandler<,>
Pipeline and notification discovery should remain unchanged.
Activity
hasanxdev commentedon May 29, 2026
Thanks to contributing.
hasanxdev commentedon May 29, 2026
Its released on
v2.3.0