Skip to content
Advertisement

Tag: mutiny

quarkus @ObservesAsync invoke Uni

What’s the best way to invoke Uni in an async observer? It would be great if I could just return Uni but unfortunately that doesn’t work. Answer As mentioned by @ladicek, you can: use a synchronous observer and block until termination use a synchronous observer and “trigger” the async operation using a fire-and-forget approach use an async observer (while it’s

Bring Uni event back to the caller thread

Given a subscription in a Quarkus application: If I understand correctly, processA will be executed on the caller thread (so if it is in a Verticle, it should be on a IO thread), processB and processC will be executed on the worker threads, processD will be on the caller/IO thread again. How can I make processC being called on the

Quarkus Reactive – Multiple matching properties for name “security.jaxrs.deny-unannotated-endpoints” Error

Using Quarkus I get the following error at execution time: Caused by: java.lang.IllegalArgumentException: Multiple matching properties for name “security.jaxrs.deny-unannotated-endpoints” property was matched by both public boolean io.quarkus.resteasy.reactive.common.runtime.JaxRsSecurityConfig.denyJaxRs and public boolean io.quarkus.resteasy.runtime.JaxRsSecurityConfig.denyJaxRs. This is likely because you have an incompatible combination of extensions that both define the same properties (e.g. including both reactive and blocking database extensions) My pom properties are:

Uni.combine().all().unis() v.s. Multi..onItem().transformToMultiAndConcatenate().collect()

In my Quarkus service, I need to fetch a list of results from external service, and I figured out there are two methods to achieve the same goal: 1st approach based on Uni.combine().all(): 2nd approach based on Multi..onItem().transformToMultiAndConcatenate().collect() In the beginning I don’t think there exists any true difference between the two approaches, as Uni are evaluated lazily and either

How to call long running blocking void returning method with Mutiny reactive programming?

I have a chain of Async and Sync method invocation on Mutiny’s Uni, some methods are a long-running process with return type void. What is the proper way of invoking/calling them without blocking downstream? Below is the simple analogy code. Answer In general, use runSubscriptionOn and pass a specific executor: Note that it will constraint the concurrency to the number

How do i sort a Multi in smallrye mutiny

Other reactive libraries like project reactor offer sort methods for Publishers but there is no such method in mutiny. Their documentation doesn’t even talk about it. https://smallrye.io/smallrye-mutiny Right now i’m achieving the said functionality by doing this Is there a better way to do the same ? Answer I don’t believe there is a built-in/better way to do this. Mutiny

Advertisement