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
1
vote
0 answers

How can I update multiple records and persist the changes using Hibernate Reactive w/ Panache and Mutiny

I have an Example entity class that extends PanacheEntityBase. My goal is to get a stream or list of examples and then run updates on each one and persist those updates, then run another function that does some other stuff - I know this other…
Kyle Hobbs
  • 445
  • 1
  • 4
  • 14
1
vote
1 answer

How convert from Uni> to non Uni list object?

I am looking for solution for converting the Uni to regular List object. Unfortunately am unable to find any solution anywhere or within the mutiny documentation. If anyone can help to point to right direction that will be helpful.
Sam
  • 127
  • 2
  • 15
1
vote
2 answers

Quarkus Mutiny retry fails because on another thread

I need to write code that will: connect to external DB query that DB for data process this data, meaning create multiple entities in local DB I created a method like below: @WithSession public Uni retrieveDataAndSaveInLocalDB() { …
Slawomir
  • 15
  • 3
1
vote
1 answer

Using @RequestScoped classes on worker threads

I'm creating a logging system where all the logs generated by specific request are stored in a request scoped object and subsequently logged on a ContainerResponseFilter. So instead of having many logs per request, I'll have just one with all the…
David Reis
  • 11
  • 2
  • 6
1
vote
1 answer

Using SmallRye Mutiny in frontend Vue app

I am using Java Quarkus application together with SmallRye Mutiny based on Quarkus guide: https://quarkus.io/guides/mutiny-primer I created Rest endpoint as below: @GET @Path("/data") @APIResponse( responseCode = "200", …
dockitu
  • 21
  • 5
1
vote
1 answer

How to test code that subscribes to an Uni?

I know that I can test a method that returns an Uni: @Test public void testUni() { service.doSomething().invoke(data -> { // run assertions }).subscribe().withSubscriber(UniAssertSubscriber.create()).assertCompleted(); } But what if I want…
Allan Juan
  • 2,048
  • 1
  • 18
  • 42
1
vote
1 answer

How to persist PanacheEntity avoiding duplicate key exception?

I want to persist an entity. I want to skip it in case it already exists in the datastore. Assume the name field is part of the primary key. Assume p1 exists in the datastore. Only p2 should be inserted. Inserting p1 produces duplicate key…
JanPl
  • 794
  • 6
  • 19
1
vote
1 answer

How to implement recursive method using Mutiny UNI Quarkus reactive sql Java

I have an Person table which contains below information. Person table type personId INT Name VarChar fatherId INT --refer to personId in same table(Person) MotherId INT --refer to personId in same table(Person) More columns other…
1
vote
1 answer

Process items in Uni asynchronously

I have a Uni Uni> list = Uni.createFrom().item(List.of("a", "b", "c")); I would like to map each item in this list to a new Uni and then process them asynchronously. I have tried following: list.map(strings ->…
isADon
  • 3,433
  • 11
  • 35
  • 49
1
vote
1 answer

Hibernate Reactive - Best practice for fetching child associations during iterating parent entities

consider the following sample. I have two entities: Author and Book. Their signatures are: @Getter @Setter @Entity @Builder @NoArgsConstructor @AllArgsConstructor @Table(name = "author") public class Author implements Serializable { @Serial …
Tapas Bose
  • 28,796
  • 74
  • 215
  • 331
1
vote
1 answer

How to concatenate 2 different types of streams using Smallrye Mutiny Multi?

I would like to concatenate 2 OutputStream of different types using the method Multi.createBy().concatenating().streams. Is there a way to achieve this? I have 2 streams one is of ByteArrayOutputStream and other is of custom type CustomerEvent and I…
BATMAN_2008
  • 2,788
  • 3
  • 31
  • 98
1
vote
1 answer

Combine multiple resultsets into one object with hibernate reactive and mutiny

I have a database representing the accesslog of my webserver with columns such as ip-address, method, requested path, etc. I want to create an endpoint which returns a json similar to this: { "addresses": [ { "address":…
1
vote
0 answers

How to stream a big zip file until end?

I am trying to stream a big zip file with Multi through GRPC service as follows: @GrpcService class HelloGrpcService : HelloGrpc { override fun source(request: Empty?): Multi { val file =…
softshipper
  • 32,463
  • 51
  • 192
  • 400
1
vote
1 answer

Why does Cassandra Quarkus extension not use smallrye-mutiny-vertx-cassandra-client to interact with Cassandra?

In the below guide we can see its all annotation driven and entity , all the dao classes are generated during compile time. https://quarkus.io/guides/cassandra#reactive If you want to execute queries natively like u have a sql and prepare stmt and…
Jaiprasad
  • 149
  • 11
1
vote
1 answer

Mutiny - Propagate completion to parent multi / polling

I am writing a little polling mechanism using Mutiny, part of me learning the library and i am kinda stuck in cancelling the polling when result is found. I tried using the tick() and what i came up with looks…