From b77b94e70555451a2c8dda1d9a1d9f9b00bf7e79 Mon Sep 17 00:00:00 2001 From: "Jeremy D. Miller" Date: Tue, 21 Jan 2025 09:28:13 -0600 Subject: [PATCH] Sending a fake session identifier in Ping() for Azure Service Bus. Closes GH-1230 --- .../Internal/InlineAzureServiceBusSender.cs | 5 +++++ src/Wolverine/Envelope.Internals.cs | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/Transports/Azure/Wolverine.AzureServiceBus/Internal/InlineAzureServiceBusSender.cs b/src/Transports/Azure/Wolverine.AzureServiceBus/Internal/InlineAzureServiceBusSender.cs index e25a94410..40fb5c6ea 100644 --- a/src/Transports/Azure/Wolverine.AzureServiceBus/Internal/InlineAzureServiceBusSender.cs +++ b/src/Transports/Azure/Wolverine.AzureServiceBus/Internal/InlineAzureServiceBusSender.cs @@ -27,6 +27,11 @@ public InlineAzureServiceBusSender(AzureServiceBusEndpoint endpoint, IOutgoingMa public async Task PingAsync() { var envelope = Envelope.ForPing(Destination); + + // For GH-1230, and according to Azure Service Bus docs, it does not harm + // to send a session identifier to a non-FIFO queue, so just do this by default + envelope.GroupId = Guid.NewGuid().ToString(); + try { await SendAsync(envelope); diff --git a/src/Wolverine/Envelope.Internals.cs b/src/Wolverine/Envelope.Internals.cs index 789cc013b..0886e33e2 100644 --- a/src/Wolverine/Envelope.Internals.cs +++ b/src/Wolverine/Envelope.Internals.cs @@ -267,7 +267,12 @@ public static Envelope ForPing(Uri destination) MessageType = PingMessageType, Data = [1, 2, 3, 4], ContentType = "wolverine/ping", - Destination = destination + Destination = destination, + + // According to both AWS SQS & Azure Service Bus docs, it does no + // harm to send a session identifier to a non-FIFO queue, and it's + // most certainly needed for FIFO queues + GroupId = Guid.NewGuid().ToString() }; }