opentracing-contrib / opentracing-contrib/java-spring-cloud
Spring boot messaging Failed to serialize object caused by jaeger
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 399
- Forks
- 143
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 22
Description
I spent now 2 days trying to figure out how to solve this but I am out of luck..
We added java-spring-cloud-starter version 0.5.9 to our spring boot application v2.1.3
We have some DomainEvents that we need to serialize, we use MessageChannel of spring boot framework.
which creates a GenericMessage
https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/messaging/Message.html
Here is a snippet from our implementation
https://pastebin.com/n1ygDxhW
What I found out is that jaeger is adding something to this GenericMessage (see the stack trace below)
I don't know how to solve this issue and for me it looks like a bug...can anyone help me out? I could find anything in the interwebs.
org.springframework.messaging.MessageDeliveryException: failed to send Message to channel 'userEventGatewayInputChannel';
nested exception is org.springframework.core.serializer.support.SerializationFailedException: Failed to serialize object using JacksonMessageSerialization;
nested exception is com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class java.lang.Object and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS)
(through reference chain: org.springframework.messaging.support.GenericMessage["headers"]->
java.util.HashMap["io.opentracing.contrib.spring.integration.messaging.OpenTracingChannelInterceptor.SCOPE"]->
io.opentracing.util.ThreadLocalScope["wrapped"]->io.jaegertracing.internal.JaegerSpan["tracer"]->io.jaegertracing.internal.JaegerTracer["reporter"]->io.jaegertracing.internal.reporters.CompositeReporter["reporters"]->java.util.ArrayList[0]->io.jaegertracing.internal.reporters.RemoteReporter["sender"]->io.jaegertracing.thrift.internal.senders.UdpSender["agentClient"]->io.jaegertracing.agent.thrift.Agent$Client["iprot_"]->org.apache.thrift.protocol.TCompactProtocol["trans_"]->io.jaegertracing.thrift.internal.reporters.protocols.ThriftUdpTransport["socket"]->java.net.DatagramSocket["closeLock"])
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the implementation snippet at the linked Pastebin and trace the MessageChannel/GenericMessage path described in the report. Use the stack trace to investigate the JacksonMessageSerialization failure when tracing data is present, then reproduce it with the stated Spring Boot 2.1.3 and java-spring-cloud-starter 0.5.9 versions; done means DomainEvents serialize successfully with tracing enabled.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring-boot
- Domain
- backend, observability
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100