-
Notifications
You must be signed in to change notification settings - Fork 45
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
Ensure reactive context is propagated #512
Conversation
DefaultGraphQLInvocation and DefaultGraphQLExecutionInputCustomizer are updated to use Mono and Flux in their internal implementation in order to ensure that the Micronaut PropagationContext is carried appropriately through the invocation flow. Previous use of the bare io.micronaut.core.async.publisher.Publishers API in DefaultGraphQLExecutionInputCustomizer was causing the context not to be propagated as desired when including the Micrometer Context Propagation library. A test is added to verify the context propagation works as expected. Some additional cleanup is done throughout the test suite to reduce the scope of included Micronaut beans to the specific tests in order to make it easier to test different setups. Resolves #495
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good.
Can we rewrite the snippets:
ApplicationContext context = new DefaultApplicationContext(Environment.TEST)
context.environment.addPropertySource(PropertySource.of(
["spec.name": GraphQLConfigurationSpec.simpleName,
"graphql.graphiql.enabled": false]
))
context.start()
with:
ApplicationContext context = ApplicationContext.run(["spec.name": GraphQLConfigurationSpec.simpleName, "graphql.graphiql.enabled": false])
I don't think we should be using DefaultApplicationContext
class directly which is an internal class.
Agreed, good point. Done in 5ebb76d |
|
DefaultGraphQLInvocation and DefaultGraphQLExecutionInputCustomizer are updated to use Mono and Flux in their internal implementation in order to ensure that the Micronaut PropagationContext is carried appropriately through the invocation flow. Previous use of the bare io.micronaut.core.async.publisher.Publishers API in DefaultGraphQLExecutionInputCustomizer was causing the context not to be propagated as desired when including the Micrometer Context Propagation library. A test is added to verify the context propagation works as expected. Some additional cleanup is done throughout the test suite to reduce the scope of included Micronaut beans to the specific tests in order to make it easier to test different setups. * Avoid direct instantiation of DefaultApplicationContext Resolves #495
DefaultGraphQLInvocation
andDefaultGraphQLExecutionInputCustomizer
are updated to use Mono and Flux in their internal implementation in order to ensure that the MicronautPropagationContext
is carried appropriately through the invocation flow. Previous use of the bareio.micronaut.core.async.publisher.Publishers
API inDefaultGraphQLExecutionInputCustomizer
was causing the context not to be propagated as desired when including the Micrometer Context Propagation library.A test is added to verify the context propagation works as desired.
Some additional cleanup is done throughout the test suite to reduce the scope of included Micronaut beans to the specific tests in order to make it easier to test different setups.
Resolves #495