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.Outbox will receive a new overload:
public static RebusConfigurer Outbox(this RebusConfigurer configurer, Action<StandardConfigurer<IOutboxStorage>> configure, OutboxOptions options)
This options parameter will be non-nullable.
The existing SqlServerOutboxConfigurationExtensions.Outbox method will call the new overload with default options. The implementation will move to the new overload.
The OutboxForwarder constructor will also receive an overload that accepts int forwarderIntervalSeconds. For backwards compatibility, the current constructor will remain and call the new constructor with the default value.
The sqlServerOutboxConfigurationExtensions.Outbox method will call the new OutboxForwarder constructor with the forwarderIntervalSeconds value from the OutboxOptions parameter.
This change will maintain backward compatibility since OutboxForwarder and its constructor are public.
Looking forward to your feedback on this proposal!
Currently, the interval for forwarding messages from the outbox table to the bus transport is hardcoded to 1 second:
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.Outbox
will receive a new overload:options
parameter will be non-nullable.SqlServerOutboxConfigurationExtensions.Outbox
method will call the new overload with default options. The implementation will move to the new overload.The
OutboxForwarder
constructor 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.Outbox
method will call the newOutboxForwarder
constructor with theforwarderIntervalSeconds
value from theOutboxOptions
parameter.This change will maintain backward compatibility since
OutboxForwarder
and its constructor are public.Looking forward to your feedback on this proposal!