Class ReactiveMessagingTracingDecorator

  • All Implemented Interfaces:
    io.smallrye.reactive.messaging.PublisherDecorator, io.smallrye.reactive.messaging.SubscriberDecorator, jakarta.enterprise.inject.spi.Prioritized

    @ApplicationScoped
    public class ReactiveMessagingTracingDecorator
    extends Object
    implements io.smallrye.reactive.messaging.PublisherDecorator, io.smallrye.reactive.messaging.SubscriberDecorator
    Intercepts incoming and outgoing messages from Reactive Messaging connectors.

    For incoming messages, it fetches OpenTelemetry context from the message and attaches to the duplicated context of the message. Consumer methods will be called on this duplicated context, so the OpenTelemetry context associated with the incoming message will be propagated.

    For outgoing messages, if the message doesn't already contain a tracing metadata, it attaches one with the current OpenTelemetry context. Reactive messaging outbound connectors, if tracing is supported, will use that context as parent span to trace outbound message transmission.

    • Field Summary

      • Fields inherited from interface io.smallrye.reactive.messaging.PublisherDecorator

        DEFAULT_PRIORITY
      • Fields inherited from interface io.smallrye.reactive.messaging.SubscriberDecorator

        DEFAULT_PRIORITY
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      io.smallrye.mutiny.Multi<? extends org.eclipse.microprofile.reactive.messaging.Message<?>> decorate​(io.smallrye.mutiny.Multi<? extends org.eclipse.microprofile.reactive.messaging.Message<?>> publisher, String channelName, boolean isConnector)
      Incoming messages
      io.smallrye.mutiny.Multi<? extends org.eclipse.microprofile.reactive.messaging.Message<?>> decorate​(io.smallrye.mutiny.Multi<? extends org.eclipse.microprofile.reactive.messaging.Message<?>> toBeSubscribed, List<String> channelName, boolean isConnector)
      Outgoing messages
      int getPriority()  
    • Constructor Detail

      • ReactiveMessagingTracingDecorator

        public ReactiveMessagingTracingDecorator()
    • Method Detail

      • getPriority

        public int getPriority()
        Specified by:
        getPriority in interface jakarta.enterprise.inject.spi.Prioritized
        Specified by:
        getPriority in interface io.smallrye.reactive.messaging.PublisherDecorator
        Specified by:
        getPriority in interface io.smallrye.reactive.messaging.SubscriberDecorator
      • decorate

        public io.smallrye.mutiny.Multi<? extends org.eclipse.microprofile.reactive.messaging.Message<?>> decorate​(io.smallrye.mutiny.Multi<? extends org.eclipse.microprofile.reactive.messaging.Message<?>> publisher,
                                                                                                                   String channelName,
                                                                                                                   boolean isConnector)
        Incoming messages
        Specified by:
        decorate in interface io.smallrye.reactive.messaging.PublisherDecorator
      • decorate

        public io.smallrye.mutiny.Multi<? extends org.eclipse.microprofile.reactive.messaging.Message<?>> decorate​(io.smallrye.mutiny.Multi<? extends org.eclipse.microprofile.reactive.messaging.Message<?>> toBeSubscribed,
                                                                                                                   List<String> channelName,
                                                                                                                   boolean isConnector)
        Outgoing messages
        Specified by:
        decorate in interface io.smallrye.reactive.messaging.SubscriberDecorator