rabbitmq-java-client
rabbitmq-java-client copied to clipboard
Use array fragment for message body
Sometimes the message body can be just a subset of a byte array and the only way now to send this subset is to copy it into another array and use it as message body.
To avoid a copy, the Channel could be extended with basicPublish methods that accept an array fragment parameter (array of byte, offset, and length).
More context: #421, https://github.com/rabbitmq/rabbitmq-java-client/issues/421#issuecomment-433948206, https://github.com/rabbitmq/rabbitmq-java-client/issues/421#issuecomment-433963410.
Something similar was brought up for .NET recently and was rejected due (but mostly due to questionable implementation choices and specific API changes).
Similar .NET feature mentioned by @michaelklishin: https://github.com/rabbitmq/rabbitmq-dotnet-client/pull/489