File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed
Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments