Sometimes the IKO wants to scale down our compute stateful set while the Interoperability productions are processing messages. A compute will shut down before it empties its queues and we do not see in Message Bank all messages that were processed before the shutdown. I wonder if anybody wrote code to prevent accepting more messages (stop incoming services) and process what is in queues including Message Bank operation queue which could be called before the actual shutdown (preStop hook)?

Hello, Thembelani,

I have implemented a similar case in this app:

https://github.com/oliverwilms/irisrest/blob/master/src/App/REST.cls#:~:...

Important helper method is this:

/// Helper method
ClassMethod GetJSONFromRequest(Output obj As %DynamicObject) As %Boolean
{
    Set ok = 1
    Try {
        Set obj = ##class(%DynamicObject).%FromJSON(%request.Content)
    } Catch ex {
        Set ok = 0
    }
    Quit ok
}

Best regards,

Oliver