public interface MessageDao
Message
entity.Modifier and Type | Method and Description |
---|---|
Message |
findByCorrelationId(String correlationId,
ExternalSystemExtEnum sourceSystem)
Finds message by source system and correlation ID.
|
List<Message> |
findChildMessages(Message msg)
Finds all child messages of specified parent message.
|
List<Message> |
findChildMessagesForParent(Message parentMessage)
Finds all child message for parent message.
|
Message |
findEagerMessage(Long msgId)
Finds message by its ID with eager loading.
|
Message |
findMessage(Long msgId)
Finds message by its ID.
|
List<Message> |
findMessagesByFilter(MessageFilter messageFilter,
long limit)
Finds messages by multiple fields, hold together in MessageFilter.
|
Message |
findPartlyFailedMessage(Duration interval)
Finds ONE message in state
MsgStateEnum.PARTLY_FAILED . |
Message |
findPostponedMessage(Duration interval)
Finds ONE message in state
MsgStateEnum.POSTPONED . |
List<Message> |
findProcessingMessages(Duration interval)
Finds processing messages to repair process.
|
int |
getCountMessages(MsgStateEnum state,
Duration interval)
Gets count of messages in specified state
|
int |
getCountProcessingMessagesForFunnel(String funnelValue,
Duration idleInterval,
String funnelCompId)
Gets count of processing messages (PROCESSING, WAITING, WAITING_FOR_RES) with same funnel value
and for specified funnel ID.
|
Message |
getMessage(Long msgId)
Gets message by its ID.
|
List<Message> |
getMessagesForGuaranteedOrderForFunnel(String funnelValue,
Duration idleInterval,
boolean excludeFailedState,
String funnelCompId)
Gets list of messages with specified funnel value for guaranteed processing order of messages
for specified funnel.
|
List<Message> |
getMessagesForGuaranteedOrderForRoute(String funnelValue,
boolean excludeFailedState)
Gets list of messages with specified funnel value for guaranteed processing order of whole routes.
|
void |
insert(Message msg)
Inserts new message.
|
void |
update(Message msg)
Updates message.
|
boolean |
updateMessageInQueueUnderLock(Message msg,
Node processingNode)
Updates
Message into state MsgStateEnum.IN_QUEUE (set start timestamp in queue)
- gets lock for message. |
boolean |
updateMessageProcessingUnderLock(Message msg,
Node processingNode)
Updates
Message into state MsgStateEnum.PROCESSING (set start timestamp of processing)
- gets lock for message. |
void insert(Message msg)
msg
- the messagevoid update(Message msg)
msg
- the message@Nullable Message findMessage(Long msgId)
msgId
- the message IDnull
if not available@Nullable Message findEagerMessage(Long msgId)
msgId
- the message IDnull
if not availableMessage getMessage(Long msgId)
msgId
- the message IDList<Message> findChildMessages(Message msg)
msg
- the messageList<Message> findChildMessagesForParent(Message parentMessage)
parentMessage
- parent message@Nullable Message findByCorrelationId(String correlationId, @Nullable ExternalSystemExtEnum sourceSystem)
correlationId
- correlation IDsourceSystem
- the source systemnull
if not available@Nullable Message findPartlyFailedMessage(Duration interval)
MsgStateEnum.PARTLY_FAILED
.interval
- Interval (in seconds) between two tries of partly failed messages.@Nullable Message findPostponedMessage(Duration interval)
MsgStateEnum.POSTPONED
.interval
- Interval (in seconds) after that can be postponed message processed againboolean updateMessageProcessingUnderLock(Message msg, Node processingNode)
Message
into state MsgStateEnum.PROCESSING
(set start timestamp of processing)
- gets lock for message.msg
- the messageprocessingNode
- node that process message from parametertrue
when update was successful otherwise false
boolean updateMessageInQueueUnderLock(Message msg, Node processingNode)
Message
into state MsgStateEnum.IN_QUEUE
(set start timestamp in queue)
- gets lock for message.msg
- the messageprocessingNode
- node that process message from parametertrue
when update was successful otherwise false
List<Message> findProcessingMessages(Duration interval)
interval
- Interval (in seconds) after that processing messages are probably in dead-lockint getCountMessages(MsgStateEnum state, @Nullable Duration interval)
state
- the stateinterval
- Interval (in seconds) after that messages must be updates; in other words get count
of messages updated in specified intervalint getCountProcessingMessagesForFunnel(String funnelValue, Duration idleInterval, String funnelCompId)
funnelValue
- the funnel valueidleInterval
- interval (in seconds) that determines how long can be message processingfunnelCompId
- the funnel component IDList<Message> getMessagesForGuaranteedOrderForRoute(String funnelValue, boolean excludeFailedState)
funnelValue
- the funnel valueexcludeFailedState
- FAILED
state is used by default;
use true
if you want to exclude FAILED statemessage timestamp
List<Message> getMessagesForGuaranteedOrderForFunnel(String funnelValue, Duration idleInterval, boolean excludeFailedState, String funnelCompId)
funnelValue
- the funnel valueidleInterval
- interval (in seconds) that determines how long can message be processingexcludeFailedState
- FAILED
state is used by default;
use true
if you want to exclude FAILED statefunnelCompId
- the funnel component IDmessage timestamp
List<Message> findMessagesByFilter(MessageFilter messageFilter, long limit)
messageFilter
- the filter.limit
- the limit of messages.Copyright © 2018 Pivotal Software, Inc.. All rights reserved.