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

GH-8664: Do not use broken observeWithContext() #8665

Merged
merged 1 commit into from Jul 12, 2023

Conversation

artembilan
Copy link
Member

Fixes #8664

When an Observation is turned to NoopObservation, the observeWithContext() fails with ClassCastException since NoopObservation serves just plain Context not the one we supplied

  • Fix MessagingGatewaySupport.sendAndReceiveWithObservation() same way as it is in version 6.0.x
  • Modify IntegrationObservabilityZipkinTests to reject some Observation via observationPredicate() configuration

Cherry-pick to 6.1.x

Fixes spring-projects#8664

When an `Observation` is turned to `NoopObservation`,
the `observeWithContext()` fails with `ClassCastException`
since `NoopObservation` serves just plain `Context` not the one we supplied

* Fix `MessagingGatewaySupport.sendAndReceiveWithObservation()` same way
as it is in version `6.0.x`
* Modify `IntegrationObservabilityZipkinTests` to reject some `Observation`
via `observationPredicate()` configuration

**Cherry-pick to `6.1.x`**
@artembilan
Copy link
Member Author

This is just a workaround for the current Micrometer version.
The change might be rejected if the real fix in the Micrometer will make it into the next release train in a couple weeks.

Copy link
Contributor

@garyrussell garyrussell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one comment.

@garyrussell garyrussell merged commit eb94433 into spring-projects:main Jul 12, 2023
2 checks passed
garyrussell pushed a commit that referenced this pull request Jul 12, 2023
Fixes #8664

When an `Observation` is turned to `NoopObservation`,
the `observeWithContext()` fails with `ClassCastException`
since `NoopObservation` serves just plain `Context` not the one we supplied

* Fix `MessagingGatewaySupport.sendAndReceiveWithObservation()` same way
as it is in version `6.0.x`
* Modify `IntegrationObservabilityZipkinTests` to reject some `Observation`
via `observationPredicate()` configuration

**Cherry-pick to `6.1.x`**
@garyrussell
Copy link
Contributor

...and cherry-picked to 6.1.x as 41f41ed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Spring integration error when using MessageRequestReplyReceiverContext data in observation predicate
2 participants