File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 5353IConsumer consumer = await connection . ConsumerBuilder ( ) . Queue ( queueName ) . MessageHandler (
5454 ( context , message ) =>
5555 {
56- Trace . WriteLine ( TraceLevel . Information , $ "[Consumer] Message: { message . Body ( ) } received") ;
56+ Trace . WriteLine ( TraceLevel . Information , $ "[Consumer] Message: { message . BodyAsString ( ) } received") ;
5757 context . Accept ( ) ;
5858 return Task . CompletedTask ;
5959 }
6868 switch ( pr . Outcome . State )
6969 {
7070 case OutcomeState . Accepted :
71- Trace . WriteLine ( TraceLevel . Information , $ "[Publisher] Message: { message . Body ( ) } confirmed") ;
71+ Trace . WriteLine ( TraceLevel . Information , $ "[Publisher] Message: { message . BodyAsString ( ) } confirmed") ;
7272 break ;
7373 case OutcomeState . Released :
74- Trace . WriteLine ( TraceLevel . Information , $ "[Publisher] Message: { message . Body ( ) } Released") ;
74+ Trace . WriteLine ( TraceLevel . Information , $ "[Publisher] Message: { message . BodyAsString ( ) } Released") ;
7575 break ;
7676
7777 case OutcomeState . Rejected :
7878 Trace . WriteLine ( TraceLevel . Error ,
79- $ "[Publisher] Message: { message . Body ( ) } Rejected with error: { pr . Outcome . Error } ") ;
79+ $ "[Publisher] Message: { message . BodyAsString ( ) } Rejected with error: { pr . Outcome . Error } ") ;
8080 break ;
8181 default :
8282 throw new ArgumentOutOfRangeException ( ) ;
Original file line number Diff line number Diff line change 4545 {
4646 try
4747 {
48- Trace . WriteLine ( TraceLevel . Information , $ "[Server] Message received: { message . Body ( ) } ") ;
48+ Trace . WriteLine ( TraceLevel . Information , $ "[Server] Message received: { message . BodyAsString ( ) } ") ;
4949 IMessage reply = context . Message ( $ "pong_{ DateTime . Now } ") ;
5050 return Task . FromResult ( reply ) ;
5151 }
6868 {
6969 IMessage reply = await rpcClient . PublishAsync (
7070 new AmqpMessage ( $ "ping_{ DateTime . Now } ") ) ;
71- Trace . WriteLine ( TraceLevel . Information , $ "[Client] Reply received: { reply . Body ( ) } ") ;
71+ Trace . WriteLine ( TraceLevel . Information , $ "[Client] Reply received: { reply . BodyAsString ( ) } ") ;
7272 }
7373 catch ( Exception e )
7474 {
You can’t perform that action at this time.
0 commit comments