Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

default sender is Kafka when it is detected on the classpath #985

Closed
jorgheymans opened this issue May 22, 2018 · 3 comments

Comments

@jorgheymans
Copy link

@jorgheymans jorgheymans commented May 22, 2018

Enhancement

It seems that as soon as Kafka is on the classpath, spring.zipkin.sender.type is set to KAFKA. However unless kafka is nicely configured upfront, users will see their logs flooded with below stacktraces. This is not a nice out of the box experience and will send users on a stack overflow witch hunt. A much safer choice IMO would be to set WEB as the default, that one needs very few config options to work (just the zipkin base URL i think), and make users explicitly set sender.type when kafka is required.

2018-05-22 10:29:19.788 ERROR [localdev,,,] 14540 --- [ad | producer-1] o.a.k.clients.producer.internals.Sender  : [Producer clientId=producer-1] Uncaught error in kafka producer I/O thread: 

org.apache.kafka.common.protocol.types.SchemaException: Error reading field 'correlation_id': java.nio.BufferUnderflowException
	at org.apache.kafka.common.protocol.types.Schema.read(Schema.java:76) ~[kafka-clients-1.0.1.jar:na]
	at org.apache.kafka.common.requests.ResponseHeader.parse(ResponseHeader.java:61) ~[kafka-clients-1.0.1.jar:na]
	at org.apache.kafka.clients.NetworkClient.parseStructMaybeUpdateThrottleTimeMetrics(NetworkClient.java:584) ~[kafka-clients-1.0.1.jar:na]
	at org.apache.kafka.clients.NetworkClient.handleCompletedReceives(NetworkClient.java:686) ~[kafka-clients-1.0.1.jar:na]
	at org.apache.kafka.clients.NetworkClient.poll(NetworkClient.java:469) ~[kafka-clients-1.0.1.jar:na]
	at org.apache.kafka.clients.producer.internals.Sender.run(Sender.java:239) ~[kafka-clients-1.0.1.jar:na]
	at org.apache.kafka.clients.producer.internals.Sender.run(Sender.java:163) ~[kafka-clients-1.0.1.jar:na]
	at java.lang.Thread.run(Thread.java:748) [na:1.8.0_152]

2018-05-22 10:29:19.789 ERROR [localdev,,,] 14540 --- [ad | producer-1] o.a.k.clients.producer.internals.Sender  : [Producer clientId=producer-1] Uncaught error in kafka producer I/O thread: 

java.lang.IllegalStateException: There are no in-flight requests for node -1
	at org.apache.kafka.clients.InFlightRequests.requestQueue(InFlightRequests.java:58) ~[kafka-clients-1.0.1.jar:na]
	at org.apache.kafka.clients.InFlightRequests.completeNext(InFlightRequests.java:66) ~[kafka-clients-1.0.1.jar:na]
	at org.apache.kafka.clients.NetworkClient.handleCompletedReceives(NetworkClient.java:685) ~[kafka-clients-1.0.1.jar:na]
	at org.apache.kafka.clients.NetworkClient.poll(NetworkClient.java:469) ~[kafka-clients-1.0.1.jar:na]
	at org.apache.kafka.clients.producer.internals.Sender.run(Sender.java:239) ~[kafka-clients-1.0.1.jar:na]
	at org.apache.kafka.clients.producer.internals.Sender.run(Sender.java:163) ~[kafka-clients-1.0.1.jar:na]
	at java.lang.Thread.run(Thread.java:748) [na:1.8.0_152]

@marcingrzejszczak

This comment has been minimized.

Copy link
Contributor

@marcingrzejszczak marcingrzejszczak commented May 22, 2018

@jorgheymans can you check that it's working fine with the latest snapshots?

@jorgheymans

This comment has been minimized.

Copy link
Author

@jorgheymans jorgheymans commented May 22, 2018

@marcingrzejszczak what is the reason for needing both spring.zipkin.kafka.enabled=true and spring.zipkin.sender.type=kafka to enable kafka ? I'm sure there is a good reason, but from a user point of view it seems strange. I will have a look at the snapshots tomorrow.

@marcingrzejszczak

This comment has been minimized.

Copy link
Contributor

@marcingrzejszczak marcingrzejszczak commented May 22, 2018

Ah! Good point. If someone sets the type explicitly that should be enough

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.