Skip to content

update examples #121

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/Examples/GettingStarted/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
IConsumer consumer = await connection.ConsumerBuilder().Queue(queueName).MessageHandler(
(context, message) =>
{
Trace.WriteLine(TraceLevel.Information, $"[Consumer] Message: {message.Body()} received");
Trace.WriteLine(TraceLevel.Information, $"[Consumer] Message: {message.BodyAsString()} received");
context.Accept();
return Task.CompletedTask;
}
Expand All @@ -68,15 +68,15 @@
switch (pr.Outcome.State)
{
case OutcomeState.Accepted:
Trace.WriteLine(TraceLevel.Information, $"[Publisher] Message: {message.Body()} confirmed");
Trace.WriteLine(TraceLevel.Information, $"[Publisher] Message: {message.BodyAsString()} confirmed");
break;
case OutcomeState.Released:
Trace.WriteLine(TraceLevel.Information, $"[Publisher] Message: {message.Body()} Released");
Trace.WriteLine(TraceLevel.Information, $"[Publisher] Message: {message.BodyAsString()} Released");
break;

case OutcomeState.Rejected:
Trace.WriteLine(TraceLevel.Error,
$"[Publisher] Message: {message.Body()} Rejected with error: {pr.Outcome.Error}");
$"[Publisher] Message: {message.BodyAsString()} Rejected with error: {pr.Outcome.Error}");
break;
default:
throw new ArgumentOutOfRangeException();
Expand Down
4 changes: 2 additions & 2 deletions docs/Examples/Rpc/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
{
try
{
Trace.WriteLine(TraceLevel.Information, $"[Server] Message received: {message.Body()} ");
Trace.WriteLine(TraceLevel.Information, $"[Server] Message received: {message.BodyAsString()} ");
IMessage reply = context.Message($"pong_{DateTime.Now}");
return Task.FromResult(reply);
}
Expand All @@ -68,7 +68,7 @@
{
IMessage reply = await rpcClient.PublishAsync(
new AmqpMessage($"ping_{DateTime.Now}"));
Trace.WriteLine(TraceLevel.Information, $"[Client] Reply received: {reply.Body()}");
Trace.WriteLine(TraceLevel.Information, $"[Client] Reply received: {reply.BodyAsString()}");
}
catch (Exception e)
{
Expand Down