Class ActiveMQSender

  • All Implemented Interfaces:
    Closeable, zipkin2.reporter.BytesMessageSender

    public final class ActiveMQSender
    extends zipkin2.reporter.Sender
    This sends (usually json v2) encoded spans to an ActiveMQ queue.

    Usage

    This type is designed for the async reporter.

    Here's a simple configuration, configured for json:

    
     sender = ActiveMQSender.create("failover:tcp://localhost:61616");
     

    Here's an example with an explicit connection factory and protocol buffers encoding:

    
     connectionFactory = new ActiveMQConnectionFactory(username, password, brokerUrl);
     connectionFactory.setClientIDPrefix("zipkin");
     connectionFactory.setConnectionIDPrefix("zipkin");
     sender = ActiveMQSender.newBuilder()
       .connectionFactory(connectionFactory)
       .encoding(Encoding.PROTO3)
       .build();
     

    Compatibility with Zipkin Server

    Zipkin server should be v2.15 or higher.

    Implementation Notes

    This sender is thread-safe.

    • Method Detail

      • encoding

        public zipkin2.reporter.Encoding encoding()
      • messageMaxBytes

        public int messageMaxBytes()
      • messageSizeInBytes

        public int messageSizeInBytes​(int encodedSizeInBytes)
        Specified by:
        messageSizeInBytes in interface zipkin2.reporter.BytesMessageSender
        Overrides:
        messageSizeInBytes in class zipkin2.reporter.Sender
      • messageSizeInBytes

        public int messageSizeInBytes​(List<byte[]> encodedSpans)
      • sendSpans

        @Deprecated
        public zipkin2.reporter.Call<Void> sendSpans​(List<byte[]> encodedSpans)
        Deprecated.
        Specified by:
        sendSpans in class zipkin2.reporter.Sender
      • send

        public void send​(List<byte[]> encodedSpans)
                  throws IOException
        Specified by:
        send in interface zipkin2.reporter.BytesMessageSender
        Overrides:
        send in class zipkin2.reporter.Sender
        Throws:
        IOException
      • check

        @Deprecated
        public zipkin2.reporter.CheckResult check()
        Deprecated.
        Overrides:
        check in class zipkin2.reporter.Component
      • close

        public void close()
        Specified by:
        close in interface Closeable
        Overrides:
        close in class zipkin2.reporter.Component