Skip to content

Is it safe to ack/nack messages in a different thread? #249

Closed Answered by mtmk
robertmircea asked this question in Q&A
Discussion options

You must be logged in to vote

I think I found it. It's a serialization bug in the library. sorry about that.

Problem is here:

[PUB $JS.ACK.any-test.any-test-outgoing-oro-328.1.3.7.1701124066146132000.0 8]
MSG_PAYLOAD: ["\x04\x00\x00\x00+ACK"]
               ^^^^^^^^^^^^^^^^
               These shouldn't be here!

In msg.AckAsync() we're still (wrongly) using the custom serializer serializing +ACK instead we should use default.

@robertmircea thank you so much for the repro!

edit:
minimal example:

// <PackageReference Include="NATS.Net" Version="2.0.0" />
// <PackageReference Include="MemoryPack" Version="1.10.0" />
using System.Buffers;
using MemoryPack;
using NATS.Client.Core;
using NATS.Client.JetStream;
using NATS.C…

Replies: 2 comments 11 replies

Comment options

You must be logged in to vote
11 replies
@robertmircea
Comment options

@mtmk
Comment options

@robertmircea
Comment options

@mtmk
Comment options

Answer selected by robertmircea
@robertmircea
Comment options

@mtmk
Comment options

@mtmk
Comment options

Comment options

You must be logged in to vote
0 replies
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