Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am using Talend Studio (Big data platform) 7.3.1. I am developing a Rest service job that need to handle 100 requests per second. In the job, I store data in GlobalMap.
Ex: globalMap.put("userId",userId) and globaMap.get("userId")
My question is :
. Ex: instance1 write "david" to globalMap.userId, Instance2 write "Tom" to globalmap.userId. Is there a scenarios that instance1 get the value "Tom" in userId
. Ex: multiple instances write data to globalMap.userId. Is there any race condition happens?
2.In order to pass data from parent to subjob. Is it the best way to do that?
Hello
This is answered by our developer in another question:
It’s been asked many times about Thread Safety in ESB in Studio.
I have run few test and the conclusion is
Context are not thread safe.
GlobalMap is thread safe.
If we look in detail of code generated ,
Context and globalMap both are used on class level inside a talendJOb but on RestRequest a new globalMap is created.
Hope it helps!
Regards
Shong