Support
Quality
Security
License
Reuse
kandi has reviewed tiny-spring and discovered the below as its top functions. This is intended to give you an instant insight into tiny-spring implemented functionality, and help decide if they suit your requirements.
支持singleton类型的bean,包括初始化、属性注入、以及依赖bean注入。
可从xml中读取配置。
可以使用Aspectj的方式进行AOP编写,支持接口和类代理。
default
git checkout step-1-container-register-and-get
route failureHandler is blocked in SmallRye Mutiny Vertx bindings
.failureHandler(frc ->
frc.response()
.setStatusCode(404)
.end()
.subscribe().with(ignore -> System.out.println("failure handler is done"))
);
QUESTION
route failureHandler is blocked in SmallRye Mutiny Vertx bindings
Asked 2021-Jul-20 at 07:54I tried to experience the SmallRye Mutiny Vertx bindings, the complete example codes can be found on my Github.
When assembling the routings like this.
router.get("/posts/:id").produces("application/json")
.handler(handlers::get);
//.failureHandler(frc -> frc.response().setStatusCode(404).end());
The failureHandler
will block the request.
ANSWER
Answered 2021-Jul-20 at 07:54The problem here is that end returns a Uni
object. You can think of it as a function. This function is lazy. What you want to do instead is call that function. This can be achieved by subscribing to it.
If you're not interested in processing the result of this Uni
, you can use endAndForget
instead of end
which will call that function for you (subscribe to the Uni
).
If you would like to do something with the result of the Uni
, you can subscribe instead:
.failureHandler(frc ->
frc.response()
.setStatusCode(404)
.end()
.subscribe().with(ignore -> System.out.println("failure handler is done"))
);
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
No vulnerabilities reported
Save this library and start creating your kit
Save this library and start creating your kit