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 53
53
IConsumer consumer = await connection . ConsumerBuilder ( ) . Queue ( queueName ) . MessageHandler (
54
54
( context , message ) =>
55
55
{
56
- Trace . WriteLine ( TraceLevel . Information , $ "[Consumer] Message: { message . Body ( ) } received") ;
56
+ Trace . WriteLine ( TraceLevel . Information , $ "[Consumer] Message: { message . BodyAsString ( ) } received") ;
57
57
context . Accept ( ) ;
58
58
return Task . CompletedTask ;
59
59
}
68
68
switch ( pr . Outcome . State )
69
69
{
70
70
case OutcomeState . Accepted :
71
- Trace . WriteLine ( TraceLevel . Information , $ "[Publisher] Message: { message . Body ( ) } confirmed") ;
71
+ Trace . WriteLine ( TraceLevel . Information , $ "[Publisher] Message: { message . BodyAsString ( ) } confirmed") ;
72
72
break ;
73
73
case OutcomeState . Released :
74
- Trace . WriteLine ( TraceLevel . Information , $ "[Publisher] Message: { message . Body ( ) } Released") ;
74
+ Trace . WriteLine ( TraceLevel . Information , $ "[Publisher] Message: { message . BodyAsString ( ) } Released") ;
75
75
break ;
76
76
77
77
case OutcomeState . Rejected :
78
78
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 } ") ;
80
80
break ;
81
81
default :
82
82
throw new ArgumentOutOfRangeException ( ) ;
Original file line number Diff line number Diff line change 45
45
{
46
46
try
47
47
{
48
- Trace . WriteLine ( TraceLevel . Information , $ "[Server] Message received: { message . Body ( ) } ") ;
48
+ Trace . WriteLine ( TraceLevel . Information , $ "[Server] Message received: { message . BodyAsString ( ) } ") ;
49
49
IMessage reply = context . Message ( $ "pong_{ DateTime . Now } ") ;
50
50
return Task . FromResult ( reply ) ;
51
51
}
68
68
{
69
69
IMessage reply = await rpcClient . PublishAsync (
70
70
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 ( ) } ") ;
72
72
}
73
73
catch ( Exception e )
74
74
{
You can’t perform that action at this time.
0 commit comments