Written by

Senior Cloud Architect at InterSystems
MOD
Question Eduard Lebedyuk · Sep 1, 2021

Get initial request by Defer Token

I'm using Deferred Response.

After I have obtained a token, is it possible to retrieve initial request somehow?

Product version: IRIS 2021.1

Comments

Tani Frankel · Sep 2, 2021

I'm not sure if I fully understand your question Eduard, but the token itself, internally, is built by the original request's Message Header ID (and the Production name; concatenated with a pipe - |)

E.g., from the code (in Ens.Host):

Method GetDeferredResponseToken(pMessageHeader As Ens.MessageHeader) As %String
{
    Quit pMessageHeader.%Id()_"|"_$$$EnsRuntime("Name")
}

ClassMethod SendDeferredResponse(pDeferredResponseToken As %String, pResponse As %Library.Persistent) As %Status
{
    Set tSC=$$$OK
    Try {
        Set tMessageHeaderId=$p(pDeferredResponseToken,"|",1)
        Set tProductionName=$p(pDeferredResponseToken,"|",2)

Note this is of course internal implementation, and I don't think it is documented or supported (i.e. might change in future versions without notice).

0
Eduard Lebedyuk  Sep 2, 2021 to Tani Frankel

Thank you!

Looks like exactly what I need.

0