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 MetricsCollector
public void closeConnection(Connection connection)
closeConnection
in interface MetricsCollector
public void newChannel(Channel channel)
newChannel
in interface MetricsCollector
public void closeChannel(Channel channel)
closeChannel
in interface MetricsCollector
public void basicPublish(Channel channel)
basicPublish
in interface MetricsCollector
public void basicPublishFailure(Channel channel, Throwable cause)
basicPublishFailure
in interface MetricsCollector
public void basicPublishAck(Channel channel, long deliveryTag, boolean multiple)
basicPublishAck
in interface MetricsCollector
public void basicPublishNack(Channel channel, long deliveryTag, boolean multiple)
basicPublishNack
in interface MetricsCollector
public void basicPublishUnrouted(Channel channel)
basicPublishUnrouted
in interface MetricsCollector
public void basicConsume(Channel channel, String consumerTag, boolean autoAck)
basicConsume
in interface MetricsCollector
public void basicCancel(Channel channel, String consumerTag)
basicCancel
in interface MetricsCollector
public void consumedMessage(Channel channel, long deliveryTag, boolean autoAck)
consumedMessage
in interface MetricsCollector
public void consumedMessage(Channel channel, long deliveryTag, String consumerTag)
consumedMessage
in interface MetricsCollector
public void basicAck(Channel channel, long deliveryTag, boolean multiple)
basicAck
in interface MetricsCollector
public void basicNack(Channel channel, long deliveryTag)
basicNack
in interface MetricsCollector
public void basicReject(Channel channel, long deliveryTag)
basicReject
in interface MetricsCollector
public 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 © 2022 VMware, Inc. or its affiliates.. All rights reserved.