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

Announcements
Data Works for AI is here - Join the discussion and enter to win a pair of Qlik kicks: Join the Conversation!
cancel
Showing results for 
Search instead for 
Did you mean: 
ajkerr
Contributor
Contributor

Talend REST service prevent context variables overwritten by simultaneous requests

It's been some time since I've developed regularly in Talend, so happy to rework the job as much as possible to achieve this. This is 100% an issue with how I've designed the job and not a Talend bug.

I have a Talend Studio REST job that works correctly when requests are processed one at a time, however when two requests are sent almost simultaneously, request/response context variables responsible for passing logging info can be overwritten while the first request is still running. This causes data from one operation to be mixed into the other request’s processing, logging, or response. 

Is there a recommended Talend native way to keep request specific values isolated for the full lifetime of each REST request, or to make a new request wait until the current request has finished processing?

I understand Routes could potentially solve this issue, but jobs work better from a design perspective for our current goals. I'm thinking of scrapping storing the logging data in context variables and passing it all through the main component flows to avoid subsequent calls overwriting the data.

When requests overlap, those context values may be replaced by the second request before the first request reaches the update Joblet. This can cause the wrong log record to be updated or cause response and logging data to become mixed between requests.

For further context, at the beginning of each request, an insert logging Joblet creates a database record with values such as an ID, timestamp, operation, request details, and initial status.

At the end of the flow, an update logging Joblet updates that same record with the final response, HTTP status, outcome, duration, error details, and completion timestamp.

Screenshot of part of the job attached.

ajkerr_0-1783953671406.png

Any help would be much appreciated. Thanks in advance.

Labels (7)
0 Replies