Package io.mats3
Interface MatsEndpoint.DetachedProcessContext
- All Known Subinterfaces:
MatsEndpoint.ProcessContext<R>
- All Known Implementing Classes:
JmsMatsProcessContext
,MatsEndpoint.ProcessContextWrapper
- Enclosing interface:
- MatsEndpoint<R,
S>
public static interface MatsEndpoint.DetachedProcessContext
The part of
MatsEndpoint.ProcessContext
that exposes the "getter" side of the context, which enables it to be exposed
outside of the process lambda. It is effectively the "passive" parts of the context, i.e. not initiating new
messages, setting properties etc. Look for usage in the "MatsFuturizer" tool in the tools-lib.-
Method Summary
Modifier and TypeMethodDescriptionbyte[]
Get binary "sideloads" from the incoming message.GetString
"sideloads" from the incoming message.<T> T
getTraceProperty
(String propertyName, Class<T> clazz) Retrieves the Mats Trace property with the specified name, deserializing the value to the specified class, using the active MATS serializer.boolean
This is relevant if stashing or otherwise when a stage is accessing an external system (e.g.boolean
Hint to monitoring/logging/auditing systems that this call flow is not very valuable to fully audit, typically because it is just a "getter" of information for display to a user, or is health check request to see if the endpoint is up and answers in a timely manner.boolean
This is relevant if stashing or otherwise when a stage is accessing an external system (e.g.toString()
-
Method Details
-
getTraceId
String getTraceId()- Returns:
- the
trace id
for the processed message. - See Also:
-
getEndpointId
String getEndpointId()- Returns:
- the endpointId that is processed, i.e. the id of this endpoint. Should probably never be necessary, but accessible for introspection.
-
getStageId
String getStageId()- Returns:
- the stageId that is processed, i.e. the id of this stage. It will be equal to
getEndpointId()
for the first stage in multi-stage-endpoint, and for the sole stage of a single-stage and terminator endpoint. Should probably never be necessary, but accessible for introspection.
-
getFromAppName
String getFromAppName()- Returns:
- the
AppName
of the MatsFactory from which the currently processing message came. Thus, if this message is the result of a 'next' call, it will be yourself.
-
getFromAppVersion
String getFromAppVersion()- Returns:
- the
AppVersion
of the MatsFactory from which the currently processing message came. Thus, if this message is the result of a 'next' call, it will be yourself.
-
getFromStageId
String getFromStageId()- Returns:
- the stageId from which the currently processing message came. Note that the stageId of the initial
stage of an endpoint is equal to the endpointId. If this endpoint is the initial target of the
initiation, this value is equal to
getInitiatorId()
.
-
getFromTimestamp
Instant getFromTimestamp()- Returns:
- the
Instant
which this message was created on the sending stage.
-
getInitiatingAppName
String getInitiatingAppName()- Returns:
- the
AppName
of the MatsFactory that initiated the Flow which the currently processing is a part of. Thus, if this endpoint is the initial target of the initiation, this value is equal togetFromAppName()
.
-
getInitiatingAppVersion
String getInitiatingAppVersion()- Returns:
- the
AppVersion
of the MatsFactory that initiated the Flow which the currently processing is a part of. Thus, if this endpoint is the initial target of the initiation, this value is equal togetFromAppVersion()
.
-
getInitiatorId
String getInitiatorId()- Returns:
- the "initiatorId" set by the initiation with
MatsInitiator.MatsInitiate.from(String)
.
-
getInitiatingTimestamp
Instant getInitiatingTimestamp()- Returns:
- the
Instant
which this message was initiated, i.e. sent from a MatsInitiator (or within a Stage).
-
getMatsMessageId
String getMatsMessageId()- Returns:
- the unique messageId for the incoming message from Mats - which can be used to catch double-deliveries.
-
getSystemMessageId
String getSystemMessageId()- Returns:
- the unique messageId for the incoming message, from the underlying message system - which could be
used to catch double-deliveries, but do prefer
getMatsMessageId()
. (For a JMS Implementation, this will be the "JMSMessageID").
-
isNonPersistent
boolean isNonPersistent()This is relevant if stashing or otherwise when a stage is accessing an external system (e.g. another MQ) which have a notion of persistence.- Returns:
- whether the current Mats flow is non-persistent - read
MatsInitiator.MatsInitiate.nonPersistent()
.
-
isInteractive
boolean isInteractive()This is relevant if stashing or otherwise when a stage is accessing an external system (e.g. another MQ) which have a notion of prioritization.- Returns:
- whether the current Mats flow is interactive (prioritized) - read
MatsInitiator.MatsInitiate.interactive()
.
-
isNoAudit
boolean isNoAudit()Hint to monitoring/logging/auditing systems that this call flow is not very valuable to fully audit, typically because it is just a "getter" of information for display to a user, or is health check request to see if the endpoint is up and answers in a timely manner.- Returns:
- whether the current Mats flow is "no audit" - read
MatsInitiator.MatsInitiate.noAudit()
.
-
getBytesKeys
- Returns:
- the keys on which
bytes
lives.
-
getBytes
Get binary "sideloads" from the incoming message.- Parameters:
key
- the key for which to retrieve a binary payload from the incoming message.- Returns:
- the requested byte array.
- See Also:
-
getStringKeys
- Returns:
- the keys on which
strings
lives.
-
getString
GetString
"sideloads" from the incoming message.- Parameters:
key
- the key for which to retrieve a String payload from the incoming message.- Returns:
- the requested String.
- See Also:
-
getTraceProperty
Retrieves the Mats Trace property with the specified name, deserializing the value to the specified class, using the active MATS serializer. Read more onMatsEndpoint.ProcessContext.setTraceProperty(String, Object)
.- Parameters:
propertyName
- the name of the Mats Trace property to retrieve.clazz
- the class to which the value should be deserialized.- Returns:
- the value of the Mats Trace property, deserialized as the specified class.
- See Also:
-
toString
String toString()- Overrides:
toString
in classObject
- Returns:
- a for-human-consumption, multi-line debug-String representing the current processing context, typically the "MatsTrace" up to the current stage. The format is utterly arbitrary, can and will change between versions and revisions, and shall NOT be used programmatically!!
-