No stream() methods in quarkus 3

102 views Asked by At

I would like to migrate my code from quarkus 2 to quarkus 3. All my code is reactive. I found some problems with stream() methods which were removed in quarkus 3.

Example code from quarkus 2. Fruit is an Entity which is stored in PG database.

return Fruit.streamAll();

How can I achieve the same result in quarkus 3? I prefer Multi<Fruit> than Uni<List<Fruit>>.

1

There are 1 answers

0
dkoci On

My solution is

Multi<Fruit> fruits = Fruit.listAll()
  .onItem()
  .transformToMulti(list -> Multi.createForm().iterable(list));

Anyway I prefer quarkus 2 Fruit.streamAll() solution.