Skip to content

Error processing received message #1352

Closed Answered by Pliner
pabermod asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @pabermod,

I suppose the issue is here:

    Task.Run(() =>
    {
        try
        {
            Stopwatch sw = Stopwatch.StartNew();
            Stopwatch swInternal = Stopwatch.StartNew();

            var message = Encoding.UTF8.GetString(ea.Body.ToArray()); // <--- access to ea.Body is invalid

RabbitMQ Client pools byte arrays and return them (https://github.com/rabbitmq/rabbitmq-dotnet-client/blob/6.x/projects/RabbitMQ.Client/client/impl/ConcurrentConsumerDispatcher.cs#L94) right after HandleBasicDeliver is completed.

In case of EventingBasicConsumer it happens right after Received is called (https://github.com/rabbitmq/rabbitmq-dotnet-client/blob/6.x/projects/RabbitMQ.Client/c…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@pabermod
Comment options

@Pliner
Comment options

@pabermod
Comment options

Answer selected by pabermod
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants