File tree Expand file tree Collapse file tree 1 file changed +33
-3
lines changed Expand file tree Collapse file tree 1 file changed +33
-3
lines changed Original file line number Diff line number Diff line change @@ -58,14 +58,44 @@ ClassMethod ReadMsg(pMsgLen = 32000) As %Status
5858
5959 #Dim stream As %Stream.Object
6060 Set stream = api .readMessageStream (.list )
61- Write !," Body: "
62- Do stream .OutputToDevice ()
63- Write !
61+ set body = stream .Read ()
62+ Write !," Body: " , body ,!
63+
64+
65+ Zw list
66+
67+ Set sc = gateway .%Disconnect ()
68+ } Catch ex {
69+ Set sc = $$$ADDSC(ex .AsStatus (), $g (%objlasterror ))
70+ }
71+
72+ Quit sc
73+ }
74+
75+ /// Read one message.
76+ /// Write $System.Status.GetErrorText(##class(RabbitMQ.Utils).ReadMsgString())
77+ ClassMethod ReadMsgString (pMsgLen = 32000 ) As %Status
78+ {
79+ #Dim gateway as %Net.Remote.Gateway
80+ #Dim exception as %Exception.AbstractException
81+
82+ Set sc = $$$OK
83+ Try {
84+
85+ Set gateway = ..Connect ()
86+ #Dim api As isc.rabbitmq.API
87+ Set api = ..GetAPI (gateway )
88+
89+ #Dim list As %ListOfDataTypes
90+ Set list = api .readMessageString ()
91+
92+ Write !," Body: " ,list .GetAt (16 ),!
6493
6594 Zw list
6695
6796 Set sc = gateway .%Disconnect ()
6897 } Catch ex {
98+ break
6999 Set sc = $$$ADDSC(ex .AsStatus (), $g (%objlasterror ))
70100 }
71101
You can’t perform that action at this time.
0 commit comments