-
Couldn't load subscription status.
- Fork 46
Description
Currently, the interval for forwarding messages from the outbox table to the bus transport is hardcoded to 1 second:
_forwarder = asyncTaskFactory.Create("OutboxForwarder", RunForwarder, intervalSeconds: 1);To make this more flexible for users of the outbox feature, I propose introducing configuration options that will allow the interval to be adjusted. My plan is as follows:
-
A new class,
OutboxOptions, will be introduced. Initially, this class will contain one setting:int ForwarderIntervalSeconds– defaulting to 1, cannot be less than 1 second.
-
The method
SqlServerOutboxConfigurationExtensions.Outboxwill receive a new overload:public static RebusConfigurer Outbox(this RebusConfigurer configurer, Action<StandardConfigurer<IOutboxStorage>> configure, OutboxOptions options)
- This
optionsparameter will be non-nullable. - The existing
SqlServerOutboxConfigurationExtensions.Outboxmethod will call the new overload with default options. The implementation will move to the new overload.
- This
-
The
OutboxForwarderconstructor will also receive an overload that acceptsint forwarderIntervalSeconds. For backwards compatibility, the current constructor will remain and call the new constructor with the default value. -
The
sqlServerOutboxConfigurationExtensions.Outboxmethod will call the newOutboxForwarderconstructor with theforwarderIntervalSecondsvalue from theOutboxOptionsparameter.
This change will maintain backward compatibility since OutboxForwarder and its constructor are public.
Looking forward to your feedback on this proposal!