Skip to content

Commit cd4f0f4

Browse files
Merge pull request #327 from JonasBarka/rabbitmq-tutorials-recieve-cs-update
Updated Recieve.cs to match tutorial
2 parents 72e74e5 + da48161 commit cd4f0f4

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

dotnet/Receive/Receive.cs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@ public static void Main()
1111
using(var connection = factory.CreateConnection())
1212
using(var channel = connection.CreateModel())
1313
{
14-
channel.QueueDeclare(queue: "hello", durable: false, exclusive: false, autoDelete: false, arguments: null);
15-
16-
Console.WriteLine(" [*] Waiting for messages.");
14+
channel.QueueDeclare(queue: "hello",
15+
durable: false,
16+
exclusive: false,
17+
autoDelete: false,
18+
arguments: null);
1719

1820
var consumer = new EventingBasicConsumer(channel);
1921
consumer.Received += (model, ea) =>
@@ -22,7 +24,9 @@ public static void Main()
2224
var message = Encoding.UTF8.GetString(body);
2325
Console.WriteLine(" [x] Received {0}", message);
2426
};
25-
channel.BasicConsume(queue: "hello", autoAck: true, consumer: consumer);
27+
channel.BasicConsume(queue: "hello",
28+
autoAck: true,
29+
consumer: consumer);
2630

2731
Console.WriteLine(" Press [enter] to exit.");
2832
Console.ReadLine();

0 commit comments

Comments
 (0)