rabbitmq-java-client icon indicating copy to clipboard operation
rabbitmq-java-client copied to clipboard

Use array fragment for message body

Open acogoluegnes opened this issue 6 years ago • 2 comments

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.

acogoluegnes avatar Oct 31 '18 09:10 acogoluegnes

Something similar was brought up for .NET recently and was rejected due (but mostly due to questionable implementation choices and specific API changes).

michaelklishin avatar Oct 31 '18 11:10 michaelklishin

Similar .NET feature mentioned by @michaelklishin: https://github.com/rabbitmq/rabbitmq-dotnet-client/pull/489

acogoluegnes avatar Oct 31 '18 13:10 acogoluegnes