opentracing-contrib / opentracing-contrib/java-spring-cloud

opentracing-spring-cloud-starter breaks stomp client publish

Open
#301 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
399
Forks
143
Avg merge
1d 3h
Merged PRs (30d)
22

Description

As soon as I add opentracing-spring-cloud-starter:0.5.7 jar to my app I am no longer able to publish messages via stomp from client.

Client side subscribe works, and server publish messages are received on the client but the client can't publish as the following execption is received :

Exception in thread "clientInboundChannel-2" org.springframework.messaging.MessageDeliveryException: Failed to handle GenericMessage [payload=byte[2], headers={simpMessageType=MESSAGE, stompCommand=SEND, nativeHeaders={destination=[/queue/alternative-search], content-length=[2]}, simpSessionAttributes={}, simpHeartbeat=[J@28df87fe, opentracing.span=679eddba3b563c2e:679eddba3b563c2e:0:0 - /queue/alternative-search, id=1296640f-6ea0-5b7b-8706-b71243d6fd1f, simpSessionId=35c1c8b0-8047-e0b8-e728-e48972d77b0b, simpDestination=/queue/alternative-search, timestamp=1600508333518}] to org.springframework.messaging.support.ExecutorSubscribableChannel$SendTask@3d640f4d in StompBrokerRelay[ReactorNettyTcpClient[reactor.netty.tcp.TcpClientDoOn@9ba905b]]; nested exception is java.lang.IllegalStateException: No header accessor (not using the SimpMessagingTemplate?): GenericMessage [payload=byte[2], headers={simpMessageType=MESSAGE, stompCommand=SEND, nativeHeaders={destination=[/queue/alternative-search], content-length=[2]}, simpSessionAttributes={}, simpHeartbeat=[J@28df87fe, opentracing.span=679eddba3b563c2e:679eddba3b563c2e:0:0 - /queue/alternative-search, id=1296640f-6ea0-5b7b-8706-b71243d6fd1f, simpSessionId=35c1c8b0-8047-e0b8-e728-e48972d77b0b, simpDestination=/queue/alternative-search, timestamp=1600508333518}], failedMessage=GenericMessage [payload=byte[2], headers={simpMessageType=MESSAGE, stompCommand=SEND, nativeHeaders={destination=[/queue/alternative-search], content-length=[2]}, simpSessionAttributes={}, simpHeartbeat=[J@28df87fe, opentracing.span=679eddba3b563c2e:679eddba3b563c2e:0:0 - /queue/alternative-search, id=1296640f-6ea0-5b7b-8706-b71243d6fd1f, simpSessionId=35c1c8b0-8047-e0b8-e728-e48972d77b0b, simpDestination=/queue/alternative-search, timestamp=1600508333518}]
        at org.springframework.messaging.support.ExecutorSubscribableChannel$SendTask.run(ExecutorSubscribableChannel.java:153)
        at io.opentracing.contrib.concurrent.TracedRunnable.run(TracedRunnable.java:30)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.IllegalStateException: No header accessor (not using the SimpMessagingTemplate?): GenericMessage [payload=byte[2], headers={simpMessageType=MESSAGE, stompCommand=SEND, nativeHeaders={destination=[/queue/alternative-search], content-length=[2]}, simpSessionAttributes={}, simpHeartbeat=[J@28df87fe, opentracing.span=679eddba3b563c2e:679eddba3b563c2e:0:0 - /queue/alternative-search, id=1296640f-6ea0-5b7b-8706-b71243d6fd1f, simpSessionId=35c1c8b0-8047-e0b8-e728-e48972d77b0b, simpDestination=/queue/alternative-search, timestamp=1600508333518}]
        at org.springframework.messaging.simp.stomp.StompBrokerRelayMessageHandler.handleMessageInternal(StompBrokerRelayMessageHandler.java:499)
        at org.springframework.messaging.simp.broker.AbstractBrokerMessageHandler.handleMessage(AbstractBrokerMessageHandler.java:256)
        at org.springframework.messaging.support.ExecutorSubscribableChannel$SendTask.run(ExecutorSubscribableChannel.java:144)
        ... 4 more

Spring boot version 2.3.4.RELEASE

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing a STOMP client SEND with opentracing-spring-cloud-starter:0.5.7 on Spring Boot 2.3.4.RELEASE and inspect the stack trace at StompBrokerRelayMessageHandler.handleMessageInternal. Compare the failing client publish path with the working subscribe and server-publish paths. Done means client messages publish successfully without the "No header accessor" exception.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring, spring-boot
Domain
backend, distributed-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.