Closed tvirtualw closed 3 years ago
@tvirtualw Are you expecting this message history to be carried with the message to the consumer? If you filter out the header, the exception may disappear, but you also lose the header propagation. cc/ @artembilan
I agree. This has to be excluded from sending over the Pub/Sub. This is not a cloud trace, but rather local trace for the current application and should not be carried over the network.
Thanks, @artembilan!
I have enabled Spring Integration message history with the
@EnableMessageHistory
annotation.After that, sending a message to a PubSub topic via PubSubMessageHandler and then consuming it again from a PubSub subscription fails with the following exception.
I don't know much about the framework internals but I believe that
"!" + MessageHistory.HEADER_NAME
should be added toorg.springframework.cloud.gcp.pubsub.integration.PubSubHeaderMapper#outboundHeaderPatterns
to fix this.By adding this pattern manually like below, the exception disappears.
Unfortunately, the default patterns cannot be easily extended and need to be duplicated, which could lead to issues during version upgrades.
Spring Boot 2.3.4 with Spring Integration 5.3.2 and spring-cloud-gcp-starter-pubsub 1.2.5