EasyNetQ: Unexpected character encountered while parsing value:\u0001 . Path '', line 0
fail: Darkflame.BilibiliLiveChatRecorder.Background.LiveChatBackgroundService[0]
Newtonsoft.Json.JsonReaderException: Unexpected character encountered while parsing value: \u0001. Path '', line 0, position 0.
at Newtonsoft.Json.JsonTextReader.ParseValue()
at Newtonsoft.Json.JsonReader.ReadForType(JsonContract contract, Boolean hasConverter)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
at EasyNetQ.JsonSerializer.BytesToMessage(Type messageType, Byte[] bytes)
at EasyNetQ.DefaultMessageSerializationStrategy.DeserializeMessage(MessageProperties properties, Byte[] body)
at EasyNetQ.PullingConsumer`1.PullAsync(CancellationToken cancellationToken)
at EasyNetQ.PullingConsumerExtensions.PullBatchAsync[TPullResult](IPullingConsumer`1 consumer, Int32 batchSize, CancellationToken cancellationToken)
when I pull from rabbitmq,This exception is thrown at random…
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 17 (9 by maintainers)
~@darkflame0 in the meanwhile, if the problem is something internally on rmq client, you can try bypass this, by using different bus instance, one bus to pull, one bus to produce, I know it will create another connection and stuff, but this will give the best chance to trick the problem, but if rmq client use a static application wide pool to re-use arrays, then you will see the problem raise again.~
@Pliner just pointed me out that rmq client use ArrayPool.Shared and so it’s shared application wide. ~At this point the only way I can see right now it’s to split the application, one that pulls, one that produces.~
@Pliner also pointed me out that can happen also with only basicget operations, in a high load scenario where for instance an heartbeat could be sent before we read the basicget.body, by splitting the application you just increase your chance, your luckiness of not read an array released from other command send to rmq.
To avoid having pliner slap me again, I would silence me for a while 😂
@Pliner and……I think it should be rejected automatically or throw a exception with DeliveryTag when an inner exception occurs during pull(batch) I can’t deal with them without DeliveryTag
Before I used PullingBatch and AckBatch so that lost a lot of messages
@Pliner I will also try to reproduce,and the message should be no errors,when I retry, I can get the message successfully; and it is not a new issue ,when I use IAdvancedBus.Get,this exception also was thrown;