Fixed the kafka sender condition. fixes gh-985

This commit is contained in:
Marcin Grzejszczak
2018-05-23 10:23:19 +02:00
parent 70759b5ddd
commit 714802ca1d
4 changed files with 2 additions and 13 deletions

View File

@@ -887,9 +887,6 @@ The following example shows setting the sender type for `web`:
spring.zipkin.sender.type: web
----
IMPORTANT: If you have Kafka on the classpath, you need to set
`spring.zipkin.kafka.enabled` to `true` apart from setting the sender type.
To customize the `RestTemplate` that sends spans to Zipkin via HTTP, you can register
the `ZipkinRestTemplateCustomizer` bean.

View File

@@ -36,7 +36,7 @@ import zipkin2.reporter.kafka11.KafkaSender;
@ConditionalOnBean(KafkaProperties.class)
@ConditionalOnMissingBean(Sender.class)
@Conditional(ZipkinSenderCondition.class)
@ConditionalOnProperty(value = "spring.zipkin.kafka.enabled", havingValue = "true")
@ConditionalOnProperty(value = "spring.zipkin.sender.type", havingValue = "kafka")
class ZipkinKafkaSenderConfiguration {
@Value("${spring.zipkin.kafka.topic:zipkin}")
private String topic;

View File

@@ -1,8 +0,0 @@
{"properties": [
{
"name": "spring.zipkin.kafka.enabled",
"type": "java.lang.Boolean",
"description": "Should Kafka Zipkin sender be enabled. With Kafka on the classpath you have to set this value to true to send spans to Zipkin via Kafka.",
"defaultValue": false
}
]}

View File

@@ -125,7 +125,7 @@ public class ZipkinAutoConfigurationTests {
public void overrideKafkaTopic() throws Exception {
context = new AnnotationConfigApplicationContext();
addEnvironment(context, "spring.zipkin.kafka.topic:zipkin2",
"spring.zipkin.kafka.enabled:true");
"spring.zipkin.sender.type:kafka");
context.register(
PropertyPlaceholderAutoConfiguration.class,
KafkaAutoConfiguration.class,