public abstract class AbstractMetricsCollector extends Object implements MetricsCollector
MetricsCollector.
Implements tricky logic such as keeping track of acknowledged and
rejected messages. Sub-classes just need to implement
the logic to increment their metrics.
Note transactions are not supported (see MetricsCollector.MetricsCollector| Constructor and Description |
|---|
AbstractMetricsCollector() |
| Modifier and Type | Method and Description |
|---|---|
void |
basicAck(Channel channel,
long deliveryTag,
boolean multiple) |
void |
basicCancel(Channel channel,
String consumerTag) |
void |
basicConsume(Channel channel,
String consumerTag,
boolean autoAck) |
void |
basicNack(Channel channel,
long deliveryTag) |
void |
basicPublish(Channel channel) |
void |
basicPublishAck(Channel channel,
long deliveryTag,
boolean multiple) |
void |
basicPublishFailure(Channel channel,
Throwable cause) |
void |
basicPublishNack(Channel channel,
long deliveryTag,
boolean multiple) |
void |
basicPublishUnrouted(Channel channel) |
void |
basicReject(Channel channel,
long deliveryTag) |
void |
cleanStaleState()
Clean inner state for close connections and channels.
|
void |
closeChannel(Channel channel) |
void |
closeConnection(Connection connection) |
void |
consumedMessage(Channel channel,
long deliveryTag,
boolean autoAck) |
void |
consumedMessage(Channel channel,
long deliveryTag,
String consumerTag) |
protected abstract void |
decrementChannelCount(Channel channel)
Decrements channel count.
|
protected abstract void |
decrementConnectionCount(Connection connection)
Decrements connection count.
|
protected abstract void |
incrementChannelCount(Channel channel)
Increments channel count.
|
protected abstract void |
incrementConnectionCount(Connection connection)
Increments connection count.
|
protected abstract void |
markAcknowledgedMessage()
Marks the event of an acknowledged message.
|
protected abstract void |
markConsumedMessage()
Marks the event of a consumed message.
|
protected abstract void |
markMessagePublishAcknowledged()
Marks the event of a message publishing acknowledgement.
|
protected abstract void |
markMessagePublishFailed()
Marks the event of a message publishing failure.
|
protected abstract void |
markMessagePublishNotAcknowledged()
Marks the event of a message publishing not being acknowledged.
|
protected abstract void |
markPublishedMessage()
Marks the event of a published message.
|
protected abstract void |
markPublishedMessageUnrouted()
Marks the event of a published message not being routed.
|
protected abstract void |
markRejectedMessage()
Marks the event of a rejected message.
|
void |
newChannel(Channel channel) |
void |
newConnection(Connection connection) |
public void newConnection(Connection connection)
newConnection in interface MetricsCollectorpublic void closeConnection(Connection connection)
closeConnection in interface MetricsCollectorpublic void newChannel(Channel channel)
newChannel in interface MetricsCollectorpublic void closeChannel(Channel channel)
closeChannel in interface MetricsCollectorpublic void basicPublish(Channel channel)
basicPublish in interface MetricsCollectorpublic void basicPublishFailure(Channel channel, Throwable cause)
basicPublishFailure in interface MetricsCollectorpublic void basicPublishAck(Channel channel, long deliveryTag, boolean multiple)
basicPublishAck in interface MetricsCollectorpublic void basicPublishNack(Channel channel, long deliveryTag, boolean multiple)
basicPublishNack in interface MetricsCollectorpublic void basicPublishUnrouted(Channel channel)
basicPublishUnrouted in interface MetricsCollectorpublic void basicConsume(Channel channel, String consumerTag, boolean autoAck)
basicConsume in interface MetricsCollectorpublic void basicCancel(Channel channel, String consumerTag)
basicCancel in interface MetricsCollectorpublic void consumedMessage(Channel channel, long deliveryTag, boolean autoAck)
consumedMessage in interface MetricsCollectorpublic void consumedMessage(Channel channel, long deliveryTag, String consumerTag)
consumedMessage in interface MetricsCollectorpublic void basicAck(Channel channel, long deliveryTag, boolean multiple)
basicAck in interface MetricsCollectorpublic void basicNack(Channel channel, long deliveryTag)
basicNack in interface MetricsCollectorpublic void basicReject(Channel channel, long deliveryTag)
basicReject in interface MetricsCollectorpublic void cleanStaleState()
protected abstract void incrementConnectionCount(Connection connection)
connection - the connection that has been created (can be null)protected abstract void decrementConnectionCount(Connection connection)
connection - the connection that has been closed (can be null)protected abstract void incrementChannelCount(Channel channel)
channel - the channel that has been created (can be null)protected abstract void decrementChannelCount(Channel channel)
channel - protected abstract void markPublishedMessage()
protected abstract void markMessagePublishFailed()
protected abstract void markConsumedMessage()
protected abstract void markAcknowledgedMessage()
protected abstract void markRejectedMessage()
protected abstract void markMessagePublishAcknowledged()
protected abstract void markMessagePublishNotAcknowledged()
protected abstract void markPublishedMessageUnrouted()
Copyright © 2021 VMware, Inc. or its affiliates.. All rights reserved.