Hello,
I'm sending sales figures to an analytic platform with a post to receive back forecasts. I can set batches of several products.
I send data in json format with a POST, platform might take a while to process, so i can query result with a GET.
When i send batches of 20 products, the 13 firsts are processed OK, then 14th & 15th fail because of Progress error 9407, then next are processed OK.
If i send a big batch, POST works, but connection failure error occurs on the GET... I'm probably missing something in my code (part of it at the end of the message), i checked OpenEdge documentation/KB but didn't find any clue...
Did someone face this issue and find a solution to this ?
Thanks.
Thierry
oLib = ClientLibraryBuilder:Build()
:Library.
oClient = ClientBuilder:Build()
:UsingLibrary(oLib)
:Client.
oURI = NEW URI(STRING(UriSchemeEnum:https), in-endpoint-url).
oURI:Port = in-endpoint-port.
oURI:Path = in-endpoint-path.
OSTRING = NEW STRING(iplcPayload-data).
oRequest = RequestBuilder
:Post(oURI, OSTRING)
:ContentType(in-payload-type)
:AcceptJSON()
:AddHeader('x-api-key',in-api-key)
:Request.
oResponse = oClient:Execute(oRequest).
oEntity = oResponse:Entity.
opJsonResult = CAST (oentity, JsonObject) NO-ERROR.
cRequestID = opJsonResult:getCharacter("requestId") NO-ERROR.
cAAstatus = "".
cAAStatus = opJsonResult:getCharacter("status") NO-ERROR.
IF cAAStatus <> "" THEN
IF cAAStatus = "not-ready" THEN DO:
ASSIGN in-endpoint-path = in-endpoint-path + "/" + cRequestID
oURI:Path = in-endpoint-path.
DO iWaitLoop = 1 TO 480 :
PAUSE 60 NO-MESSAGE.
oRequest = RequestBuilder
:GET(oURI, OSTRING)
:ContentType(in-payload-type)
:AcceptJSON()
:AddHeader('x-api-key',in-api-key)
:Request.
oResponse = oClient:Execute(oRequest).
oEntity = oResponse:Entity.
opJsonResult = CAST (oentity, JsonObject) NO-ERROR.
cRequestID = opJsonResult:getCharacter("requestId") NO-ERROR.
cAAstatus = "".
cAAStatus = opJsonResult:getCharacter("status") NO-ERROR.
IF cAAstatus <> "not-ready" THEN LEAVE.
END.
END.
Hello,
With help of colleagues, i found the issue here, I was sending the payload in the GET request, and it seems it was messing the analytics platform. I also added option "cache-control: no-cache" in http header...
Thierry