Skip to content

Commit 23f381d

Browse files
committed
* Post-merge fixes.
1 parent c967677 commit 23f381d

File tree

5 files changed

+25
-10
lines changed

5 files changed

+25
-10
lines changed

projects/Benchmarks/ConsumerDispatching/ConsumerDispatcher.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ public async Task AsyncConsumerDispatcher()
5555
{
5656
for (int i = 0; i < Count; i++)
5757
{
58-
await _dispatcher.HandleBasicDeliverAsync(_consumerTag, _deliveryTag, false, _exchange, _routingKey, _properties, body,
59-
CancellationToken.None);
58+
await _dispatcher.HandleBasicDeliverAsync(_consumerTagBytes, _deliveryTag,
59+
false, _exchange, _routingKey, _properties, body, CancellationToken.None);
6060
}
6161
_autoResetEvent.Wait();
6262
_autoResetEvent.Reset();
@@ -78,8 +78,8 @@ public async Task ConsumerDispatcher()
7878
{
7979
for (int i = 0; i < Count; i++)
8080
{
81-
await _dispatcher.HandleBasicDeliverAsync(_consumerTag, _deliveryTag, false, _exchange, _routingKey, _properties, body,
82-
CancellationToken.None);
81+
await _dispatcher.HandleBasicDeliverAsync(_consumerTagBytes, _deliveryTag,
82+
false, _exchange, _routingKey, _properties, body, CancellationToken.None);
8383
}
8484
_autoResetEvent.Wait();
8585
_autoResetEvent.Reset();

projects/RabbitMQ.Client/client/impl/ChannelBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,7 @@ protected async Task<bool> HandleBasicDeliverAsync(IncomingCommand cmd, Cancella
670670
{
671671
try
672672
{
673-
var method = new Client.Framing.Impl.BasicDeliver(cmd.MethodSpan);
673+
var method = new Client.Framing.Impl.BasicDeliver(cmd.MethodMemory);
674674
var header = new ReadOnlyBasicProperties(cmd.HeaderSpan);
675675
await ConsumerDispatcher.HandleBasicDeliverAsync(
676676
method._consumerTag,

projects/RabbitMQ.Client/client/impl/IncomingCommand.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,14 @@ public IncomingCommand(ProtocolCommandId commandId,
5555
Body = body;
5656
}
5757

58+
public ReadOnlyMemory<byte> MethodMemory
59+
{
60+
get
61+
{
62+
return Method.Memory;
63+
}
64+
}
65+
5866
public ReadOnlySpan<byte> MethodSpan
5967
{
6068
get

projects/RabbitMQ.Client/client/impl/RabbitMQActivitySource.cs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,18 +117,25 @@ internal static Activity Deliver(BasicDeliverEventArgs deliverEventArgs)
117117
return null;
118118
}
119119

120+
// TODO
121+
string routingKey = Encoding.UTF8.GetString(deliverEventArgs.RoutingKey.ToArray());
122+
string exchange = Encoding.UTF8.GetString(deliverEventArgs.Exchange.ToArray());
123+
120124
// Extract the PropagationContext of the upstream parent from the message headers.
121125
DistributedContextPropagator.Current.ExtractTraceIdAndState(deliverEventArgs.BasicProperties.Headers,
122126
ExtractTraceIdAndState, out string traceparent, out string traceState);
127+
123128
ActivityContext.TryParse(traceparent, traceState, out ActivityContext parentContext);
129+
124130
Activity activity = s_subscriberSource.StartLinkedRabbitMQActivity(
125-
UseRoutingKeyAsOperationName ? $"{deliverEventArgs.RoutingKey} deliver" : "deliver",
131+
UseRoutingKeyAsOperationName ? $"{routingKey} deliver" : "deliver",
126132
ActivityKind.Consumer, parentContext);
133+
127134
if (activity != null && activity.IsAllDataRequested)
128135
{
129136
PopulateMessagingTags("deliver",
130-
deliverEventArgs.RoutingKey,
131-
deliverEventArgs.Exchange,
137+
routingKey,
138+
exchange,
132139
deliverEventArgs.DeliveryTag,
133140
deliverEventArgs.BasicProperties,
134141
deliverEventArgs.Body.Length,

projects/Test/Common/TestConnectionRecoveryBase.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,8 +318,8 @@ public TestBasicConsumer(IChannel channel, ushort totalMessageCount, TaskComplet
318318
public override Task HandleBasicDeliverAsync(string consumerTag,
319319
ulong deliveryTag,
320320
bool redelivered,
321-
string exchange,
322-
string routingKey,
321+
ReadOnlyMemory<byte> exchange,
322+
ReadOnlyMemory<byte> routingKey,
323323
ReadOnlyBasicProperties properties,
324324
ReadOnlyMemory<byte> body)
325325
{

0 commit comments

Comments
 (0)