Package zipkin2.reporter.activemq
Class ActiveMQSender
- java.lang.Object
-
- zipkin2.reporter.Component
-
- zipkin2.reporter.Sender
-
- zipkin2.reporter.activemq.ActiveMQSender
-
- All Implemented Interfaces:
Closeable,BytesMessageSender
public final class ActiveMQSender extends 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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classActiveMQSender.Builder-
Nested classes/interfaces inherited from interface zipkin2.reporter.BytesMessageSender
BytesMessageSender.Base
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description CheckResultcheck()Deprecated.voidclose()static ActiveMQSendercreate(String brokerUrl)Encodingencoding()intmessageMaxBytes()intmessageSizeInBytes(int encodedSizeInBytes)intmessageSizeInBytes(List<byte[]> encodedSpans)static ActiveMQSender.BuildernewBuilder()voidsend(List<byte[]> encodedSpans)Call<Void>sendSpans(List<byte[]> encodedSpans)Deprecated.StringtoString()
-
-
-
Method Detail
-
create
public static ActiveMQSender create(String brokerUrl)
-
newBuilder
public static ActiveMQSender.Builder newBuilder()
-
encoding
public Encoding encoding()
-
messageMaxBytes
public int messageMaxBytes()
-
messageSizeInBytes
public int messageSizeInBytes(int encodedSizeInBytes)
- Specified by:
messageSizeInBytesin interfaceBytesMessageSender- Overrides:
messageSizeInBytesin classSender
-
messageSizeInBytes
public int messageSizeInBytes(List<byte[]> encodedSpans)
-
sendSpans
@Deprecated public Call<Void> sendSpans(List<byte[]> encodedSpans)
Deprecated.
-
send
public void send(List<byte[]> encodedSpans) throws IOException
- Specified by:
sendin interfaceBytesMessageSender- Overrides:
sendin classSender- Throws:
IOException
-
check
@Deprecated public CheckResult check()
Deprecated.
-
close
public void close()
-
-