apache / apache/camel-quarkus

No converter for Uni types

Open
#4,177 5 comments 1 reaction 0 assignees View on GitHub
Dominant language
Java
Stars
302
Forks
232
Avg merge
1d 20h
Merged PRs (30d)
114

Description

When returning a Uni an error is thrown: org.apache.camel.NoTypeConversionAvailableException:
No type converter available to convert from type: io.smallrye.mutiny.operators.uni.UniOnItemTransformToUni to the required type: java.io.InputStream

Rest service EPs that fail

```
@Override
public void configure() throws Exception {
rest("/api")
.get("/movie/{index}")
.to("direct:multicast");
}
```
OR

```
@Override
public void configure() throws Exception {
from("platform-http:/platform/movie/{index}")
.to("direct:multicast");
}
```
The multicast route calls 3 routes that each call Resteasy Reactive clients that each return exchange with a Uni in the body. I use a GroupedExchangeAggregationStrategy to gather all the responses and then combine the Unis.

```
Agregation Processor
private void processAllExchanges(Exchange exchange,
MyResponse myResponse) {
List aListOfExchanges = getExchanges(exchange);

Uni movie = getUniFromExchange(aListOfExchanges, 0);
Uni episodes = getUniFromExchange(aListOfExchanges, 1);
Uni people = getUniFromExchange(aListOfExchanges, 2);

Uni combinedUni = Uni.combine()
.all()
.unis(movie, people, episodes)
.asTuple()
.onItem()
.transformToUni(tuple -> buildMyResponse(tuple, myResponse));

exchange.getMessage().setBody(combinedUni);
}
```
Is Camel Quarkus going to support returning reactive types as Resteasy Reactive does?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the REST and platform-http route examples, then trace the multicast route and aggregation processor where the combined Uni is assigned to the exchange body. Reproduce the NoTypeConversionAvailableException and inspect how the response body is converted. Done means the supported behavior for reactive return types is established and covered by an appropriate test or documented limitation.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.