Skip to content

Commit a749916

Browse files
Document transport level customization (#7056)
Co-authored-by: danielmarbach <[email protected]>
1 parent 0f702cb commit a749916

4 files changed

+15
-1
lines changed

Snippets/ASBS/ASBS_5/AccessToNativeMessage.cs

+10
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,16 @@ async Task AccessNativeOutgoingMessageFromHandler(IMessageHandlerContext context
4242
#endregion
4343
}
4444

45+
void Customize(AzureServiceBusTransport transport)
46+
{
47+
#region access-native-outgoing-message-over-transport
48+
transport.OutgoingNativeMessageCustomization = (operation, message) =>
49+
{
50+
// Customize the outgoing message based on the operation
51+
};
52+
#endregion
53+
}
54+
4555
class MyCommand { }
4656
class MyEvent { }
4757
}

transports/azure-service-bus/native-message-access.md

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ reviewed: 2024-02-09
88

99
partial: supported-versions
1010

11-
1211
## Access to the native Azure Service Bus incoming message
1312

1413
It can sometimes be useful to access the native Service Bus incoming message from behaviors and handlers. When a message is received, the transport adds the native Service Bus [`Message`](https://docs.microsoft.com/en-us/dotnet/api/microsoft.azure.servicebus.message) to the message processing context. Use the code below to access the message details from a [pipeline behavior](/nservicebus/pipeline/manipulate-with-behaviors.md):
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
snippet: access-native-outgoing-message
2+
3+
Or on a more global level directly on the transport
4+
5+
snippet: access-native-outgoing-message-over-transport

0 commit comments

Comments
 (0)