rebus-org / Rebus.SqlServer

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

In Transport "Receive" query, order by priority is ASC but should be DESC ? #22

Closed IsaacSee closed 6 years ago

IsaacSee commented 6 years ago

https://github.com/rebus-org/Rebus.SqlServer/blob/3532abc977559b0bdc90e4bd8e37016ee87cadc2/Rebus.SqlServer/SqlServer/Transport/SqlServerLeaseTransport.cs#L143

Priority 100 should be handled before priority 0 right ?

IsaacSee commented 6 years ago

Same issue in SqlServerTransport.cs

mookid8000 commented 6 years ago

Priority 100 should be handled before priority 0 right ?

Not if priority is defined as "lower number means higher priority". 😉

Did you come across some text somewhere that said how the priority is to be used?

IsaacSee commented 6 years ago

Not if priority is defined as "lower number means higher priority". 😉

Ah for sure, but it does feels a bit unnatural no ? :)

Did you come across some text somewhere that said how the priority is to be used?

Nop, I think this feature is not documented, I directly checked out sources.

mollyporph commented 6 years ago

In work-queue systems priority is normally descending since it allows for prioritized messaging. So if you're trying to build a system where you allow for manual manipulation of the priority, then a DESC would be the way to go.

mookid8000 commented 6 years ago

Allright allright I'll change it! 😁

In Rebus.SqlServer version 5 (from 5.0.0-b3 and onwards) HIGHER NUMBER means HIGHER PRIORITY.