Expose connection outgoingPendingMessageCount and outgoingPendingBytes#1412
Merged
Expose connection outgoingPendingMessageCount and outgoingPendingBytes#1412
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
MessageQueue is used in multiple ways, for both incoming and outgoing messages, but this PR focuses on NatsConnectionWriter which is used for outgoing messages.
NatsConnectionWriter is used by NatsConnection to publish messages. (The concept of Producer is a Kafka concept and is more analogous to your specific application component that publishes messages. NATS itself has no concept of a Producer, and for that matter using broker is confusing as well as that is also a Kafka concept.)
The MessageQueue's
length is a count of items [messages] in the queue. sizeInBytes is the number of bytes calculated from the serialized form of all the messages in the queue.
The change to NatsConnectionWriter exposes the MessageQueue's length and sizeInBytes with two new internal (packaged scoped) messages that specifically expose the Outgoing MessageQueue's information
The change to the Connection interface and the NatsConnection implementation exposes publicly the length and sizeInBytes from the NatsConnectionWriter.