Class MessageUtil
- java.lang.Object
-
- org.tkit.rhpam.quarkus.messaging.common.MessageUtil
-
public final class MessageUtil extends Object
The message properties
-
-
Field Summary
Fields Modifier and Type Field Description static StringFAILED_STEP_DEEP_LINKThe constant FAILED_STEP_DEEP_LINK.static StringFAILED_STEP_ERROR_CODEThe constant FAILED_STEP_ERROR_CODE.static StringFAILED_STEP_ERROR_MSGThe constant FAILED_STEP_ERROR_MSG.static StringPROP_BEH_REFERENCED_STEP_NAMEBusiness error handlers ref step namestatic StringPROP_BEH_RESOLUTION_ACTIONSBusiness error handlers ref resolution optionsstatic StringPROP_BEH_RESOLUTION_SIGNAL_NAMEBusiness error handlers signal namestatic StringPROP_BOUNDARY_EVENT_IDKey for the boundaryEventId attributestatic StringPROP_CMDThe JMS command name property name.static StringPROP_DEPLOYMENT_IDThe JMS deployment ID property name.static StringPROP_DUPLICATE_DETECTION_IDEnabling duplicate message detection for sent messages is simple: you just need to set a special property on the message to a unique value.static StringPROP_EXECUTION_IDThe execution id message property name.static StringPROP_KIE_EXECUTION_DATEThe process execution date message property name.static StringPROP_KIE_LISTENER_TYPEThe process listener type message property name.static StringPROP_KIE_NODE_IDThe process node ID message property name.static StringPROP_KIE_NODE_NAMEThe node name message property name.static StringPROP_KIE_NODE_TYPEThe node type message property name.static StringPROP_KIE_PROCESS_LOG_EVENTThe process log event message property.static StringPROP_PARENT_PROCESS_IDThe constant PROP_PARENT_PROCESS_ID.static StringPROP_PARENT_PROCESS_INSTANCE_IDThe process parent process instance ID message property name.static StringPROP_PROCESS_ERRORProperty for process errorstatic StringPROP_PROCESS_EXEC_LOG_GUIDThe process execution log GUID property name.static StringPROP_PROCESS_IDThe JMS process ID property name.static StringPROP_PROCESS_INSTANCE_IDThe JMS process instance ID property name.static StringPROP_PROCESS_LOG_GUIDThe process log GUID property name.static StringPROP_PROCESS_NAMEThe process process name message property name.static StringPROP_PROCESS_OUTCOMEProperty for process outcomestatic StringPROP_PROCESS_STATEProcess statestatic StringPROP_PROCESS_VERSIONThe process process version message property name.static StringPROP_REFERENCE_BIDThe reference id.static StringPROP_REFERENCE_KEYThe reference key.static StringPROP_SIGNAL_DATAThe JMS signal data property name.static StringPROP_SIGNAL_IDThe JMS signal ID property name.static StringPROP_TIMER_IDThe JMS timer ID property name.static StringPROP_TKIT_CORRELATION_IDThe Correlation id property.static StringPROP_TKIT_RESOLUTION_STATUSThe Resolution status property.static StringPROP_TKIT_SUB_PROCESS_IDThe constant PROP_TKIT_SUB_PROCESS_ID.static StringPROP_WORK_ITEM_IDThe JMS work item ID property name.static StringPROP_X_CORRELATION_IDX correlation idstatic StringRESPONSE_QUEUEThe response queue.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringdateToString(Date date)Date to string string.static <T> Tdeserialize(String data)Deserialize the data to string for the database.static Map<String,Object>deserializeBody(org.eclipse.microprofile.reactive.messaging.Message<String> message)Deserialize the message to the map of data.static <T extends Enum<T>>
TgetEnumProperty(org.eclipse.microprofile.reactive.messaging.Message msg, String name, Class<T> clazz)Gets the message enum property.static <T> TgetProperty(org.eclipse.microprofile.reactive.messaging.Message msg, String name)Gets the message property.static DategetStringDateProperty(org.eclipse.microprofile.reactive.messaging.Message<String> msg, String name, Date defaultDate)Gets the message property.static Stringserialize(Object data)Serialize the data to string for the database.static StringserializeBody(Map<String,Object> data)Serialize the data to string for the TextMessage.static DatestringToDate(String value, Date defaultValue)Converts the string to date.
-
-
-
Field Detail
-
FAILED_STEP_ERROR_CODE
public static final String FAILED_STEP_ERROR_CODE
The constant FAILED_STEP_ERROR_CODE.- See Also:
- Constant Field Values
-
FAILED_STEP_ERROR_MSG
public static final String FAILED_STEP_ERROR_MSG
The constant FAILED_STEP_ERROR_MSG.- See Also:
- Constant Field Values
-
FAILED_STEP_DEEP_LINK
public static final String FAILED_STEP_DEEP_LINK
The constant FAILED_STEP_DEEP_LINK.- See Also:
- Constant Field Values
-
PROP_PARENT_PROCESS_ID
public static final String PROP_PARENT_PROCESS_ID
The constant PROP_PARENT_PROCESS_ID.- See Also:
- Constant Field Values
-
PROP_TKIT_SUB_PROCESS_ID
public static final String PROP_TKIT_SUB_PROCESS_ID
The constant PROP_TKIT_SUB_PROCESS_ID.- See Also:
- Constant Field Values
-
PROP_PROCESS_STATE
public static final String PROP_PROCESS_STATE
Process state- See Also:
- Constant Field Values
-
PROP_CMD
public static final String PROP_CMD
The JMS command name property name.- See Also:
- Constant Field Values
-
RESPONSE_QUEUE
public static final String RESPONSE_QUEUE
The response queue.- See Also:
- Constant Field Values
-
PROP_PROCESS_INSTANCE_ID
public static final String PROP_PROCESS_INSTANCE_ID
The JMS process instance ID property name.- See Also:
- Constant Field Values
-
PROP_DEPLOYMENT_ID
public static final String PROP_DEPLOYMENT_ID
The JMS deployment ID property name.- See Also:
- Constant Field Values
-
PROP_PROCESS_ID
public static final String PROP_PROCESS_ID
The JMS process ID property name.- See Also:
- Constant Field Values
-
PROP_PROCESS_NAME
public static final String PROP_PROCESS_NAME
The process process name message property name.- See Also:
- Constant Field Values
-
PROP_WORK_ITEM_ID
public static final String PROP_WORK_ITEM_ID
The JMS work item ID property name.- See Also:
- Constant Field Values
-
PROP_SIGNAL_ID
public static final String PROP_SIGNAL_ID
The JMS signal ID property name.- See Also:
- Constant Field Values
-
PROP_SIGNAL_DATA
public static final String PROP_SIGNAL_DATA
The JMS signal data property name.- See Also:
- Constant Field Values
-
PROP_TKIT_RESOLUTION_STATUS
public static final String PROP_TKIT_RESOLUTION_STATUS
The Resolution status property.- See Also:
- Constant Field Values
-
PROP_TKIT_CORRELATION_ID
public static final String PROP_TKIT_CORRELATION_ID
The Correlation id property.- See Also:
- Constant Field Values
-
PROP_KIE_NODE_ID
public static final String PROP_KIE_NODE_ID
The process node ID message property name.- See Also:
- Constant Field Values
-
PROP_KIE_LISTENER_TYPE
public static final String PROP_KIE_LISTENER_TYPE
The process listener type message property name.- See Also:
- Constant Field Values
-
PROP_KIE_NODE_NAME
public static final String PROP_KIE_NODE_NAME
The node name message property name.- See Also:
- Constant Field Values
-
PROP_KIE_NODE_TYPE
public static final String PROP_KIE_NODE_TYPE
The node type message property name.- See Also:
- Constant Field Values
-
PROP_KIE_EXECUTION_DATE
public static final String PROP_KIE_EXECUTION_DATE
The process execution date message property name.- See Also:
- Constant Field Values
-
PROP_PARENT_PROCESS_INSTANCE_ID
public static final String PROP_PARENT_PROCESS_INSTANCE_ID
The process parent process instance ID message property name.- See Also:
- Constant Field Values
-
PROP_PROCESS_VERSION
public static final String PROP_PROCESS_VERSION
The process process version message property name.- See Also:
- Constant Field Values
-
PROP_KIE_PROCESS_LOG_EVENT
public static final String PROP_KIE_PROCESS_LOG_EVENT
The process log event message property.- See Also:
- Constant Field Values
-
PROP_PROCESS_LOG_GUID
public static final String PROP_PROCESS_LOG_GUID
The process log GUID property name.- See Also:
- Constant Field Values
-
PROP_PROCESS_EXEC_LOG_GUID
public static final String PROP_PROCESS_EXEC_LOG_GUID
The process execution log GUID property name.- See Also:
- Constant Field Values
-
PROP_EXECUTION_ID
public static final String PROP_EXECUTION_ID
The execution id message property name.- See Also:
- Constant Field Values
-
PROP_REFERENCE_BID
public static final String PROP_REFERENCE_BID
The reference id.- See Also:
- Constant Field Values
-
PROP_REFERENCE_KEY
public static final String PROP_REFERENCE_KEY
The reference key.- See Also:
- Constant Field Values
-
PROP_BOUNDARY_EVENT_ID
public static final String PROP_BOUNDARY_EVENT_ID
Key for the boundaryEventId attribute- See Also:
- Constant Field Values
-
PROP_TIMER_ID
public static final String PROP_TIMER_ID
The JMS timer ID property name.- See Also:
- Constant Field Values
-
PROP_PROCESS_OUTCOME
public static final String PROP_PROCESS_OUTCOME
Property for process outcome- See Also:
- Constant Field Values
-
PROP_PROCESS_ERROR
public static final String PROP_PROCESS_ERROR
Property for process error- See Also:
- Constant Field Values
-
PROP_X_CORRELATION_ID
public static final String PROP_X_CORRELATION_ID
X correlation id- See Also:
- Constant Field Values
-
PROP_DUPLICATE_DETECTION_ID
public static final String PROP_DUPLICATE_DETECTION_ID
Enabling duplicate message detection for sent messages is simple: you just need to set a special property on the message to a unique value. You can create the value however you like, as long as it is unique. When the target server receives the message it will check if that property is set, if it is, then it will check in its in memory cache if it has already received a message with that value of the header. If it has received a message with the same value before then it will ignore the message.
-
PROP_BEH_REFERENCED_STEP_NAME
public static final String PROP_BEH_REFERENCED_STEP_NAME
Business error handlers ref step name- See Also:
- Constant Field Values
-
PROP_BEH_RESOLUTION_SIGNAL_NAME
public static final String PROP_BEH_RESOLUTION_SIGNAL_NAME
Business error handlers signal name- See Also:
- Constant Field Values
-
PROP_BEH_RESOLUTION_ACTIONS
public static final String PROP_BEH_RESOLUTION_ACTIONS
Business error handlers ref resolution options- See Also:
- Constant Field Values
-
-
Method Detail
-
getProperty
public static <T> T getProperty(org.eclipse.microprofile.reactive.messaging.Message msg, String name)Gets the message property. Check if the property exists.- Type Parameters:
T- the property type.- Parameters:
msg- the message.name- the property name.- Returns:
- the property value.
-
getStringDateProperty
public static Date getStringDateProperty(org.eclipse.microprofile.reactive.messaging.Message<String> msg, String name, Date defaultDate)
Gets the message property. Check if the property exists.- Parameters:
msg- the message.name- the property name.defaultDate- the default date.- Returns:
- the property date.
-
getEnumProperty
public static <T extends Enum<T>> T getEnumProperty(org.eclipse.microprofile.reactive.messaging.Message msg, String name, Class<T> clazz)
Gets the message enum property. Check if the property exists.- Type Parameters:
T- the type parameter- Parameters:
msg- the message.name- the property name.clazz- the property enum type.- Returns:
- the property value.
-
serializeBody
public static String serializeBody(Map<String,Object> data) throws IOException
Serialize the data to string for the TextMessage.- Parameters:
data- the data.- Returns:
- the corresponding string value.
- Throws:
IOException- if the serialization fails.
-
deserialize
public static <T> T deserialize(String data)
Deserialize the data to string for the database.- Type Parameters:
T- type of object to deserialize to- Parameters:
data- the data.- Returns:
- the corresponding string value or
nullif the data is null.
-
serialize
public static String serialize(Object data)
Serialize the data to string for the database.- Parameters:
data- the data.- Returns:
- the corresponding string value or
nullif the data is null.
-
deserializeBody
public static Map<String,Object> deserializeBody(org.eclipse.microprofile.reactive.messaging.Message<String> message) throws IOException
Deserialize the message to the map of data.- Parameters:
message- the message with the string content.- Returns:
- the corresponding map of data.
- Throws:
IOException- if the deserialization of the body fails.
-
stringToDate
public static Date stringToDate(String value, Date defaultValue)
Converts the string to date.- Parameters:
value- the string value.defaultValue- the default value.- Returns:
- the corresponding date value.
-
-