rebus-org / Rebus.RavenDb

:bus: RavenDB persistence for Rebus
https://mookid.dk/category/rebus
Other
3 stars 5 forks source link

Exception in periodic task (if you upgrade to 4.x) #3

Closed ben-jacobs closed 4 years ago

ben-jacobs commented 4 years ago

Hi Mogens,

I've upgraded Rebus.RavenDb to use RavenDB 4.x - When using delayed messages with RabbitMq and RavenDB, I get the following error.

Exception in periodic task DueMessagesSender: Raven.Client.Exceptions.ConcurrencyException

This is caused by Line 63 in RavenDbTimeoutManager.cs- the change vector is not specified and therefore a concurrency exception will be thrown.

This can be resolved by passing in the change vector ...

var dueMessages = timeouts
                .Select(timeout => new DueMessage(timeout.Headers, timeout.Body, async () =>
                {
                    session.Advanced.Defer(new DeleteCommandData {Key = timeout.Id, session.Advanced.GetChangeVectorFor(timeout)});
                }));

Not really raising as an error, more just pointing out that this should be changed if you upgrade etc.

Cheers,

Ben

mookid8000 commented 4 years ago

Hi @ben-jacobs , thanks for the heads up 🙂 The RavenDB package has not seen any updates for a while, so I went and bumped the RavenDB client and Rebus dependencies.

It's up-to-date now for use with Rebus 6 and RavenDB.Client 4.2.8, available on NuGet.org as Rebus.RavenDb 6.0.0.

Thanks for your suggestion on how to fix the change vector thing. 👍