You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to support multiple compression algorithms side-by-side for various nats-messages landing on a specific nats-connection and in this context I experimented with creating an all-in-one multi-decoder which relies on nats-headers to figure out the kind of compression (zlib, snappy, brotli etc) that has been employed in the given data-payload of each message. This is similar to what http is doing with http-headers and compression.
However the signature of Encoder.Decode() method doesn't pass nats-headers at all:
Decode(subject string, data []byte, vPtr interface{}) error
I believe this should be:
Decode(subject string, **header Header**, data []byte, vPtr interface{}) error
PS: I'm aware of the fact that one can work around the lack of 'nats-headers' by resorting to hacks of various kinds like relying on specific subject prefixes (snappy.foo.bar, zlib.foo.bar, ...) but I wan't to avoid this sort of thing for obvious reasons.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I want to support multiple compression algorithms side-by-side for various nats-messages landing on a specific nats-connection and in this context I experimented with creating an all-in-one multi-decoder which relies on nats-headers to figure out the kind of compression (zlib, snappy, brotli etc) that has been employed in the given data-payload of each message. This is similar to what http is doing with http-headers and compression.
However the signature of Encoder.Decode() method doesn't pass nats-headers at all:
Decode(subject string, data []byte, vPtr interface{}) error
I believe this should be:
Decode(subject string, **header Header**, data []byte, vPtr interface{}) error
PS: I'm aware of the fact that one can work around the lack of 'nats-headers' by resorting to hacks of various kinds like relying on specific subject prefixes (snappy.foo.bar, zlib.foo.bar, ...) but I wan't to avoid this sort of thing for obvious reasons.
Beta Was this translation helpful? Give feedback.
All reactions