Package zipkin2.reporter.activemq
Class ActiveMQSender
java.lang.Object
zipkin2.Component
zipkin2.reporter.Sender
zipkin2.reporter.activemq.ActiveMQSender
- All Implemented Interfaces:
Closeable,AutoCloseable
public final class ActiveMQSender extends Sender
This sends (usually json v2) encoded spans to an ActiveMQ queue.
Usage
This type is designed forthe 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 -
Method Summary
Modifier and Type Method Description zipkin2.CheckResultcheck()voidclose()static ActiveMQSendercreate(String brokerUrl)zipkin2.codec.Encodingencoding()intmessageMaxBytes()intmessageSizeInBytes(int encodedSizeInBytes)intmessageSizeInBytes(List<byte[]> encodedSpans)static ActiveMQSender.BuildernewBuilder()zipkin2.Call<Void>sendSpans(List<byte[]> encodedSpans)StringtoString()
-
Method Details
-
create
-
newBuilder
-
encoding
public zipkin2.codec.Encoding encoding() -
messageMaxBytes
public int messageMaxBytes()- Specified by:
messageMaxBytesin classSender
-
messageSizeInBytes
public int messageSizeInBytes(int encodedSizeInBytes)- Overrides:
messageSizeInBytesin classSender
-
messageSizeInBytes
- Specified by:
messageSizeInBytesin classSender
-
sendSpans
-
check
public zipkin2.CheckResult check()- Overrides:
checkin classzipkin2.Component
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classzipkin2.Component
-
toString
-