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: 
Anonymous
Not applicable

ESB: REST service return empty items instead of 404

Hello,

 

I have design an ESB module for REST services. My ESB is developed as follows (see attachement):

 

tPostgresqlConnection -> RestInterface -> tFlowtoIterate -> tPostgresInput -> tXMLMap -> tRestresponse

 

The REST service works good. But if the SQL query under tPostgresInput have no response the REST service return an 404. It is possibly to return an empty JSONS (for example {items:{}}) ? 

 

Greets 

 

Benjamin

 

 

 

Labels (1)
  • Other

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hello
You can check the number of lines are read from tPostGresInput and generate different response, for example:
tPostgresqlConnection -> RestInterface -> tFlowtoIterate -> tPostgresInput ->

tHashOutput-- runif1--thashinput--tXMLMap 1-> tRestresponse1
                    --runIf2--tfixedFlowInput--tXMLMap2--trestresponse2
thashoutput: cache the query data into memory.
thashinput: read the data from memory.

set the condition of runif1 as:
((Integer)globalMap.get("tPostgresqlInput_1_NB_LINE"))>0

set teh condition of runif2 as:
((Integer)globalMap.get("tPostgresqlInput_1_NB_LINE"))==0

tfixedFlowInput: you can customize the response string such as : "no data found" and assign it to output Document on tXMLMap2.

Regards
Shong

View solution in original post

2 Replies
Anonymous
Not applicable
Author

Hello
You can check the number of lines are read from tPostGresInput and generate different response, for example:
tPostgresqlConnection -> RestInterface -> tFlowtoIterate -> tPostgresInput ->

tHashOutput-- runif1--thashinput--tXMLMap 1-> tRestresponse1
                    --runIf2--tfixedFlowInput--tXMLMap2--trestresponse2
thashoutput: cache the query data into memory.
thashinput: read the data from memory.

set the condition of runif1 as:
((Integer)globalMap.get("tPostgresqlInput_1_NB_LINE"))>0

set teh condition of runif2 as:
((Integer)globalMap.get("tPostgresqlInput_1_NB_LINE"))==0

tfixedFlowInput: you can customize the response string such as : "no data found" and assign it to output Document on tXMLMap2.

Regards
Shong

Anonymous
Not applicable
Author

thx I will try it.