Package io.mats3

Interface MatsEndpoint.DetachedProcessContext

All Known Subinterfaces:
MatsEndpoint.ProcessContext<R>
All Known Implementing Classes:
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 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 to getFromAppName().
    • 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 to getFromAppVersion().
    • 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

      Set<String> getBytesKeys()
      Returns:
      the keys on which bytes lives.
    • getBytes

      byte[] getBytes(String key)
      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

      Set<String> getStringKeys()
      Returns:
      the keys on which strings lives.
    • getString

      String getString(String key)
      Get String "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

      <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. Read more on MatsEndpoint.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 class Object
      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!!