nats.ex icon indicating copy to clipboard operation
nats.ex copied to clipboard

Idle Heartbeat Header Parsing

Open brandynbennett opened this issue 2 years ago • 2 comments

When working with JetStream Push Consumers there's a type of header message that gets published that has headers like this: NATS/1.0 100 Idle Heartbeat\r\nNats-Last-Consumer: 2\r\nNats-Last-Stream: 2\r\n. These messages result in a {:error, "Could not parse headers"}. I believe because this line https://github.com/nats-io/nats.ex/blob/main/lib/gnat/parsec.ex#L116 is expecting a line break immediately after the NATS/1.0 declaration.

brandynbennett avatar May 11 '22 16:05 brandynbennett

I merged #125 and released it as version 1.5.2 on hex.pm

Based on our conversation in that PR, we may still want to have a way of returning the status code from the header line. So I think we can leave this issue open and come back to it when we have a good idea of how to handle that scenario.

mmmries avatar May 17 '22 08:05 mmmries

That sounds great. Thanks!

brandynbennett avatar May 17 '22 14:05 brandynbennett

We haven't found the need to make more modifications here, so I'll go ahead and close this

mmmries avatar Oct 22 '23 07:10 mmmries