我正在使用spring-cloud-sleuth
和zipkin。在制作人中,它有效。我可以在kafka主题see image中看到消息。
但在消费者中,会发生一些例外。
2018-02-07 16:40:06.466 ERROR 936 --- [ -L-1] o.s.c.s.b.k.KafkaMessageChannelBinder : Could not convert message: 5B7B2274726163654964223A2232636663653036366431613439383339222C22706172656E744964223A2231616164373432393266356262346562222C226964223A2235343533313634396535343663633766222C226E616D65223A22726564697373657276696365696D706C2E657869737473222C2274696D657374616D70223A313531373938353237333932333030302C226475726174696F6E223A3234333733342C226C6F63616C456E64706F696E74223A7B22736572766963654E616D65223A226F7267732D736572766963652D70726F7669646572222C2269707634223A223139322E3136382E312E313737222C22706F7274223A383038307D2C22616E6E6F746174696F6E73223A5B7B2274696D657374616D70223A313531373938353237333932353030302C2276616C7565223A226D6574686F6443616C6C6564227D2C7B2274696D657374616D70223A313531373938353237343136373030302C2276616C7565223A226D6574686F64436F6D706C65746564227D5D2C2274616773223A7B2261726730223A22434845434B3A555345524C4F434B3A3135373537313636343531222C22636F737454696D65223A22323432227D7D2C7B2274726163654964223A2232636663653036366431613439383339222C22706172656E744964223A2231616164373432393266356262346562222C226964223A2235343533313634396535343663633766222C226E616D65223A22726564697373657276696365696D706C2E657869737473222C2274696D657374616D70223A313531373938353237333932333030302C226475726174696F6E223A3234333733342C226C6F63616C456E64706F696E74223A7B22736572766963654E616D65223A226F7267732D736572766963652D70726F7669646572222C2269707634223A223139322E3136382E312E313737222C22706F7274223A383038307D2C22616E6E6F746174696F6E73223A5B7B2274696D657374616D70223A313531373938353237333932353030302C2276616C7565223A226D6574686F6443616C6C6564227D2C7B2274696D657374616D70223A313531373938353237343136373030302C2276616C7565223A226D6574686F64436F6D706C65746564227D5D2C2274616773223A7B2261726730223A22434845434B3A555345524C4F434B3A3135373537313636343531222C22636F737454696D65223A22323432227D7D5D
java.lang.StringIndexOutOfBoundsException: String index out of range: 984
at java.lang.String.checkBounds(String.java:385) ~[na:1.8.0_91]
at java.lang.String.<init>(String.java:425) ~[na:1.8.0_91]
at org.springframework.cloud.stream.binder.EmbeddedHeaderUtils.oldExtractHeaders(EmbeddedHeaderUtils.java:157) ~[spring-cloud-stream-1.3.2.RELEASE.jar:1.3.2.RELEASE]
at org.springframework.cloud.stream.binder.EmbeddedHeaderUtils.extractHeaders(EmbeddedHeaderUtils.java:115) ~[spring-cloud-stream-1.3.2.RELEASE.jar:1.3.2.RELEASE]
at org.springframework.cloud.stream.binder.EmbeddedHeaderUtils.extractHeaders(EmbeddedHeaderUtils.java:107) ~[spring-cloud-stream-1.3.2.RELEASE.jar:1.3.2.RELEASE]
at org.springframework.cloud.stream.binder.AbstractMessageChannelBinder$ReceivingHandler.handleRequestMessage(AbstractMessageChannelBinder.java:546) ~[spring-cloud-stream-1.3.2.RELEASE.jar:1.3.2.RELEASE]
at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.handleMessageInternal(AbstractReplyProducingMessageHandler.java:109) [spring-integration-core-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:127) [spring-integration-core-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.integration.channel.FixedSubscriberChannel.send(FixedSubscriberChannel.java:70) [spring-integration-core-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.integration.channel.FixedSubscriberChannel.send(FixedSubscriberChannel.java:64) [spring-integration-core-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.messaging.core.GenericMessagingTemplate.doSend(GenericMessagingTemplate.java:115) [spring-messaging-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.messaging.core.GenericMessagingTemplate.doSend(GenericMessagingTemplate.java:45) [spring-messaging-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.messaging.core.AbstractMessageSendingTemplate.send(AbstractMessageSendingTemplate.java:105) [spring-messaging-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.integration.endpoint.MessageProducerSupport.sendMessage(MessageProducerSupport.java:188) [spring-integration-core-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.integration.kafka.inbound.KafkaMessageDrivenChannelAdapter.access$200(KafkaMessageDrivenChannelAdapter.java:63) [spring-integration-kafka-2.1.2.RELEASE.jar:na]
at org.springframework.integration.kafka.inbound.KafkaMessageDrivenChannelAdapter$IntegrationRecordMessageListener.onMessage(KafkaMessageDrivenChannelAdapter.java:372) [spring-integration-kafka-2.1.2.RELEASE.jar:na]
at org.springframework.integration.kafka.inbound.KafkaMessageDrivenChannelAdapter$IntegrationRecordMessageListener.onMessage(KafkaMessageDrivenChannelAdapter.java:352) [spring-integration-kafka-2.1.2.RELEASE.jar:na]
at org.springframework.kafka.listener.adapter.RetryingAcknowledgingMessageListenerAdapter$1.doWithRetry(RetryingAcknowledgingMessageListenerAdapter.java:79) [spring-kafka-1.1.7.RELEASE.jar:na]
at org.springframework.kafka.listener.adapter.RetryingAcknowledgingMessageListenerAdapter$1.doWithRetry(RetryingAcknowledgingMessageListenerAdapter.java:73) [spring-kafka-1.1.7.RELEASE.jar:na]
at org.springframework.retry.support.RetryTemplate.doExecute(RetryTemplate.java:287) [spring-retry-1.2.2.RELEASE.jar:na]
at org.springframework.retry.support.RetryTemplate.execute(RetryTemplate.java:180) [spring-retry-1.2.2.RELEASE.jar:na]
at org.springframework.kafka.listener.adapter.RetryingAcknowledgingMessageListenerAdapter.onMessage(RetryingAcknowledgingMessageListenerAdapter.java:73) [spring-kafka-1.1.7.RELEASE.jar:na]
at org.springframework.kafka.listener.adapter.RetryingAcknowledgingMessageListenerAdapter.onMessage(RetryingAcknowledgingMessageListenerAdapter.java:39) [spring-kafka-1.1.7.RELEASE.jar:na]
at org.springframework.kafka.listener.KafkaMessageListenerContainer$ListenerConsumer.invokeRecordListener(KafkaMessageListenerContainer.java:792) [spring-kafka-1.1.7.RELEASE.jar:na]
at org.springframework.kafka.listener.KafkaMessageListenerContainer$ListenerConsumer.invokeListener(KafkaMessageListenerContainer.java:736) [spring-kafka-1.1.7.RELEASE.jar:na]
at org.springframework.kafka.listener.KafkaMessageListenerContainer$ListenerConsumer.access$2100(KafkaMessageListenerContainer.java:246) [spring-kafka-1.1.7.RELEASE.jar:na]
at org.springframework.kafka.listener.KafkaMessageListenerContainer$ListenerConsumer$ListenerInvoker.run(KafkaMessageListenerContainer.java:1025) [spring-kafka-1.1.7.RELEASE.jar:na]
at java.util.concurrent.Executors$RunnableAdapter.call$$$capture(Executors.java:511) [na:1.8.0_91]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java) [na:1.8.0_91]
at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266) [na:1.8.0_91]
at java.util.concurrent.FutureTask.run(FutureTask.java) [na:1.8.0_91]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_91]
solve by this issue。 但是下一个例外无法解决。
2018-02-07 16:49:59.118 DEBUG 9600 --- [ -C-1] org.apache.kafka.clients.NetworkClient : Sending metadata request {topics=[sleuth]} to node -1
2018-02-07 16:49:59.120 DEBUG 9600 --- [ -C-1] org.apache.kafka.clients.Metadata : Updated cluster metadata version 2 to Cluster(id = GEfa9KsIQMSgQ6xN4DunVw, nodes = [192.168.1.231:9092 (id: 0 rack: null)], partitions = [Partition(topic = sleuth, partition = 0, leader = 0, replicas = [0,], isr = [0,])])
2018-02-07 16:49:59.121 DEBUG 9600 --- [ -C-1] o.a.k.c.c.internals.AbstractCoordinator : Received group coordinator response ClientResponse(receivedTimeMs=1517993399121, disconnected=false, request=ClientRequest(expectResponse=true, callback=org.apache.kafka.clients.consumer.internals.ConsumerNetworkClient$RequestFutureCompletionHandler@3e6a8d08, request=RequestSend(header={api_key=10,api_version=0,correlation_id=0,client_id=consumer-2}, body={group_id=sleuth}), createdTimeMs=1517993399016, sendTimeMs=1517993399119), responseBody={error_code=0,coordinator={node_id=0,host=192.168.1.231,port=9092}})
2018-02-07 16:49:59.122 INFO 9600 --- [ -C-1] o.a.k.c.c.internals.AbstractCoordinator : Discovered coordinator 192.168.1.231:9092 (id: 2147483647 rack: null) for group sleuth.
2018-02-07 16:49:59.122 DEBUG 9600 --- [ -C-1] org.apache.kafka.clients.NetworkClient : Initiating connection to node 2147483647 at 192.168.1.231:9092.
2018-02-07 16:49:59.125 INFO 9600 --- [ -C-1] o.a.k.c.c.internals.ConsumerCoordinator : Revoking previously assigned partitions [] for group sleuth
2018-02-07 16:49:59.125 INFO 9600 --- [ -C-1] o.s.c.s.b.k.KafkaMessageChannelBinder$3 : partitions revoked:[]
2018-02-07 16:49:59.125 DEBUG 9600 --- [ -C-1] essageListenerContainer$ListenerConsumer : Commit list: {}
2018-02-07 16:49:59.125 INFO 9600 --- [ -C-1] o.a.k.c.c.internals.AbstractCoordinator : (Re-)joining group sleuth
2018-02-07 16:49:59.128 DEBUG 9600 --- [ -C-1] o.a.k.c.c.internals.AbstractCoordinator : Sending JoinGroup ({group_id=sleuth,session_timeout=10000,rebalance_timeout=300000,member_id=,protocol_type=consumer,group_protocols=[{protocol_name=range,protocol_metadata=java.nio.HeapByteBuffer[pos=0 lim=18 cap=18]}]}) to coordinator 192.168.1.231:9092 (id: 2147483647 rack: null)
2018-02-07 16:49:59.131 DEBUG 9600 --- [ -C-1] org.apache.kafka.common.metrics.Metrics : Added sensor with name node-2147483647.bytes-sent
2018-02-07 16:49:59.131 DEBUG 9600 --- [ -C-1] org.apache.kafka.common.metrics.Metrics : Added sensor with name node-2147483647.bytes-received
2018-02-07 16:49:59.131 DEBUG 9600 --- [ -C-1] org.apache.kafka.common.metrics.Metrics : Added sensor with name node-2147483647.latency
2018-02-07 16:49:59.131 DEBUG 9600 --- [ -C-1] o.apache.kafka.common.network.Selector : Created socket with SO_RCVBUF = 65536, SO_SNDBUF = 131072, SO_TIMEOUT = 0 to node 2147483647
2018-02-07 16:49:59.131 DEBUG 9600 --- [ -C-1] org.apache.kafka.clients.NetworkClient : Completed connection to node 2147483647
2018-02-07 16:49:59.137 DEBUG 9600 --- [ -C-1] o.a.k.c.c.internals.AbstractCoordinator : Received successful join group response for group sleuth: {error_code=0,generation_id=68,group_protocol=range,leader_id=consumer-2-7954e52a-1126-429e-a76c-8d01890059bf,member_id=consumer-2-7954e52a-1126-429e-a76c-8d01890059bf,members=[{member_id=consumer-2-7954e52a-1126-429e-a76c-8d01890059bf,member_metadata=java.nio.HeapByteBuffer[pos=0 lim=18 cap=18]}]}
2018-02-07 16:49:59.138 DEBUG 9600 --- [ -C-1] o.a.k.c.c.internals.ConsumerCoordinator : Performing assignment for group sleuth using strategy range with subscriptions {consumer-2-7954e52a-1126-429e-a76c-8d01890059bf=Subscription(topics=[sleuth])}
2018-02-07 16:49:59.139 DEBUG 9600 --- [ -C-1] o.a.k.c.c.internals.ConsumerCoordinator : Finished assignment for group sleuth: {consumer-2-7954e52a-1126-429e-a76c-8d01890059bf=Assignment(partitions=[sleuth-0])}
2018-02-07 16:49:59.140 DEBUG 9600 --- [ -C-1] o.a.k.c.c.internals.AbstractCoordinator : Sending leader SyncGroup for group sleuth to coordinator 192.168.1.231:9092 (id: 2147483647 rack: null): {group_id=sleuth,generation_id=68,member_id=consumer-2-7954e52a-1126-429e-a76c-8d01890059bf,group_assignment=[{member_id=consumer-2-7954e52a-1126-429e-a76c-8d01890059bf,member_assignment=java.nio.HeapByteBuffer[pos=0 lim=26 cap=26]}]}
2018-02-07 16:49:59.154 INFO 9600 --- [ -C-1] o.a.k.c.c.internals.AbstractCoordinator : Successfully joined group sleuth with generation 68
2018-02-07 16:49:59.157 INFO 9600 --- [ -C-1] o.a.k.c.c.internals.ConsumerCoordinator : Setting newly assigned partitions [sleuth-0] for group sleuth
2018-02-07 16:49:59.159 DEBUG 9600 --- [ -C-1] o.a.k.c.c.internals.ConsumerCoordinator : Group sleuth fetching committed offsets for partitions: [sleuth-0]
2018-02-07 16:49:59.167 DEBUG 9600 --- [ -C-1] o.a.k.c.consumer.internals.Fetcher : Resetting offset for partition sleuth-0 to the committed offset 0
2018-02-07 16:49:59.168 DEBUG 9600 --- [ -C-1] essageListenerContainer$ListenerConsumer : Committing: {sleuth-0=OffsetAndMetadata{offset=0, metadata=''}}
2018-02-07 16:49:59.177 DEBUG 9600 --- [ -C-1] o.a.k.c.c.internals.ConsumerCoordinator : Group sleuth committed offset 0 for partition sleuth-0
2018-02-07 16:49:59.178 INFO 9600 --- [ -C-1] o.s.c.s.b.k.KafkaMessageChannelBinder$3 : partitions assigned:[sleuth-0]
2018-02-07 16:49:59.183 DEBUG 9600 --- [ -C-1] org.apache.kafka.clients.NetworkClient : Initiating connection to node 0 at 192.168.1.231:9092.
2018-02-07 16:49:59.184 DEBUG 9600 --- [ -C-1] org.apache.kafka.common.metrics.Metrics : Added sensor with name node-0.bytes-sent
2018-02-07 16:49:59.185 DEBUG 9600 --- [ -C-1] org.apache.kafka.common.metrics.Metrics : Added sensor with name node-0.bytes-received
2018-02-07 16:49:59.185 DEBUG 9600 --- [ -C-1] org.apache.kafka.common.metrics.Metrics : Added sensor with name node-0.latency
2018-02-07 16:49:59.185 DEBUG 9600 --- [ -C-1] o.apache.kafka.common.network.Selector : Created socket with SO_RCVBUF = 65536, SO_SNDBUF = 131072, SO_TIMEOUT = 0 to node 0
2018-02-07 16:49:59.185 DEBUG 9600 --- [ -C-1] org.apache.kafka.clients.NetworkClient : Completed connection to node 0
2018-02-07 16:49:59.201 DEBUG 9600 --- [ -C-1] org.apache.kafka.common.metrics.Metrics : Added sensor with name topic.sleuth.bytes-fetched
2018-02-07 16:49:59.202 DEBUG 9600 --- [ -C-1] org.apache.kafka.common.metrics.Metrics : Added sensor with name topic.sleuth.records-fetched
2018-02-07 16:49:59.203 DEBUG 9600 --- [ -C-1] essageListenerContainer$ListenerConsumer : Received: 24 records
2018-02-07 16:49:59.203 DEBUG 9600 --- [ -C-1] essageListenerContainer$ListenerConsumer : Commit list: {}
2018-02-07 16:49:59.205 DEBUG 9600 --- [ -L-1] o.s.retry.support.RetryTemplate : Retry: count=0
2018-02-07 16:49:59.208 DEBUG 9600 --- [ -L-1] actMessageChannelBinder$ReceivingHandler : org.springframework.cloud.stream.binder.AbstractMessageChannelBinder$ReceivingHandler@543ea989 received message: GenericMessage [payload=byte[891], headers={kafka_offset=0, kafka_receivedMessageKey=null, kafka_receivedPartitionId=0, kafka_receivedTopic=sleuth}]
2018-02-07 16:49:59.208 DEBUG 9600 --- [ -L-1] o.s.integration.channel.DirectChannel : preSend on channel 'sleuth', message: GenericMessage [payload=byte[891], headers={kafka_offset=0, kafka_receivedMessageKey=null, kafka_receivedPartitionId=0, kafka_receivedTopic=sleuth}]
2018-02-07 16:49:59.209 DEBUG 9600 --- [ -L-1] o.s.c.s.b.StreamListenerMessageHandler : org.springframework.cloud.stream.binding.StreamListenerMessageHandler@6ba060af received message: GenericMessage [payload=byte[891], headers={kafka_offset=0, kafka_receivedMessageKey=null, kafka_receivedPartitionId=0, kafka_receivedTopic=sleuth}]
2018-02-07 16:49:59.281 DEBUG 9600 --- [ -L-1] o.s.m.h.i.InvocableHandlerMethod : Failed to resolve argument 0 of type 'org.springframework.cloud.sleuth.stream.Spans'
org.springframework.messaging.converter.MessageConversionException: Could not read JSON: Can not deserialize instance of org.springframework.cloud.sleuth.stream.Spans out of START_ARRAY token
at [Source: [B@684e2f25; line: 1, column: 1]; nested exception is com.fasterxml.jackson.databind.JsonMappingException: Can not deserialize instance of org.springframework.cloud.sleuth.stream.Spans out of START_ARRAY token
at [Source: [B@684e2f25; line: 1, column: 1]
at org.springframework.messaging.converter.MappingJackson2MessageConverter.convertFromInternal(MappingJackson2MessageConverter.java:232) ~[spring-messaging-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.messaging.converter.AbstractMessageConverter.fromMessage(AbstractMessageConverter.java:175) ~[spring-messaging-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.messaging.converter.CompositeMessageConverter.fromMessage(CompositeMessageConverter.java:67) ~[spring-messaging-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.messaging.handler.annotation.support.PayloadArgumentResolver.resolveArgument(PayloadArgumentResolver.java:135) ~[spring-messaging-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.messaging.handler.invocation.HandlerMethodArgumentResolverComposite.resolveArgument(HandlerMethodArgumentResolverComposite.java:112) ~[spring-messaging-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.messaging.handler.invocation.InvocableHandlerMethod.getMethodArgumentValues(InvocableHandlerMethod.java:135) [spring-messaging-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.messaging.handler.invocation.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:107) [spring-messaging-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.cloud.stream.binding.StreamListenerMessageHandler.handleRequestMessage(StreamListenerMessageHandler.java:55) [spring-cloud-stream-1.3.2.RELEASE.jar:1.3.2.RELEASE]
at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.handleMessageInternal(AbstractReplyProducingMessageHandler.java:109) [spring-integration-core-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:127) [spring-integration-core-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.integration.dispatcher.AbstractDispatcher.tryOptimizedDispatch(AbstractDispatcher.java:116) [spring-integration-core-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.integration.dispatcher.UnicastingDispatcher.doDispatch(UnicastingDispatcher.java:148) [spring-integration-core-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.integration.dispatcher.UnicastingDispatcher.dispatch(UnicastingDispatcher.java:121) [spring-integration-core-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.integration.channel.AbstractSubscribableChannel.doSend(AbstractSubscribableChannel.java:89) [spring-integration-core-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:425) [spring-integration-core-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:375) [spring-integration-core-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.messaging.core.GenericMessagingTemplate.doSend(GenericMessagingTemplate.java:115) [spring-messaging-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.messaging.core.GenericMessagingTemplate.doSend(GenericMessagingTemplate.java:45) [spring-messaging-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.messaging.core.AbstractMessageSendingTemplate.send(AbstractMessageSendingTemplate.java:105) [spring-messaging-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.integration.handler.AbstractMessageProducingHandler.sendOutput(AbstractMessageProducingHandler.java:360) [spring-integration-core-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.integration.handler.AbstractMessageProducingHandler.produceOutput(AbstractMessageProducingHandler.java:271) [spring-integration-core-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.integration.handler.AbstractMessageProducingHandler.sendOutputs(AbstractMessageProducingHandler.java:188) [spring-integration-core-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.handleMessageInternal(AbstractReplyProducingMessageHandler.java:115) [spring-integration-core-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:127) [spring-integration-core-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.integration.channel.FixedSubscriberChannel.send(FixedSubscriberChannel.java:70) [spring-integration-core-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.integration.channel.FixedSubscriberChannel.send(FixedSubscriberChannel.java:64) [spring-integration-core-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.messaging.core.GenericMessagingTemplate.doSend(GenericMessagingTemplate.java:115) [spring-messaging-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.messaging.core.GenericMessagingTemplate.doSend(GenericMessagingTemplate.java:45) [spring-messaging-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.messaging.core.AbstractMessageSendingTemplate.send(AbstractMessageSendingTemplate.java:105) [spring-messaging-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.integration.endpoint.MessageProducerSupport.sendMessage(MessageProducerSupport.java:188) [spring-integration-core-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.integration.kafka.inbound.KafkaMessageDrivenChannelAdapter.access$200(KafkaMessageDrivenChannelAdapter.java:63) [spring-integration-kafka-2.1.2.RELEASE.jar:na]
at org.springframework.integration.kafka.inbound.KafkaMessageDrivenChannelAdapter$IntegrationRecordMessageListener.onMessage(KafkaMessageDrivenChannelAdapter.java:372) [spring-integration-kafka-2.1.2.RELEASE.jar:na]
at org.springframework.integration.kafka.inbound.KafkaMessageDrivenChannelAdapter$IntegrationRecordMessageListener.onMessage(KafkaMessageDrivenChannelAdapter.java:352) [spring-integration-kafka-2.1.2.RELEASE.jar:na]
at org.springframework.kafka.listener.adapter.RetryingAcknowledgingMessageListenerAdapter$1.doWithRetry(RetryingAcknowledgingMessageListenerAdapter.java:79) [spring-kafka-1.1.7.RELEASE.jar:na]
at org.springframework.kafka.listener.adapter.RetryingAcknowledgingMessageListenerAdapter$1.doWithRetry(RetryingAcknowledgingMessageListenerAdapter.java:73) [spring-kafka-1.1.7.RELEASE.jar:na]
at org.springframework.retry.support.RetryTemplate.doExecute(RetryTemplate.java:287) [spring-retry-1.2.2.RELEASE.jar:na]
at org.springframework.retry.support.RetryTemplate.execute(RetryTemplate.java:180) [spring-retry-1.2.2.RELEASE.jar:na]
at org.springframework.kafka.listener.adapter.RetryingAcknowledgingMessageListenerAdapter.onMessage(RetryingAcknowledgingMessageListenerAdapter.java:73) [spring-kafka-1.1.7.RELEASE.jar:na]
at org.springframework.kafka.listener.adapter.RetryingAcknowledgingMessageListenerAdapter.onMessage(RetryingAcknowledgingMessageListenerAdapter.java:39) [spring-kafka-1.1.7.RELEASE.jar:na]
at org.springframework.kafka.listener.KafkaMessageListenerContainer$ListenerConsumer.invokeRecordListener(KafkaMessageListenerContainer.java:792) [spring-kafka-1.1.7.RELEASE.jar:na]
at org.springframework.kafka.listener.KafkaMessageListenerContainer$ListenerConsumer.invokeListener(KafkaMessageListenerContainer.java:736) [spring-kafka-1.1.7.RELEASE.jar:na]
at org.springframework.kafka.listener.KafkaMessageListenerContainer$ListenerConsumer.access$2100(KafkaMessageListenerContainer.java:246) [spring-kafka-1.1.7.RELEASE.jar:na]
at org.springframework.kafka.listener.KafkaMessageListenerContainer$ListenerConsumer$ListenerInvoker.run(KafkaMessageListenerContainer.java:1025) [spring-kafka-1.1.7.RELEASE.jar:na]
at java.util.concurrent.Executors$RunnableAdapter.call$$$capture(Executors.java:511) [na:1.8.0_91]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java) [na:1.8.0_91]
at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266) [na:1.8.0_91]
at java.util.concurrent.FutureTask.run(FutureTask.java) [na:1.8.0_91]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_91]
项目信息
的pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>zipkin-stream-server</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.10.RELEASE</version>
<relativePath/>
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>Edgware.SR1</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-sleuth-zipkin-stream</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-stream-kafka</artifactId>
</dependency>
<dependency>
<groupId>io.zipkin.java</groupId>
<artifactId>zipkin-autoconfigure-ui</artifactId>
</dependency>
</dependencies>
</project>
application.yml
spring:
sleuth:
enabled: false
sampler:
percentage: 1.0
cloud:
stream:
kafka:
binder:
brokers: 192.168.1.231:9092
zkNodes: 192.168.1.231:2181
default:
consumer:
headerMode: raw
server:
port: 9411
logging:
level:
root: debug
main class
@EnableZipkinStreamServer
@SpringBootApplication
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
答案 0 :(得分:1)
不推荐使用Sleuth Stream。请使用zipkin
启动器,添加Kafka
依赖项并设置此处显示的内容https://cloud.spring.io/spring-cloud-static/Edgware.SR1/multi/multi__introduction.html#_sleuth_with_zipkin_via_rabbitmq_or_kafka