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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
rod
Contributor
Contributor

Re-subscribing & tRestRequest

Trying to consume a subscription of events, but have a problem to resubscribe if there is a timeout or a restart on the remote system.
Essentially have 2 tasks...
1. Send Subscription request via tRest
2. Consume subscription via tRestRequest/tRestResponse.
Looking for a suggestion in how to trigger the 1st task, if we haven't received a heartbeat in x seconds?
My thought right now is to create a second job to check if there is a current heartbeat, if not received, then send subscription request.
Thanks,
Rod
( Note - on Open-source ESB )
Labels (3)
1 Reply
Anonymous
Not applicable

Hi  
1. Using tRestCient to call the Rest web service, there are two parameters: connection time out and Receive time out in the advanced settings panel, the job will fail once the time out reach.
2. Using tLoop with While model to iterate the child job many times until the calling is successfully, the job design looks like:
main job:
tloop--iterate--tRunJob--oncomponent--tJava
Define a context variable called condition that will be used as condition on tLoop.
tRunJjob: call the child job, uncheck the 'die on error' option.
on tJava:
String status = myRoutine.getValue();
if(status!=null&&status.equals("failed")){
context.condition=true;
}else{
context.condition=false;
}

Refer to this article to learn how to define a global variable that can be accessible from different job.
child job:
tRestClient--onsubjoberror--tJava
tRestClient: uncheck the 'die on error' option.
on tJava:
myRoutine.setValue("failed");

Regards
Shong