Currently the payload generated to publish a NAK is wrong and does not result of actually nak-ing a message.
According to the documentation, acknowledgment is done only by sending the reply string, but Ack prorotype here generates adds +ACK command in the payload
it results in a mesasge like this
PUB $JS.ACK.sample-stream.psub.3.1.21.1719946162089866350.0 +ACK 0
but the actual that is required is this
PUB $JS.ACK.sample-stream.psub.3.1.21.1719946162089866350.0 0
When generating NAKs, the problem continues. It generates a message like this
PUB $JS.ACK.sample-stream.psub.3.1.21.1719946162089866350.0 -NAK 21\r\n{"delay": 5000000000}
but the expexted nack string is
PUB $JS.ACK.sample-stream.psub.2.1.11.1719946162089866350.0 26\r\n-NAK {"delay": 5000000000}
The -NAK command is required to be part of the body and included in the lenght of the message, not before the length.
Here are some samples from the Python library that i've traced
With the issue above, when you try to nak a mesage with delay, message is always delayed only 30s which is not the actual delay but the default AckWait for the consumer.
Currently the payload generated to publish a NAK is wrong and does not result of actually nak-ing a message.
According to the documentation, acknowledgment is done only by sending the reply string, but Ack prorotype here generates adds +ACK command in the payload it results in a mesasge like this
PUB $JS.ACK.sample-stream.psub.3.1.21.1719946162089866350.0 +ACK 0
but the actual that is required is thisPUB $JS.ACK.sample-stream.psub.3.1.21.1719946162089866350.0 0
When generating NAKs, the problem continues. It generates a message like this
PUB $JS.ACK.sample-stream.psub.3.1.21.1719946162089866350.0 -NAK 21\r\n{"delay": 5000000000}
but the expexted nack string isPUB $JS.ACK.sample-stream.psub.2.1.11.1719946162089866350.0 26\r\n-NAK {"delay": 5000000000}
The -NAK command is required to be part of the body and included in the lenght of the message, not before the length. Here are some samples from the Python library that i've traced
With the issue above, when you try to nak a mesage with delay, message is always delayed only 30s which is not the actual delay but the default AckWait for the consumer.
With the current PR the issue should be fixed