Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce Configurable Interval for Outbox Forwarder #111

Open
jeroenkoknl opened this issue Oct 3, 2024 · 0 comments
Open

Introduce Configurable Interval for Outbox Forwarder #111

jeroenkoknl opened this issue Oct 3, 2024 · 0 comments

Comments

@jeroenkoknl
Copy link
Contributor

jeroenkoknl commented Oct 3, 2024

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.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!

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

No branches or pull requests

1 participant