Interface JMSObservation

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface JMSObservation
The observation of a message that a JMSMessageObserver started.
Since:
5.2.0
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    beforeSend(jakarta.jms.Message message)
    Called on the observation of a send once the message is created and its headers are set, just before it is sent, so properties added to the message, such as a trace context, are sent with it.
    void
    complete(@Nullable Throwable error)
    Completes the observation, on the thread that started it.
    default io.micronaut.core.propagation.PropagatedContext
    propagatedContext(io.micronaut.core.propagation.PropagatedContext context)
    Called on the observation of a message that a listener processes, before the listener method runs, to give the propagated context that the listener method and the success and error handlers run in, for example with the span of a trace added, so that it is current while they run and follows them to the threads that the context propagates to.
  • Method Details

    • beforeSend

      default void beforeSend(jakarta.jms.Message message)
      Called on the observation of a send once the message is created and its headers are set, just before it is sent, so properties added to the message, such as a trace context, are sent with it. Not called when the send fails before the message exists, nor on the observation of a message that a listener processes, whose message is given when the observation starts.
      Parameters:
      message - The message to send
    • propagatedContext

      default io.micronaut.core.propagation.PropagatedContext propagatedContext(io.micronaut.core.propagation.PropagatedContext context)
      Called on the observation of a message that a listener processes, before the listener method runs, to give the propagated context that the listener method and the success and error handlers run in, for example with the span of a trace added, so that it is current while they run and follows them to the threads that the context propagates to. Not called on the observation of a send.
      Parameters:
      context - The propagated context, with the elements of the observations started before this one
      Returns:
      The propagated context to process the message in, by default the given one
    • complete

      void complete(@Nullable Throwable error)
      Completes the observation, on the thread that started it.
      Parameters:
      error - The error that processing or sending the message failed with, or null