Skip to content

Commit e308168

Browse files
committed
Reformatted and cleaned up
1 parent 97edb52 commit e308168

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

dotnet/EmitLogTopic.cs

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,19 @@ public static void Main(string[] args)
99
{
1010
var factory = new ConnectionFactory() { HostName = "localhost" };
1111
using (var connection = factory.CreateConnection())
12-
using (var channel = connection.CreateModel())
1312
{
14-
channel.ExchangeDeclare("topic_logs", "topic");
13+
using (var channel = connection.CreateModel())
14+
{
15+
channel.ExchangeDeclare("topic_logs", "topic");
1516

16-
var routingKey = (args.Length > 0) ? args[0] : "anonymous.info";
17-
var message = (args.Length > 1) ? string.Join(" ", args.Skip(1)
18-
.ToArray())
19-
: "Hello World!";
20-
var body = Encoding.UTF8.GetBytes(message);
21-
channel.BasicPublish("topic_logs", routingKey, null, body);
22-
Console.WriteLine(" [x] Sent '{0}':'{1}'", routingKey, message);
17+
var routingKey = (args.Length > 0) ? args[0] : "anonymous.info";
18+
var message = (args.Length > 1) ? string.Join(" ", args.Skip(1)
19+
.ToArray())
20+
: "Hello World!";
21+
var body = Encoding.UTF8.GetBytes(message);
22+
channel.BasicPublish("topic_logs", routingKey, null, body);
23+
Console.WriteLine(" [x] Sent '{0}':'{1}'", routingKey, message);
24+
}
2325
}
2426
}
2527
}

0 commit comments

Comments
 (0)