Describe the bug
Calling the ReceiveRawJson method disables the default wolverine behavior associated with processing the wolverine/ping message.
I get an error on the consumer:
fail: Wolverine.Runtime.WolverineRuntime[108]
Envelope Envelope #08deb4de-0758-b6ea-d8bb-c19fcdfd0000 to kafka://topic/wolverine-test-ping was moved to the error queue
System.Text.Json.JsonException: '0x01' is an invalid start of a value. Path: $ | LineNumber: 0 | BytePositionInLine: 0.
---> System.Text.Json.JsonReaderException: '0x01' is an invalid start of a value. LineNumber: 0 | BytePositionInLine: 0.
If I delete the call to the Receive Raw Json method, there will be no error, the consumer will not be called, everything is correct.
Source code (wolverine version is 5.39.0):
using Wolverine;
using Wolverine.Kafka;
using Wolverine.Runtime;
var builder = WebApplication.CreateBuilder(args);
var kafkaServers = builder.Configuration["Kafka:BootstrapServers"]!;
const string topic = "wolverine-test-ping";
builder.Host.UseWolverine(opts =>
{
opts.UseKafka(kafkaServers).AutoProvision();
opts.PublishMessage<Msg>().ToKafkaTopic(topic);
opts.ListenToKafkaTopic(topic)
.ReceiveRawJson<Msg>(); // enable or disable this for test
});
var app = builder.Build();
app.MapGet("/ping", async (IWolverineRuntime runtime) =>
{
var uri = KafkaEndpointUri.Topic(topic);
var agent = runtime.Endpoints.GetOrBuildSendingAgent(uri);
await agent.EnqueueOutgoingAsync(Envelope.ForPing(uri));
});
app.Run();
public record Msg(string Name);
public class MsgConsumer
{
public void Consume(Msg msg, IMessageContext ctx)
{
Console.WriteLine($"EnvelopeId = {ctx.Envelope.Id}");
}
}
To Reproduce
Steps to reproduce the behavior based on the attached source code:
- Call the ReceiveRawJson method
- Send a request /ping
- You should see an exception in the logs
Expected behavior
ReceiveRawJson should not disable the infrastructure behavior of wolverine.
Describe the bug
Calling the ReceiveRawJson method disables the default wolverine behavior associated with processing the wolverine/ping message.
I get an error on the consumer:
If I delete the call to the Receive Raw Json method, there will be no error, the consumer will not be called, everything is correct.
Source code (wolverine version is 5.39.0):
To Reproduce
Steps to reproduce the behavior based on the attached source code:
Expected behavior
ReceiveRawJson should not disable the infrastructure behavior of wolverine.