Questions tagged [mutiny]

Mutiny is an event-driven, reactive programming library for Java 8+.

Mutiny is an event-driven reactive programming library, supporting (Reactive Streams) based back-pressure and designed after having experienced many issues with other Reactive programming libraries.

It takes a different approach by providing the most used operators with a more guided API, which avoids having classes with hundreds of methods that cause trouble for even the smartest IDE. The library has built-in converters from and to other reactive programming libraries, so you can always pivot.

Mutiny reuses ideas from Reactive eXtensions but does not follow the same API guidelines and operators. Also, it can be used to build Reactive Systems, for example, by combining, Mutiny, and Reactive Messaging.

228 questions
2
votes
2 answers

Is there a difference between Uni> vs Multi in Quarkus Resteasy reactive?

When implementing a reactive endpoint, is there any difference between returning Uni> vs Multi ? @Path("/fruits") public class FruitResource { @GET @Path("uni") public Uni> getUni() { return…
Olivier Boissé
  • 15,834
  • 6
  • 38
  • 56
2
votes
1 answer

The current operation requires a safe (isolated) Vert.x sub-context, but the current context hasn't been flagged as such

I am using Quarkus version 2.11.1.Final. With the following `io.quarkus dependencies: smallrye-mutiny-vertx-web-client quarkus-resteasy-reactive quarkus-hibernate-reactive In a long rest process, I am trying to persist several entities but I get…
A.Casanova
  • 555
  • 4
  • 16
2
votes
1 answer

Quarkus Reactive Websocket Hibernate Query RequestScoped context was not active

I'm trying to do reactive Hibernate Panache queries on a websocket message in quarkus, but unfortunately, the reactive call just fails (without errors!). I now tried to get the result directly via the .await().indefinitely() methods, and now I can…
SIMULATAN
  • 833
  • 2
  • 17
2
votes
0 answers

Quarkus send/receive through Reactive REST API "huge" stream

I'm struggling with my proof of concept. Here is the main idea: On one side, the REST API Server shall allow to get and send "stream" (as InputStream, not File) On other side, the client shall do the same, reversely, again as InpuStream (possibly…
Frederic Brégier
  • 2,108
  • 1
  • 18
  • 25
2
votes
1 answer

coordinating multiple outgoing requests in a reactive manner

this is more of a best practice question. in my current system (monolith), a single incoming http api request might need to gather similarly structured data from to several backend sources, aggregate it and only then return the data to the client in…
gkatz
  • 87
  • 7
2
votes
1 answer

Quarkus Mutiny Multi Exception handling if no result

I need to throw a specific exception in the case if the multi stream doesn't return anything (empty / null in terms of multi stream result); Here is my repository method: return reactiveRepository.findAllById(idList); which returns…
Deniss M.
  • 3,617
  • 17
  • 52
  • 100
2
votes
2 answers

Why is Mutiny call method blocking

just get started with Mutiny, working through the guides (https://smallrye.io/smallrye-mutiny/guides). And as far as I read in the docs, the call method is async (https://smallrye.io/smallrye-mutiny/getting-started/observing-events). However, with a…
syr
  • 836
  • 1
  • 12
  • 28
2
votes
1 answer

How to run event sequentially in Mutiny

I am using the Mutiny library within the Quarkus framework in Java 11. I am wonderring which is the best way of running several events sequentially by storing them into a Multi object. I am going to describe my issue in the following java-like…
A.Casanova
  • 555
  • 4
  • 16
2
votes
0 answers

quarkus @ConsumeEvent exception handling

Consider this handler: @ConsumeEvent("foo.create") public Uni createFoo(FooCreateRequest request) { return Uni.createFrom().item(1L) .onItem().failWith(() -> new RuntimeException("foo error message")); } According to the…
3zmo
  • 73
  • 9
2
votes
2 answers

How to build a async rest endpoint that calls blocking action in worker thread and replies instantly (Quarkus)

I checked the docs and stackoverflow but didn't find exactly a suiting approach. E.g. this post seems very close: Dispatch a blocking service in a Reactive REST GET endpoint with Quarkus/Mutiny However, I don't want so much unneccessary boilerplate…
syr
  • 836
  • 1
  • 12
  • 28
2
votes
1 answer

How to record each throwable when using .onFailure().retry() with delay between retries

I need to record failure reason in metrics for each failed http call when using Vert.x WebClient. This compiles: .onFailure() .retry() .withBackOff(Duration.ofMillis(INITIAL_RETRY_DELAY_MS)) …
Panu Haaramo
  • 2,932
  • 19
  • 41
2
votes
1 answer

Mutiny - combine Uni and Multi based on business logic

I am new to reactive programming. Kindly assist in achieving the below in Mutiny. I have a DTO class public class UserAppSessionDto{ private UserDto user; private List userOrgs; private List userApps; } and 3 service…
Alifax
  • 21
  • 1
  • 2
2
votes
1 answer

Bring Uni event back to the caller thread

Given a subscription in a Quarkus application: Uni.createFrom.Item(1) .chain { it -> processA(it) } .emitOn(Infrastructure.getDefaultWorkerPool()) .chain { it -> processB(it) } .chain { it -> processC(it) } .subscribe().with{ it…
nocte107
  • 273
  • 2
  • 10
2
votes
1 answer

How to return the newly persisted entity using the reactive extensions for hibernate

I am trying to use mutiny in order to persist an entity. The add method should return a Uni referencing the newly persisted (or merged) entity (I am using the isPersistent flag to determine whether an entity was already persisted…
BigONotation
  • 4,406
  • 5
  • 43
  • 72
2
votes
0 answers

How can I persist multiple models with manyToMany relationship at a once on hibernate reactive?

I have 2 entity models Appointment and reasons with many to many relationship. Appointment model: @Entity public class Appointment extends PanacheEntityBase { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) public Long id; …
zhongge
  • 21
  • 4
1
2
3
15 16