Class DurableQueuesMicrometerInterceptor
- java.lang.Object
-
- dk.cloudcreate.essentials.components.foundation.messaging.queue.micrometer.DurableQueuesMicrometerInterceptor
-
- All Implemented Interfaces:
DurableQueuesInterceptor,dk.cloudcreate.essentials.shared.interceptor.Interceptor
public class DurableQueuesMicrometerInterceptor extends Object implements DurableQueuesInterceptor
-
-
Field Summary
Fields Modifier and Type Field Description static StringPROCESSED_DEAD_LETTER_MESSAGES_COUNTER_NAMEstatic StringPROCESSED_QUEUED_MESSAGES_COUNTER_NAMEstatic StringPROCESSED_QUEUED_MESSAGES_RETRIES_COUNTER_NAMEstatic StringQUEUE_NAME_TAG_NAME
-
Constructor Summary
Constructors Constructor Description DurableQueuesMicrometerInterceptor(io.micrometer.core.instrument.MeterRegistry meterRegistry)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidincProcessedQueuedDeadLetterMessagesCount(QueueName queueName)protected voidincProcessedQueuedMessagesCount(QueueName queueName)protected voidincProcessedQueuedMessagesCount(QueueName queueName, int countIncrease)protected voidincQueuedMessagesRetriesCount(QueueName queueName)booleanintercept(DeleteMessage operation, dk.cloudcreate.essentials.shared.interceptor.InterceptorChain<DeleteMessage,Boolean,DurableQueuesInterceptor> interceptorChain)InterceptDeleteMessagecallsOptional<QueuedMessage>intercept(MarkAsDeadLetterMessage operation, dk.cloudcreate.essentials.shared.interceptor.InterceptorChain<MarkAsDeadLetterMessage,Optional<QueuedMessage>,DurableQueuesInterceptor> interceptorChain)InterceptMarkAsDeadLetterMessagecallsQueueEntryIdintercept(QueueMessageAsDeadLetterMessage operation, dk.cloudcreate.essentials.shared.interceptor.InterceptorChain<QueueMessageAsDeadLetterMessage,QueueEntryId,DurableQueuesInterceptor> interceptorChain)InterceptQueueMessageAsDeadLetterMessagecallsQueueEntryIdintercept(QueueMessage operation, dk.cloudcreate.essentials.shared.interceptor.InterceptorChain<QueueMessage,QueueEntryId,DurableQueuesInterceptor> interceptorChain)InterceptQueueMessagecallsList<QueueEntryId>intercept(QueueMessages operation, dk.cloudcreate.essentials.shared.interceptor.InterceptorChain<QueueMessages,List<QueueEntryId>,DurableQueuesInterceptor> interceptorChain)InterceptQueueMessagescallsOptional<QueuedMessage>intercept(ResurrectDeadLetterMessage operation, dk.cloudcreate.essentials.shared.interceptor.InterceptorChain<ResurrectDeadLetterMessage,Optional<QueuedMessage>,DurableQueuesInterceptor> interceptorChain)InterceptResurrectDeadLetterMessagecallsOptional<QueuedMessage>intercept(RetryMessage operation, dk.cloudcreate.essentials.shared.interceptor.InterceptorChain<RetryMessage,Optional<QueuedMessage>,DurableQueuesInterceptor> interceptorChain)InterceptRetryMessagecallsvoidsetDurableQueues(DurableQueues durableQueues)This method will be called by theDurableQueuesinstance that theDurableQueuesInterceptoris added to
-
-
-
Field Detail
-
PROCESSED_QUEUED_MESSAGES_COUNTER_NAME
public static final String PROCESSED_QUEUED_MESSAGES_COUNTER_NAME
- See Also:
- Constant Field Values
-
PROCESSED_QUEUED_MESSAGES_RETRIES_COUNTER_NAME
public static final String PROCESSED_QUEUED_MESSAGES_RETRIES_COUNTER_NAME
- See Also:
- Constant Field Values
-
PROCESSED_DEAD_LETTER_MESSAGES_COUNTER_NAME
public static final String PROCESSED_DEAD_LETTER_MESSAGES_COUNTER_NAME
- See Also:
- Constant Field Values
-
QUEUE_NAME_TAG_NAME
public static final String QUEUE_NAME_TAG_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
setDurableQueues
public void setDurableQueues(DurableQueues durableQueues)
Description copied from interface:DurableQueuesInterceptorThis method will be called by theDurableQueuesinstance that theDurableQueuesInterceptoris added to- Specified by:
setDurableQueuesin interfaceDurableQueuesInterceptor- Parameters:
durableQueues- the durable queue instance that this interceptor is added to
-
intercept
public QueueEntryId intercept(QueueMessage operation, dk.cloudcreate.essentials.shared.interceptor.InterceptorChain<QueueMessage,QueueEntryId,DurableQueuesInterceptor> interceptorChain)
Description copied from interface:DurableQueuesInterceptorInterceptQueueMessagecalls- Specified by:
interceptin interfaceDurableQueuesInterceptor- Parameters:
operation- the operationinterceptorChain- the interceptor chain (callInterceptorChain.proceed()to continue the processing chain)- Returns:
- the unique entry id for the message queued
-
intercept
public List<QueueEntryId> intercept(QueueMessages operation, dk.cloudcreate.essentials.shared.interceptor.InterceptorChain<QueueMessages,List<QueueEntryId>,DurableQueuesInterceptor> interceptorChain)
Description copied from interface:DurableQueuesInterceptorInterceptQueueMessagescalls- Specified by:
interceptin interfaceDurableQueuesInterceptor- Parameters:
operation- the operationinterceptorChain- the interceptor chain (callInterceptorChain.proceed()to continue the processing chain)- Returns:
- the unique entry id's for the messages queued, ordered in the same order as the payloads that were queued
-
intercept
public QueueEntryId intercept(QueueMessageAsDeadLetterMessage operation, dk.cloudcreate.essentials.shared.interceptor.InterceptorChain<QueueMessageAsDeadLetterMessage,QueueEntryId,DurableQueuesInterceptor> interceptorChain)
Description copied from interface:DurableQueuesInterceptorInterceptQueueMessageAsDeadLetterMessagecalls- Specified by:
interceptin interfaceDurableQueuesInterceptor- Parameters:
operation- the operationinterceptorChain- the interceptor chain (callInterceptorChain.proceed()to continue the processing chain)- Returns:
- the unique entry id for the message queued
-
intercept
public Optional<QueuedMessage> intercept(MarkAsDeadLetterMessage operation, dk.cloudcreate.essentials.shared.interceptor.InterceptorChain<MarkAsDeadLetterMessage,Optional<QueuedMessage>,DurableQueuesInterceptor> interceptorChain)
Description copied from interface:DurableQueuesInterceptorInterceptMarkAsDeadLetterMessagecalls- Specified by:
interceptin interfaceDurableQueuesInterceptor- Parameters:
operation- the operationinterceptorChain- the interceptor chain (callInterceptorChain.proceed()to continue the processing chain)- Returns:
- the
QueuedMessagemessage wrapped in anOptionalif the operation was successful, otherwise it returns anOptional.empty()
-
intercept
public boolean intercept(DeleteMessage operation, dk.cloudcreate.essentials.shared.interceptor.InterceptorChain<DeleteMessage,Boolean,DurableQueuesInterceptor> interceptorChain)
Description copied from interface:DurableQueuesInterceptorInterceptDeleteMessagecalls- Specified by:
interceptin interfaceDurableQueuesInterceptor- Parameters:
operation- the operationinterceptorChain- the interceptor chain (callInterceptorChain.proceed()to continue the processing chain)- Returns:
- true if the operation went well, otherwise false
-
intercept
public Optional<QueuedMessage> intercept(ResurrectDeadLetterMessage operation, dk.cloudcreate.essentials.shared.interceptor.InterceptorChain<ResurrectDeadLetterMessage,Optional<QueuedMessage>,DurableQueuesInterceptor> interceptorChain)
Description copied from interface:DurableQueuesInterceptorInterceptResurrectDeadLetterMessagecalls- Specified by:
interceptin interfaceDurableQueuesInterceptor- Parameters:
operation- the operationinterceptorChain- the interceptor chain (callInterceptorChain.proceed()to continue the processing chain)- Returns:
- the
QueuedMessagemessage wrapped in anOptionalif the operation was successful, otherwise it returns anOptional.empty()
-
intercept
public Optional<QueuedMessage> intercept(RetryMessage operation, dk.cloudcreate.essentials.shared.interceptor.InterceptorChain<RetryMessage,Optional<QueuedMessage>,DurableQueuesInterceptor> interceptorChain)
Description copied from interface:DurableQueuesInterceptorInterceptRetryMessagecalls- Specified by:
interceptin interfaceDurableQueuesInterceptor- Parameters:
operation- the operationinterceptorChain- the interceptor chain (callInterceptorChain.proceed()to continue the processing chain)- Returns:
- the
QueuedMessagemessage wrapped in anOptionalif the operation was successful, otherwise it returns anOptional.empty()
-
incProcessedQueuedMessagesCount
protected void incProcessedQueuedMessagesCount(QueueName queueName)
-
incProcessedQueuedMessagesCount
protected void incProcessedQueuedMessagesCount(QueueName queueName, int countIncrease)
-
incProcessedQueuedDeadLetterMessagesCount
protected void incProcessedQueuedDeadLetterMessagesCount(QueueName queueName)
-
incQueuedMessagesRetriesCount
protected void incQueuedMessagesRetriesCount(QueueName queueName)
-
-