Subscribing to Messages from Running Jobs following Disconnection
- Record the values in following fields for each submitted job in case you need to reconnect later:
-
computeJobId -
executionAttempts(fromJOB_STATUS_UPDATEDmessages) - the last run log line received (from
RUNLOG_UPDATEDmessages,endLinesproperty)
Note: You only need to keep a record of jobs that are executing. When you receive aJOB_STATUS_UPDATEDmessage indicating a job has finished, remove that record. -
- When disconnected, reconnect to a new socket, see the previous section Create a websocket.
- Send a
SUBSCRIBEmessage using the following format:
Xpress Insight responds to the subscribe message with a message indicating the current job status for each job. The example below shows a typical message.{ "messageType": "SUBSCRIBE", "messagePayload": { "subscriptions": [ { "computeJobId": "18b2c77c-bbf76547-0d313ad7-ed74ace8", "executionAttempts": 1, "lastRunLogLine": 69 } ] } }{ "computeJobId": "computeJob1", "messageType": "CURRENT_JOB_STATUS", "messagePayload": { "status": "EXECUTING", "modelStatus": null, "executionAttempts": 1, "resultUrl": null, "payloadUrl": "/api/scenarios/[scenario-id]/attachments/[attachment-id]/file", "runLogUrl": "/api/scenarios/[scenario-id]/run-log", "jobMetricsUrl": "/api/scenarios/[scenario-id]/job-metrics" } }
computeJobId is finished, you will only receive this message. You can fetch the run log for the job using the
runLogUrl defined on the message.
computeJobId is still running, the messages received depend on whether the original job submission requested
run log messages or
solver callbacks:
- If the original job submission requested run log messages, Insight 5 will send one or more
RUNLOG_UPDATEDmessages for all run log lines that have been generated whilst the client was disconnected. The messages will begin after thelastRunLogLinesent on theSUBSCRIBEmessage for that job. It will then continue to sendRUNLOG_UPDATEDmessages as the job proceeds as usual. - If the original job submission requested solver callbacks, Insight 5 will send any outstanding
APP_MESSAGEraised whilst the client was disconnected, subject to the configuredAPP_MESSAGEStimeout (if the client was disconnected too long, the job will have been terminated).
© 2001-2025 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.
