Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
root
Creator II
Creator II

tRestRequest --> tRestClient (how to manage responses)

Hello all, hope everyone is safe!

 

In my webservice (with tRestRequest), based on the inputs, I need to make a http call via tRestClient. The response (success/ failure) needs to be interpreted and my webservice needs to send a response back to the client... Something like:

 

tRestRequest --> Business logic --> tRestClient --> Response flow --> do something --> Send response (tRestResponse)
Error Flow --> do something --> Send response (tRestResponse)

 

As of this time, if the tRestClient returns a success, I see an error on the Karaf logs about some null pointer (reading the Error flow response code) and service responds back with a HTTP 500 Internal Server Error.

 

Whats the best way to handle this seamlessly? 

 

Thank you in advance.

Labels (3)
2 Replies
TRF
Champion II
Champion II

How is the error flow connected to the main flow?
Verify you're not trying to send 2 responses.
root
Creator II
Creator II
Author

@TRF 

Here is a snapshot of how this looks.If you see, the response is separate based the error/ success.

 

In the tRunIf conditions checks the errorCode (for Error Flow)/ statusCode (for Response Flow).

 

So, how can I make sure that ONLY correct flow is invoked based on the tRestClient... Hope that helps. Thanks

 

0683p000009M9Iv.png