question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Suspendable ServerRequestFilter in Resteasy Reactive

See original GitHub issue

Description

The following return types are currently possible in Resteasy Reactive Filters (@ServerRequestFilter): void, Response, RestResponse, Optional<Response>, Optional<RestResponse>, Uni <Void>, Uni<RestResponse> or Uni <Response>.

Please add support for suspendable filters (Kotlin Coroutines).

Example

class Filters {

    @ServerRequestFilter(preMatching = true)
    suspend fun preMatchingFilter(requestContext: ContainerRequestContext): RestResponse<String>? {
        return if (requestContext.method == HttpMethod.GET) {
            RestResponse.ok("GET", MediaType.TEXT_PLAIN_TYPE)
        } else {
            null
        }
    }
}

Implementation ideas

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
geoandcommented, Oct 4, 2021
1reaction
geoandcommented, Jul 30, 2021

Yeah, we can certainly do that. But it will likely be a 2.3 enhancement, not a 2.2 one

Read more comments on GitHub >

github_iconTop Results From Across the Web

Writing REST Services with RESTEasy Reactive - Quarkus
This is the reference guide for RESTEasy Reactive. ... case the current HTTP request will be automatically suspended after your method, ...
Read more >
Using reactive @ServerRequestFilter with RestClient in Quarkus
resteasy.reactive.common.core.BlockingNotAllowedException because of this call. Since I'm using Kotlin, i tried to mark my method as suspendable ...
Read more >
ServerRequestFilter (RESTEasy Reactive - Runtime 1.13.5 ...
When used on a method, then an implementation of ContainerRequestFilter is generated that calls the annotated method with the proper arguments.
Read more >
Resteasy Reactive: Kotlin `Flow` and `Multi` are not supported ...
Flow and Multi cannot be returned from a suspendable function (resteasy reactive). Expected behavior. No response. Actual behavior. No response ...
Read more >
chore(deps): update dependency io.quarkus:quarkus ... - GitLab
An error occurred while retrieving approval data for this merge request. chore(deps): update dependency io.quarkus:quarkus ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found