Not be found zipkin2.reporter.Sender with rabbit

502 views Asked by At

I deploy zipkin in docker (zipkin-server-2.21.7-exec.jar) and I connect with rabbit in docker. I'm using Eureka in docker to register microservices. When I run one this microservices this error compare

APPLICATION FAILED TO START


Description:

Parameter 2 of method reporter in org.springframework.cloud.sleuth.zipkin2.ZipkinAutoConfiguration required a bean of type 'zipkin2.reporter.Sender' that could not be found.

The following candidates were found but could not be injected:

  • Bean method 'rabbitSender' in 'ZipkinRabbitSenderConfiguration' not loaded because @ConditionalOnBean (types: org.springframework.amqp.rabbit.connection.CachingConnectionFactory; SearchStrategy: all) did not find any beans of type org.springframework.amqp.rabbit.connection.CachingConnectionFactory

  • Bean method 'restTemplateSender' in 'ZipkinRestTemplateSenderConfiguration' not loaded because ZipkinSender org.springframework.cloud.sleuth.zipkin2.sender.ZipkinRestTemplateSenderConfiguration rabbit sender type

Action:

Consider revisiting the entries above or defining a bean of type 'zipkin2.reporter.Sender' in your configuration.


I use this properties spring.zipkin.sender.type=rabbit spring.zipkin.base-url=http://zipkin-server:9411/

1

There are 1 answers

0
Paul Keogh On

I implemented my own configuration class as;

@Slf4j
@Configuration
public class TracingReportToRabbitConfiguration {

// Custom configuration for a Zipkin RabbitMQ Sender instantiation

@Bean(value="zipkinSender")
Sender sender(@Value("${spring.rabbitmq.addresses}") String rabbitmqHostUrl,
              @Value("${spring.rabbitmq.queue:zipkin}") String zipkinQueue,
              @Value("${spring.rabbitmq.username}") String username,
              @Value("${spring.rabbitmq.password}") String password,
              @Value("${spring.rabbitmq.ssl.enabled:false}") boolean useSSL) throws KeyManagementException, NoSuchAlgorithmException {
....

which works for me.