apache / apache/camel-quarkus

Quarkus camel api not able to parse json response

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

Description

I have exposed a quarkus camel API which my react UI consumes. This API internally calls another API to get the information required for UI.

React UI -> quarkus camel API > internal API.

Camel API after making API call is not able to parse JSON response and hence returns unreadable characters(question marks) in the response and hence UI fails reading the data

![Screen Shot 2022-01-07 at 12](https://user-images.githubusercontent.com/62077618/148598174-b32c2b08-62cd-4e39-8262-9ecd4050399d.png)

Sample code:
from("rest:get:/api/tasks")
.log("Get tasks list [START]")
.setHeader(Exchange.HTTP_METHOD, constant("GET"))
.setHeader(Exchange.CONTENT_TYPE, constant("application/json"))
.setHeader("Accept",constant("application/json"))
.to(enrollmentHostUrl + "/enrollment/api/tasks?programId=${header.programId}&bridgeEndpoint=true")
.log("Get tasks list [END]")
.endRest();

Any help would highly appreciated

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the REST route shown in the issue and trace the response returned by the downstream tasks endpoint. Reproduce the request and inspect the response encoding and content type at the Camel API boundary. Done means the API returns readable JSON that the React UI can consume.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.