public interface MessageService
Message
.Modifier and Type | Method and Description |
---|---|
Message |
findEagerMessageById(Long msgId)
Finds message by message ID with eager loading.
|
Message |
findMessageByCorrelationId(String correlationId,
ExternalSystemExtEnum systemEnum)
Finds message by message external system and correlation Id.
|
Message |
findMessageById(Long msgId)
Finds message by message ID.
|
List<Message> |
findMessagesByContent(String substring)
Finds message by substring in payload property.
|
int |
getCountMessages(MsgStateEnum state,
Integer interval)
Get count of messages in specific state.
|
int |
getCountProcessingMessagesForFunnel(String funnelValue,
int idleInterval,
String funnelCompId)
Get count of processing messages for specified funnel value and funnel ID.
|
List<Message> |
getMessagesForGuaranteedOrderForFunnel(String funnelValue,
int 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 |
insertMessage(Message message)
Inserts new message.
|
void |
insertMessages(Collection<Message> messages)
Inserts new messages.
|
void |
setFunnelComponentId(Message msg,
String funnelCompId)
Sets funnel component identifier to specified message.
|
void |
setStateFailed(Message msg,
ErrorExtEnum errCode,
String errDesc)
Changes state of the message to
MsgStateEnum.FAILED . |
void |
setStateFailed(Message msg,
Exception ex,
ErrorExtEnum errCode,
String customData,
Map<String,Object> props)
Changes state of the message to
MsgStateEnum.FAILED . |
void |
setStateOk(Message msg,
Map<String,Object> props)
Changes state of the message to
MsgStateEnum.OK . |
void |
setStatePartlyFailed(Message msg,
Exception ex,
ErrorExtEnum errCode,
String customData,
Map<String,Object> props)
Changes state of the message to
MsgStateEnum.PARTLY_FAILED . |
void |
setStatePartlyFailedWithoutError(Message msg)
Changes state of the message to
MsgStateEnum.PARTLY_FAILED but without increasing error count. |
void |
setStatePostponed(Message msg)
Changes state of the message to
MsgStateEnum.POSTPONED . |
void |
setStateProcessing(Message msg)
Changes state of the message to
MsgStateEnum.PROCESSING . |
void |
setStateWaiting(Message msg)
Changes state of the message to
MsgStateEnum.WAITING - only if the message hasn't been already processed. |
void |
setStateWaitingForResponse(Message msg)
Changes state of the message to
MsgStateEnum.WAITING_FOR_RES . |
static final String BEAN
void insertMessage(Message message)
message
- message that will be savedvoid insertMessages(Collection<Message> messages)
messages
- the collection of messagevoid setStateOk(@Header(value="processingMessage") Message msg, @Properties Map<String,Object> props)
MsgStateEnum.OK
.
If message is child message then method checks if all child messages of the parent message aren't processed.msg
- the messageprops
- the exchange properties [property name; property value]void setStateProcessing(Message msg)
MsgStateEnum.PROCESSING
.msg
- the messagevoid setStateWaiting(@Header(value="processingMessage") Message msg)
MsgStateEnum.WAITING
- only if the message hasn't been already processed.msg
- the messagevoid setStateWaitingForResponse(@Header(value="processingMessage") Message msg)
MsgStateEnum.WAITING_FOR_RES
.msg
- the messagevoid setStatePartlyFailedWithoutError(@Header(value="processingMessage") Message msg)
MsgStateEnum.PARTLY_FAILED
but without increasing error count.msg
- the messagevoid setStatePartlyFailed(@Header(value="processingMessage") Message msg, Exception ex, @ExchangeProperty(value="exceptionErrorCode")@Nullable ErrorExtEnum errCode, @ExchangeProperty(value="customData")@Nullable String customData, @Properties Map<String,Object> props)
MsgStateEnum.PARTLY_FAILED
.msg
- the messageex
- the exceptionerrCode
- the error code that can be explicitly defined if neededcustomData
- the custom dataprops
- the exchange properties [property name; property value]void setStateFailed(@Header(value="processingMessage") Message msg, Exception ex, @ExchangeProperty(value="exceptionErrorCode")@Nullable ErrorExtEnum errCode, @ExchangeProperty(value="customData")@Nullable String customData, @Properties Map<String,Object> props)
MsgStateEnum.FAILED
.
If message is child message then parent message will be marked as failed too.msg
- the messageex
- the exceptionerrCode
- the error code that can be explicitly defined if neededcustomData
- the custom dataprops
- the exchange properties [property name; property value]void setStateFailed(Message msg, ErrorExtEnum errCode, String errDesc)
MsgStateEnum.FAILED
.
If message is child message then parent message will be marked as failed too.msg
- the messageerrCode
- the error codeerrDesc
- the error description@Nullable Message findMessageById(Long msgId)
msgId
- the message IDnull
if not found message with specified ID@Nullable Message findEagerMessageById(Long msgId)
msgId
- the message IDnull
if not found message with specified ID@Nullable Message findMessageByCorrelationId(String correlationId, @Nullable ExternalSystemExtEnum systemEnum)
correlationId
- the correlation IDsystemEnum
- the external systemnull
if not found message with specified correlation IDList<Message> findMessagesByContent(String substring)
substring
- the substring of payload propertyempty list
if not found messages with substring in payload propertyint getCountMessages(MsgStateEnum state, @Nullable Integer interval)
state
- State of messageinterval
- searching messages updated after this interval (in seconds)int getCountProcessingMessagesForFunnel(String funnelValue, int 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, int 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
void setStatePostponed(@Header(value="processingMessage") Message msg)
MsgStateEnum.POSTPONED
.msg
- the messageCopyright © 2016. All rights reserved.