
Interface IMessage<T>
- Type Parameters:
T
- the type of the message payload. In most cases, T will be a subclass ofBaseJsonMessage
- All Known Implementing Classes:
BaseJsonMessage
,ResourceOperationJsonMessage
public interface IMessage<T>
This interface is implemented by serializable "wrapper" message classes that are exchanged with Massage Brokers. HAPI-FHIR
message classes implement both
Message
and IMessage
so that they can
be exchanged with both JMS and non-JMS brokers. These message wrappers wrap a serializable payload that is the main content
of the message. This wrapper also contains meta-data about the message such as headers and a message key. The message key
is used by non-JMS brokers for partition selection.-
Method Details
-
getMessageKey
The message key is used by brokers that support channel partitioning. The message key is used to determine which partition a message is stored on. If message order is important, then the same message key should be used for all messages that need to preserve their order. E.g. if a series of messages create, update, and delete a resource, the resource id would be a good candidate for the message key to ensure the order of operations is preserved on all messages concerning that resource.- Returns:
- the key of the message.
-
getHeaders
- Returns:
- a map of message headers
-
getHeader
- Returns:
- a header value as an Optional
-
getPayload
T getPayload()- Returns:
- the de-serialized value of the message
-