nats-io / nats.java

Java client for NATS
Apache License 2.0
563 stars 154 forks source link

Revert headers from being read-only upon message creation #1123

Closed scottf closed 4 months ago

scottf commented 5 months ago

This reverts the changes done in https://github.com/nats-io/nats.java/pull/1054 which made headers read-only as soon as they the message was constructed (either directly through constructors or via the fluent builder.) This has been reversed. At publish call time, the entire message is copied and headers made read-only so they cannot be further modified and the protocol is built.