Class LoggingActiveMQServerPlugin
- java.lang.Object
-
- org.apache.activemq.artemis.core.server.plugin.impl.LoggingActiveMQServerPlugin
-
- All Implemented Interfaces:
Serializable,ActiveMQServerAddressPlugin,ActiveMQServerBasePlugin,ActiveMQServerBindingPlugin,ActiveMQServerBridgePlugin,ActiveMQServerConnectionPlugin,ActiveMQServerConsumerPlugin,ActiveMQServerCriticalPlugin,ActiveMQServerFederationPlugin,ActiveMQServerMessagePlugin,ActiveMQServerPlugin,ActiveMQServerQueuePlugin,ActiveMQServerResourcePlugin,ActiveMQServerSessionPlugin
public class LoggingActiveMQServerPlugin extends Object implements ActiveMQServerPlugin, Serializable
plugin to log various events within the broker, configured with the following booleans LOG_CONNECTION_EVENTS - connections creation/destroy LOG_SESSION_EVENTS - sessions creation/close LOG_CONSUMER_EVENTS - consumers creation/close LOG_DELIVERING_EVENTS - messages delivered to consumer, acked by consumer LOG_SENDING_EVENTS - messaged is sent, message is routed LOG_INTERNAL_EVENTS - critical failures, bridge deployments, queue creation/destroyed, message expired- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static StringLOG_ALL_EVENTSstatic StringLOG_CONNECTION_EVENTSstatic StringLOG_CONSUMER_EVENTSstatic StringLOG_DELIVERING_EVENTSstatic StringLOG_INTERNAL_EVENTSstatic StringLOG_SENDING_EVENTSstatic StringLOG_SESSION_EVENTSstatic StringUNAVAILABLE
-
Constructor Summary
Constructors Constructor Description LoggingActiveMQServerPlugin()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterCloseConsumer(ServerConsumer consumer, boolean failed)After a consumer is closedvoidafterCloseSession(ServerSession session, boolean failed)After a session is closedvoidafterCreateConnection(RemotingConnection connection)A connection has been created.voidafterCreateConsumer(ServerConsumer consumer)After a consumer has been createdvoidafterCreateQueue(Queue queue)After a queue has been createdvoidafterCreateSession(ServerSession session)After a session has been created.voidafterDeliver(ServerConsumer consumer, MessageReference reference)After a message is delivered to a client consumervoidafterDeployBridge(Bridge bridge)After a bridge has been deployedvoidafterDestroyConnection(RemotingConnection connection)A connection has been destroyed.voidafterDestroyQueue(Queue queue, SimpleString address, SecurityAuth session, boolean checkConsumerCount, boolean removeConsumers, boolean autoDeleteAddress)After a queue has been destroyedvoidafterMessageRoute(Message message, RoutingContext context, boolean direct, boolean rejectDuplicates, RoutingStatus result)After a message is routedvoidafterSend(ServerSession session, Transaction tx, Message message, boolean direct, boolean noAutoCreateQueue, RoutingStatus result)After a message is sentvoidafterSessionMetadataAdded(ServerSession session, String key, String data)After session metadata is added to the sessionvoidbeforeCloseConsumer(ServerConsumer consumer, boolean failed)Before a consumer is closedvoidbeforeCloseSession(ServerSession session, boolean failed)Before a session is closedvoidbeforeCreateConsumer(long consumerID, QueueBinding queueBinding, SimpleString filterString, boolean browseOnly, boolean supportLargeMessage)Before a consumer is createdvoidbeforeCreateQueue(QueueConfiguration queueConfig)Before a queue is createdvoidbeforeCreateSession(String name, String username, int minLargeMessageSize, RemotingConnection connection, boolean autoCommitSends, boolean autoCommitAcks, boolean preAcknowledge, boolean xa, String publicAddress, SessionCallback callback, boolean autoCreateQueues, OperationContext context, Map<SimpleString,RoutingType> prefixes)Before a session is created.voidbeforeDeliver(ServerConsumer consumer, MessageReference reference)Before a message is delivered to a client consumervoidbeforeDeployBridge(BridgeConfiguration config)Before a bridge is deployedvoidbeforeDestroyQueue(SimpleString queueName, SecurityAuth session, boolean checkConsumerCount, boolean removeConsumers, boolean autoDeleteAddress)Before a queue is destroyedvoidbeforeMessageRoute(Message message, RoutingContext context, boolean direct, boolean rejectDuplicates)Before a message is routedvoidbeforeSend(ServerSession session, Transaction tx, Message message, boolean direct, boolean noAutoCreateQueue)Before a message is sentvoidbeforeSessionMetadataAdded(ServerSession session, String key, String data)Before session metadata is added to the sessionvoidcriticalFailure(CriticalComponent components)A Critical failure has been detected.voidinit(Map<String,String> properties)used to pass configured properties to PluginbooleanisLogAll()booleanisLogConnectionEvents()booleanisLogConsumerEvents()booleanisLogDeliveringEvents()booleanisLogInternalEvents()booleanisLogSendingEvents()booleanisLogSessionEvents()voidmessageAcknowledged(Transaction tx, MessageReference ref, AckReason reason, ServerConsumer consumer)A message has been acknowledgedvoidmessageExpired(MessageReference message, SimpleString messageExpiryAddress, ServerConsumer consumer)A message has been expiredvoidonMessageRouteException(Message message, RoutingContext context, boolean direct, boolean rejectDuplicates, Exception e)When there was an error routing the messagevoidonSendException(ServerSession session, Transaction tx, Message message, boolean direct, boolean noAutoCreateQueue, Exception e)When there was an exception sending the message-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.activemq.artemis.core.server.plugin.ActiveMQServerAddressPlugin
afterAddAddress, afterRemoveAddress, afterUpdateAddress, beforeAddAddress, beforeRemoveAddress, beforeUpdateAddress
-
Methods inherited from interface org.apache.activemq.artemis.core.server.plugin.ActiveMQServerBasePlugin
registered, unregistered
-
Methods inherited from interface org.apache.activemq.artemis.core.server.plugin.ActiveMQServerBindingPlugin
afterAddBinding, afterRemoveBinding, beforeAddBinding, beforeRemoveBinding
-
Methods inherited from interface org.apache.activemq.artemis.core.server.plugin.ActiveMQServerBridgePlugin
afterAcknowledgeBridge, afterDeliverBridge, beforeDeliverBridge
-
Methods inherited from interface org.apache.activemq.artemis.core.server.plugin.ActiveMQServerConsumerPlugin
beforeCreateConsumer
-
Methods inherited from interface org.apache.activemq.artemis.core.server.plugin.ActiveMQServerFederationPlugin
afterCloseFederatedQueueConsumer, afterCreateFederatedQueueConsumer, afterFederatedQueueConsumerMessageHandled, beforeCloseFederatedQueueConsumer, beforeCreateFederatedQueueConsumer, beforeFederatedQueueConsumerMessageHandled, federatedAddressConditionalCreateConsumer, federatedAddressConditionalCreateDivertConsumer, federatedQueueConditionalCreateConsumer, federationStreamStarted, federationStreamStopped
-
Methods inherited from interface org.apache.activemq.artemis.core.server.plugin.ActiveMQServerMessagePlugin
afterDeliver, afterSend, beforeDeliver, beforeSend, canAccept, messageAcknowledged, messageAcknowledged, messageExpired
-
Methods inherited from interface org.apache.activemq.artemis.core.server.plugin.ActiveMQServerQueuePlugin
afterExpiryScan, beforeCreateQueue, beforeDestroyQueue, beforeExpiryScan
-
Methods inherited from interface org.apache.activemq.artemis.core.server.plugin.ActiveMQServerResourcePlugin
afterPutTransaction, afterRemoveTransaction, beforePutTransaction, beforeRemoveTransaction
-
Methods inherited from interface org.apache.activemq.artemis.core.server.plugin.ActiveMQServerSessionPlugin
duplicateSessionMetadataFailure
-
-
-
-
Field Detail
-
LOG_ALL_EVENTS
public static final String LOG_ALL_EVENTS
- See Also:
- Constant Field Values
-
LOG_CONNECTION_EVENTS
public static final String LOG_CONNECTION_EVENTS
- See Also:
- Constant Field Values
-
LOG_SESSION_EVENTS
public static final String LOG_SESSION_EVENTS
- See Also:
- Constant Field Values
-
LOG_CONSUMER_EVENTS
public static final String LOG_CONSUMER_EVENTS
- See Also:
- Constant Field Values
-
LOG_DELIVERING_EVENTS
public static final String LOG_DELIVERING_EVENTS
- See Also:
- Constant Field Values
-
LOG_SENDING_EVENTS
public static final String LOG_SENDING_EVENTS
- See Also:
- Constant Field Values
-
LOG_INTERNAL_EVENTS
public static final String LOG_INTERNAL_EVENTS
- See Also:
- Constant Field Values
-
UNAVAILABLE
public static final String UNAVAILABLE
- See Also:
- Constant Field Values
-
-
Method Detail
-
isLogAll
public boolean isLogAll()
-
isLogConnectionEvents
public boolean isLogConnectionEvents()
-
isLogSessionEvents
public boolean isLogSessionEvents()
-
isLogConsumerEvents
public boolean isLogConsumerEvents()
-
isLogDeliveringEvents
public boolean isLogDeliveringEvents()
-
isLogSendingEvents
public boolean isLogSendingEvents()
-
isLogInternalEvents
public boolean isLogInternalEvents()
-
init
public void init(Map<String,String> properties)
used to pass configured properties to Plugin- Specified by:
initin interfaceActiveMQServerBasePlugin- Parameters:
properties-
-
afterCreateConnection
public void afterCreateConnection(RemotingConnection connection) throws ActiveMQException
A connection has been created.- Specified by:
afterCreateConnectionin interfaceActiveMQServerConnectionPlugin- Parameters:
connection- The newly created connection- Throws:
ActiveMQException
-
afterDestroyConnection
public void afterDestroyConnection(RemotingConnection connection) throws ActiveMQException
A connection has been destroyed.- Specified by:
afterDestroyConnectionin interfaceActiveMQServerConnectionPlugin- Parameters:
connection-- Throws:
ActiveMQException
-
beforeCreateSession
public void beforeCreateSession(String name, String username, int minLargeMessageSize, RemotingConnection connection, boolean autoCommitSends, boolean autoCommitAcks, boolean preAcknowledge, boolean xa, String publicAddress, SessionCallback callback, boolean autoCreateQueues, OperationContext context, Map<SimpleString,RoutingType> prefixes) throws ActiveMQException
Before a session is created.- Specified by:
beforeCreateSessionin interfaceActiveMQServerSessionPlugin- Parameters:
name-username-minLargeMessageSize-connection-autoCommitSends-autoCommitAcks-preAcknowledge-xa-publicAddress-callback-autoCreateQueues-context-prefixes-- Throws:
ActiveMQException
-
afterCreateSession
public void afterCreateSession(ServerSession session) throws ActiveMQException
After a session has been created.- Specified by:
afterCreateSessionin interfaceActiveMQServerSessionPlugin- Parameters:
session- The newly created session- Throws:
ActiveMQException
-
beforeCloseSession
public void beforeCloseSession(ServerSession session, boolean failed) throws ActiveMQException
Before a session is closed- Specified by:
beforeCloseSessionin interfaceActiveMQServerSessionPlugin- Parameters:
session-failed-- Throws:
ActiveMQException
-
afterCloseSession
public void afterCloseSession(ServerSession session, boolean failed) throws ActiveMQException
After a session is closed- Specified by:
afterCloseSessionin interfaceActiveMQServerSessionPlugin- Parameters:
session-failed-- Throws:
ActiveMQException
-
beforeSessionMetadataAdded
public void beforeSessionMetadataAdded(ServerSession session, String key, String data) throws ActiveMQException
Before session metadata is added to the session- Specified by:
beforeSessionMetadataAddedin interfaceActiveMQServerSessionPlugin- Parameters:
session-key-data-- Throws:
ActiveMQException
-
afterSessionMetadataAdded
public void afterSessionMetadataAdded(ServerSession session, String key, String data) throws ActiveMQException
After session metadata is added to the session- Specified by:
afterSessionMetadataAddedin interfaceActiveMQServerSessionPlugin- Parameters:
session-key-data-- Throws:
ActiveMQException
-
beforeCreateConsumer
public void beforeCreateConsumer(long consumerID, QueueBinding queueBinding, SimpleString filterString, boolean browseOnly, boolean supportLargeMessage) throws ActiveMQExceptionBefore a consumer is created- Specified by:
beforeCreateConsumerin interfaceActiveMQServerConsumerPlugin- Parameters:
consumerID-queueBinding-filterString-browseOnly-supportLargeMessage-- Throws:
ActiveMQException
-
afterCreateConsumer
public void afterCreateConsumer(ServerConsumer consumer) throws ActiveMQException
After a consumer has been created- Specified by:
afterCreateConsumerin interfaceActiveMQServerConsumerPlugin- Parameters:
consumer- the created consumer- Throws:
ActiveMQException
-
beforeCloseConsumer
public void beforeCloseConsumer(ServerConsumer consumer, boolean failed) throws ActiveMQException
Before a consumer is closed- Specified by:
beforeCloseConsumerin interfaceActiveMQServerConsumerPlugin- Parameters:
consumer-failed-- Throws:
ActiveMQException
-
afterCloseConsumer
public void afterCloseConsumer(ServerConsumer consumer, boolean failed) throws ActiveMQException
After a consumer is closed- Specified by:
afterCloseConsumerin interfaceActiveMQServerConsumerPlugin- Parameters:
consumer-failed-- Throws:
ActiveMQException
-
beforeCreateQueue
public void beforeCreateQueue(QueueConfiguration queueConfig) throws ActiveMQException
Before a queue is created- Specified by:
beforeCreateQueuein interfaceActiveMQServerQueuePlugin- Parameters:
queueConfig-- Throws:
ActiveMQException
-
afterCreateQueue
public void afterCreateQueue(Queue queue) throws ActiveMQException
After a queue has been created- Specified by:
afterCreateQueuein interfaceActiveMQServerQueuePlugin- Parameters:
queue- The newly created queue- Throws:
ActiveMQException
-
beforeDestroyQueue
public void beforeDestroyQueue(SimpleString queueName, SecurityAuth session, boolean checkConsumerCount, boolean removeConsumers, boolean autoDeleteAddress) throws ActiveMQException
Before a queue is destroyed- Specified by:
beforeDestroyQueuein interfaceActiveMQServerQueuePlugin- Parameters:
queueName-session-checkConsumerCount-removeConsumers-autoDeleteAddress-- Throws:
ActiveMQException
-
afterDestroyQueue
public void afterDestroyQueue(Queue queue, SimpleString address, SecurityAuth session, boolean checkConsumerCount, boolean removeConsumers, boolean autoDeleteAddress) throws ActiveMQException
After a queue has been destroyed- Specified by:
afterDestroyQueuein interfaceActiveMQServerQueuePlugin- Parameters:
queue-address-session-checkConsumerCount-removeConsumers-autoDeleteAddress-- Throws:
ActiveMQException
-
beforeSend
public void beforeSend(ServerSession session, Transaction tx, Message message, boolean direct, boolean noAutoCreateQueue) throws ActiveMQException
Before a message is sent- Specified by:
beforeSendin interfaceActiveMQServerMessagePlugin- Parameters:
session- the session that sends the messagetx-message-direct-noAutoCreateQueue-- Throws:
ActiveMQException
-
afterSend
public void afterSend(ServerSession session, Transaction tx, Message message, boolean direct, boolean noAutoCreateQueue, RoutingStatus result) throws ActiveMQException
After a message is sent- Specified by:
afterSendin interfaceActiveMQServerMessagePlugin- Parameters:
session-tx-message-direct-noAutoCreateQueue-result-- Throws:
ActiveMQException
-
onSendException
public void onSendException(ServerSession session, Transaction tx, Message message, boolean direct, boolean noAutoCreateQueue, Exception e) throws ActiveMQException
Description copied from interface:ActiveMQServerMessagePluginWhen there was an exception sending the message- Specified by:
onSendExceptionin interfaceActiveMQServerMessagePlugine- the exception that occurred when sending the message- Throws:
ActiveMQException
-
beforeMessageRoute
public void beforeMessageRoute(Message message, RoutingContext context, boolean direct, boolean rejectDuplicates) throws ActiveMQException
Before a message is routed- Specified by:
beforeMessageRoutein interfaceActiveMQServerMessagePlugin- Parameters:
message-context-direct-rejectDuplicates-- Throws:
ActiveMQException
-
afterMessageRoute
public void afterMessageRoute(Message message, RoutingContext context, boolean direct, boolean rejectDuplicates, RoutingStatus result) throws ActiveMQException
After a message is routed- Specified by:
afterMessageRoutein interfaceActiveMQServerMessagePlugin- Parameters:
message-context-direct-rejectDuplicates-result-- Throws:
ActiveMQException
-
onMessageRouteException
public void onMessageRouteException(Message message, RoutingContext context, boolean direct, boolean rejectDuplicates, Exception e) throws ActiveMQException
Description copied from interface:ActiveMQServerMessagePluginWhen there was an error routing the message- Specified by:
onMessageRouteExceptionin interfaceActiveMQServerMessagePlugine- the exception that occurred during message routing- Throws:
ActiveMQException
-
beforeDeliver
public void beforeDeliver(ServerConsumer consumer, MessageReference reference) throws ActiveMQException
Before a message is delivered to a client consumer- Specified by:
beforeDeliverin interfaceActiveMQServerMessagePlugin- Parameters:
consumer- the consumer the message will be delivered toreference- message reference- Throws:
ActiveMQException
-
afterDeliver
public void afterDeliver(ServerConsumer consumer, MessageReference reference) throws ActiveMQException
After a message is delivered to a client consumer- Specified by:
afterDeliverin interfaceActiveMQServerMessagePlugin- Parameters:
consumer- the consumer the message was delivered toreference- message reference- Throws:
ActiveMQException
-
messageExpired
public void messageExpired(MessageReference message, SimpleString messageExpiryAddress, ServerConsumer consumer)
Description copied from interface:ActiveMQServerMessagePluginA message has been expired- Specified by:
messageExpiredin interfaceActiveMQServerMessagePlugin- Parameters:
message- The expired messagemessageExpiryAddress- The message expiry address if existsconsumer- the Consumer that acknowledged the message - this field is optional and can be null
-
messageAcknowledged
public void messageAcknowledged(Transaction tx, MessageReference ref, AckReason reason, ServerConsumer consumer) throws ActiveMQException
A message has been acknowledged- Specified by:
messageAcknowledgedin interfaceActiveMQServerMessagePlugin- Parameters:
tx- The transaction for the ackref- The acked messagereason- The ack reasonconsumer- The consumer acking the ref- Throws:
ActiveMQException
-
beforeDeployBridge
public void beforeDeployBridge(BridgeConfiguration config) throws ActiveMQException
Before a bridge is deployed- Specified by:
beforeDeployBridgein interfaceActiveMQServerBridgePlugin- Parameters:
config- The bridge configuration- Throws:
ActiveMQException
-
afterDeployBridge
public void afterDeployBridge(Bridge bridge) throws ActiveMQException
After a bridge has been deployed- Specified by:
afterDeployBridgein interfaceActiveMQServerBridgePlugin- Parameters:
bridge- The newly deployed bridge- Throws:
ActiveMQException
-
criticalFailure
public void criticalFailure(CriticalComponent components) throws ActiveMQException
A Critical failure has been detected. This will be called before the broker is stopped- Specified by:
criticalFailurein interfaceActiveMQServerCriticalPlugin- Parameters:
components-- Throws:
ActiveMQException
-
-