rebus-org / Rebus.SqlServer

:bus: Microsoft SQL Server transport and persistence for Rebus
https://mookid.dk/category/rebus
Other
44 stars 45 forks source link

Leased SQL Server Message Processing #14

Closed MrMDavidson closed 7 years ago

MrMDavidson commented 7 years ago

Introduces a new SQL Server transport - SqlServerLeaseTransport - which does not maintain any active connections to the database (or transactions) during message processing. Instead for sending of messages the messages are queued in memory until the ITransactionContext is committed at which stage the entire batch of messages is sent to the server. For receiving messages are leased, and optionally, automatically renewed. This prevents issues with long running message handlers causing transaction timeouts.

See https://github.com/rebus-org/Rebus.SqlServer/issues/13 for some background.


Rebus is MIT-licensed. The code submitted in this pull request needs to carry the MIT license too. By leaving this text in, I hereby acknowledge that the code submitted in the pull request has the MIT license and can be merged with the Rebus codebase.

MrMDavidson commented 7 years ago

Fixed the build - my apologies, @mookid8000

mookid8000 commented 7 years ago

I have added contract tests for the lease-based transport, similar to how it's done for "the original SQL transport".

It resulted in numerous

System.Data.SqlClient.SqlException : Invalid column name 'leaseduntil'.
Invalid column name 'leaseduntil'.
Invalid column name 'leaseduntil'.

because the schema does not have the leaseduntil column.... did you have a plan for the schema generation?

MrMDavidson commented 7 years ago

You should be able to call EnsureTable on the lease bases transport and it'll generate them. There's an overridable method (can't remember the name, not at my PC) that the lease transport implements to provide the leases until column.


From: Mogens Heller Grabe notifications@github.com Sent: Monday, August 21, 2017 6:14:18 PM To: rebus-org/Rebus.SqlServer Cc: Michael Davidson; Author Subject: Re: [rebus-org/Rebus.SqlServer] Leased SQL Server Message Processing (#14)

I have added contract tests for the lease-based transport, similar to how it's done for "the original SQL transport".

It resulted in numerous

System.Data.SqlClient.SqlException : Invalid column name 'leaseduntil'. Invalid column name 'leaseduntil'. Invalid column name 'leaseduntil'.

because the schema does not have the leaseduntil column.... did you have a plan for the schema generation?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/rebus-org/Rebus.SqlServer/pull/14#issuecomment-323676874, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ABTY6evaZaTjRNM60-CQpxVx0n6RFXRFks5saTxZgaJpZM4O4lwx.

MrMDavidson commented 7 years ago

See #15. My bad.