Closed snowdrop-bot closed 3 years ago
Hi Quarkus Team,
first of all thanks for adding Flow as an option for SSE endpoints.
But currently when using Flow this leads to a ContextNotActiveException, when combining it with the access to a request scoped bean
Kind regards
The value of the request scoped bean can be accessed within the context of a Flow
When trying to access a property of the request scoped bean a javax.enterprise.context.ContextNotActiveException is thrown
Request scoped bean @RequestScoped class RequestScopedBean( var user: String? = null )
@RequestScoped class RequestScopedBean( var user: String? = null )
Endpoint
@Path("/hello") class ReactiveGreetingResource(private val requestScopedBean: RequestScopedBean) { @GET @RestSseElementType(MediaType.TEXT_PLAIN) fun hello(): Flow<String> = flow { emit("Hello RESTEasy Reactive") delay(1_000) emit("Hello again from ${requestScopedBean.user}") } } --- https://github.com/quarkusio/quarkus/issues/18993 --- $upstream:18993$
Describe the bug
Hi Quarkus Team,
first of all thanks for adding Flow as an option for SSE endpoints.
But currently when using Flow this leads to a ContextNotActiveException, when combining it with the access to a request scoped bean
Kind regards
Expected behavior
The value of the request scoped bean can be accessed within the context of a Flow
Actual behavior
When trying to access a property of the request scoped bean a javax.enterprise.context.ContextNotActiveException is thrown
How to Reproduce?
Request scoped bean
@RequestScoped class RequestScopedBean( var user: String? = null )
Endpoint