Interface OutgoingInterceptor

All Superinterfaces:
jakarta.enterprise.inject.spi.Prioritized

@Experimental("Smallrye-only feature") public interface OutgoingInterceptor extends jakarta.enterprise.inject.spi.Prioritized
Interceptor for outgoing messages on connector channels.

To register an outgoing interceptor, expose a managed bean, implementing this interface, and qualified with @Identifier with the targeted channel name.

Only one interceptor is allowed to be bound for interception per outgoing channel. When multiple interceptors are available, implementation should override the getPriority() method.

  • Method Details

    • getPriority

      default int getPriority()
      Specified by:
      getPriority in interface jakarta.enterprise.inject.spi.Prioritized
    • onMessage

      @Deprecated(since="4.12.0") default Message<?> onMessage(Message<?> message)
      Called before message transmission
      Parameters:
      message - message to send
      Returns:
      the message to send, possibly mutated
    • beforeMessageSend

      default Message<?> beforeMessageSend(Message<?> message)
      Called before message transmission
      Parameters:
      message - message to send
      Returns:
      the message to send, possibly mutated
    • onMessageAck

      void onMessageAck(Message<?> message)
      Called after message acknowledgment
      Parameters:
      message - acknowledged message
    • onMessageNack

      void onMessageNack(Message<?> message, Throwable failure)
      Called after message negative-acknowledgement
      Parameters:
      message - message to negative-acknowledge
      failure - failure