Hi,

Here is the sample code

 Set DCJson= {"name":"Janko","surname":"Hrasko","colors":["blue","green","yellow"]}
  
  Set formatter=##class(%JSON.Formatter).%New()
  Set sc=formatter.FormatToString(DCJson,.tJsonStr)
  Set newMsg = ##class(Ens.StreamContainer).%New()
  Set newMsg.Stream = ##class(%Stream.GlobalCharacter).%New()
  do newMsg.Stream.Write(tJsonStr)
  newMsg.Stream.Read()
 

Output:

{
  "name":"Janko",
  "surname":"Hrasko",
  "colors":[
    "blue",
    "green",
    "yellow"
  ]
}

Thanks,

Hi,

The HeaderId and Target are required parameters for tihs method.

ClassMethod ResendDuplicatedMessage(pOriginalHeaderId As %String, Output pNewHeaderId As %String, pNewTarget As %String, pNewBody As %RegisteredObject, pNewSource As %String, pHeadOfQueue As %Boolean) As %Status
 

Can try like  Set tSC = ##class(Ens.MessageHeader).ResendDuplicatedMessage(context.tId,,context.pNewTarget)

Thanks,