Skip to content

Commit feebbca

Browse files
committed
fix: code error
1 parent b598c82 commit feebbca

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

tutorials/tutorial-two-dotnet.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,9 +221,15 @@ examples we explicitly turned them off by setting the autoAck
221221
remove this flag and manually send a proper acknowledgment from the
222222
worker, once we're done with a task.
223223

224-
After the existing _WriteLine_, add a call to _BasicAck_ and update _BasicConsume_ with _autoAck:false_:
225-
```csharp reference
226-
https://github.com/rabbitmq/rabbitmq-tutorials/blob/main/dotnet/Worker/Worker.cs#L26-L32
224+
After the existing _WriteLine_, add a call to _BasicAckAsync_ and update _BasicConsumeAsync_ with _autoAck:false_:
225+
```csharp
226+
Console.WriteLine(" [x] Done");
227+
228+
// here channel could also be accessed as ((AsyncEventingBasicConsumer)sender).Channel
229+
await channel.BasicAckAsync(deliveryTag: ea.DeliveryTag, multiple: false);
230+
};
231+
232+
await channel.BasicConsumeAsync("hello", autoAck: false, consumer: consumer);
227233
```
228234

229235
Using this code, you can ensure that even if you terminate a worker node using

0 commit comments

Comments
 (0)