Skip to content

Commit

Permalink
Fixed the owner id assignment in envelopes being stored by EF Core tr…
Browse files Browse the repository at this point in the history
…ansactions. Closes GH-587. Bumps to 1.8.3.
  • Loading branch information
jeremydmiller committed Oct 11, 2023
1 parent 0195998 commit e667867
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<NoWarn>1570;1571;1572;1573;1574;1587;1591;1701;1702;1711;1735;0618</NoWarn>
<ImplicitUsings>true</ImplicitUsings>
<Version>1.8.2</Version>
<Version>1.8.3</Version>
<RepositoryUrl>$(PackageProjectUrl)</RepositoryUrl>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
Expand Down
7 changes: 7 additions & 0 deletions src/Persistence/Wolverine.RDBMS/MessageDatabase.Incoming.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Weasel.Core;
using Wolverine.Persistence.Durability;
using Wolverine.Runtime.Serialization;
using Wolverine.Transports;

namespace Wolverine.RDBMS;

Expand Down Expand Up @@ -70,6 +71,12 @@ public Task IncrementIncomingEnvelopeAttemptsAsync(Envelope envelope)

public async Task StoreIncomingAsync(Envelope envelope)
{
if (envelope.OwnerId == TransportConstants.AnyNode && envelope.Status == EnvelopeStatus.Incoming)
{
throw new ArgumentOutOfRangeException(nameof(Envelope),
"Erroneous persistence of an incoming envelope to 'any' node");
}

var builder = ToCommandBuilder();
DatabasePersistence.BuildIncomingStorageCommand(this, builder, envelope);

Expand Down
4 changes: 4 additions & 0 deletions src/Wolverine/Runtime/Routing/MessageRoute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ public Envelope CreateForSending(object message, DeliveryOptions? options, ISend
return envelope.ForScheduledSend(localDurableQueue);
}
}
else
{
envelope.OwnerId = runtime.Options.Durability.AssignedNodeNumber;
}

return envelope;
}
Expand Down

0 comments on commit e667867

Please sign in to comment.