{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-guides/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Messaging","description":"Accelerate E&P application development and protect your innovation by consuming our Data and Domain APIs / Platform APIs.","lang":"en-US","meta":[{"name":"robots","content":"noindex"}],"llmstxt":{"hide":true,"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"messaging","__idx":0},"children":["Messaging"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Messaging  enables applications to communicate with each other and exchange data. The SDKs provide messaging capabilities that enable"," ","developers to send and receive predefined and custom moessages."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"busclient","__idx":1},"children":["BusClient"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["BusClient"]}," is used for sending and receiving NATS messages."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"_","__idx":2},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#tab/net"},"children":["NET"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Properties:"]}]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["IsConnected: bool"]}," - ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["True"]}," if connected."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Messages: BusMessageQueues"]}," - Provides access to the queues used to store incoming messages.  See ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#busmessagequeues"},"children":["BusMessageQueues"]}," for more information."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Methods:"]}]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["public void Connect()"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["public void Disconnect()"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["public void SendMessage(string topic, string payload)"]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"_-1","__idx":3},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#tab/python"},"children":["Python"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Properties:"]}]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["is_connected: bool"]}," - ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["True"]}," if connected."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["messages: BusMessageQueues"]}," - Provides access to the queues used to store incoming messages.  See ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#busmessagequeues"},"children":["MessageQueues"]}," for more information."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Methods:"]}]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["configure()"]}," - Reads settings from AEA configuration."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["connect(sec)"]}," - Connects... waiting up to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sec"]}," seconds.  If not connected, connection will continue to try asynchronously."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["disconnect()"]}," - Disconnects."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["send_data(msg: IoDataReportMsg, topic = \"DataOut\")"]},"- Sends IoDataReportMsg (msg) to topic (default is \"DataOut\")."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["send_message(topic, header, payload)"]},"- Combines header and payload into json msg and sends message to topic."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["send_raw_message(topic, payload)"]},"- Sends message payload to topic."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["send_request(msg: RequestMsg, topic = \"RequestOut\")"]},"- Sends RequestMsg (msg) to topic (default is \"RequestOut\")."]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"configuring-busclient","__idx":4},"children":["Configuring BusClient"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Name"]},": Used to identify the client."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["AEA2:BusClient"]},":",{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Mock"]}," (default = ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["false"]},"): Used for testing by looping back sent messages to the incoming message queues.  Messages are not sent to NATS server."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Server"]}," (default = 'localhost'): Server or container name where NATS Server is running."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Port"]}," (default = '4222'): Port number of NATS Server."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["DeviceId"]}," (default = '999'): The default Device Id to use when sending data."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Subscriptions"]},": The array of incoming topics to subscribe to. \"DataIn\" and \"RequestIn\" are required to receive ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["IoDataReportMsg"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["RequestMsg"]},", respectively."]}]}]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Example"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n    \"Name\": \"MyApp\",\n    \"AEA2\": {\n        \"RedisClient\": {\n            \"Server\": \"localhost\",\n            \"Port\": \"6379\"\n        },\n        \"BusClient\": {\n            \"Server\": \"nats://localhost:4222\",\n            \"Subscriptions\": [\n                {\n                    \"DataIn\": [\n                        \"slbapps.MyApp.DataIn\",\n                        \"slbapps.events.DataIn\"\n                    ]\n                },\n                {\n                    \"RequestIn\": [\n                        \"slbapps.MyApp.RequestIn\"\n                    ]\n                },\n                {\n                    \"EventIn\": [\n                        \"slbapps.MyApp.EventIn\"\n                    ]\n                }\n            ],\n            \"Targets\": [\n                {\n                    \"DataOut\": [\n                        \"slbapps.app1.DataIn\",\n                        \"slbapps.app2.DataIn\",\n                    ]\n                },\n                {\n                    \"RequestOut\": [\n                        \"slbapps.app1.RequestIn\",\n                        \"slbapps.app2.RequestIn\",\n                    ]\n                },\n                {\n                    \"EventOut\": [\n                        \"slbapps.app1.EventIn\",\n                        \"slbapps.app2.EventIn\",\n                    ]\n                }\n            ]\n        }\n    }\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"\n### BusClient and the IIoT Edge Apps Message Broker\n\nThe **BusClient** is used for interacting with the NATS server.  \n\n##### IoDataReportMsg - DataIn/DataOut\n\nThe `IoDataReportMsg` is used to create data Data messages. The class diagram for an `IoDataReportMsg` is shown below.\n\n![IoDataReportMsg Class Diagram](images/IoDataReportMsgClassDiagram.png)\n\nThe class diagram is complex as it takes advantage of many generic classes, however it ultimately represents \nthe JSON messages shown below, encapsulating data from potentially multiple device and multiple tags single values per tag.\n\n##### Example IoDataReport JSON Message\n\n```json\n{\n   \"header\": {\n      \"MessageID\": 123, \n      \"MessageType\": \"IODataReport\",\n      \"ConfigVersion\": 1,\n      \"SrcModule\": \"test-module\",\n      \"TimeStamp\": 1709069281899\n   },\n  \"device\": [\n    {\n      \"id\": \"1000\",\n      \"tags\": {\n        \"Pressure_psi\": {\n          \"quality_code\": 0,\n          \"timestamp\": 1709069251699,\n          \"value\": 1002.2\n        },\n        \"Temperature_degC\": {\n          \"quality_code\": 0,\n          \"timestamp\": 1709069251699,\n          \"value\": 30.1\n        }\n      }\n    },\n    {\n      \"id\": \"2\",\n      \"tags\": {\n        \"Pressure_psi\": {\n          \"quality_code\": 0,\n          \"timestamp\": 1709069251699,\n          \"value\": 983.2,\n        },\n        \"Temperature_degC\": {\n          \"quality_code\": 1,\n          \"timestamp\": 1709069251699,\n          \"value\": 29.2\n        }\n      }\n    }\n  ]\n}\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"mocking-the-connection-to-the-message-bus","__idx":5},"children":["Mocking the connection to the message bus."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["While running unit tests, it is usually necessary to generate test data for an app or to check that the application produced appropriate messages while running."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The following example shows how to mock the connect, send data, and parse the incoming data messages:"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["AEA.json"]},":"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n    \"AEA2\": {\n        \"BusClient\": {\n        \"Mock\": true,\n        \"DeviceId\": 300,\n        }\n    }\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"_-2","__idx":6},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#tab/net"},"children":["NET"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"csharp","header":{"controls":{"copy":{}}},"source":"double [] temperatures = {71.0, 72.0, 73.0, 72.5, 53.8, 68.3, 79.3, 85.4};\n\nIoDataReportMsg msg = new();\nint i = 0;\nforeach(var t in temperatures)\n{\n    msg.Add($\"TEMP{i}\", new IoPoint() {value = t, quality_code = 0 };\n    i++;\n}\nBus.SendData(msg);\n\nforeach(var m in Bus.Message.GetDataMessages())\n    foreach(var d in m.device)\n    {\n        $\"DeviceId = {d.Id}\".Cout();\n        \"Tags:\".Cout();\n        foreach(var t in d.Tags)\n            $\"--- {t.Key} - {t.Value.value}\".Cout();\n    }\n","lang":"csharp"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"_-3","__idx":7},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#tab/python"},"children":["Python"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"python","header":{"controls":{"copy":{}}},"source":"from agoraiot import *\n\ntemperatures = [71.0, 72.0, 73.0, 72.5, 53.8, 68.3, 79.3, 85.4]\n\nmsg = IoDataReportMsg()\ni = 0\nfor t in temperatures:\n    msg.add_data(f\"TEMP{i}\", IoPoint(value = t, quality_code=0))\n    i = i + 1\n\nbus_client.send_data(msg)\n\nfor m in bus_client.messages.get_data_messages():\n    for d in m.device:\n        print(f\"DeviceId = {d.id}\")\n        print(\"Tags:\")\n        for key,value in d.tags.items():\n            print(f\"--- {key} - {value.value}\");\n","lang":"python"},"children":[]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":5,"id":"requests","__idx":8},"children":["Requests"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The SDK provides the ability to construct and receive Requests.  A request is a simple message, which allows a Command name and a set of named Arguments or"," ","Device data to be encapsulated within.  The following is an example of creating a request:"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"_-4","__idx":9},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#tab/net"},"children":["NET"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"csharp","header":{"controls":{"copy":{}}},"source":"var req = new RequestMsg();\nreq.Command = \"RequestName\";\nreq.Payload.Add( \"Parameter1\", \"Value1\" );\nreq.Payload.Add( \"Parameter2\", \"Value2\" );\n\nint correlationId = Bus.SendRequest(req);\n","lang":"csharp"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"_-5","__idx":10},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#tab/python"},"children":["Python"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"python","header":{"controls":{"copy":{}}},"source":"req = RequestMsg(requestName = \"RequestName\")\nreq.payload[\"Parameter1\"] = \"Value1\"\nreq.payload[\"Parameter2\"] = \"Value2\"\n\ncorrelation_id = bus_client.send_request(req)\n","lang":"python"},"children":[]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Receiving requests is also simple and is shown below with the creation of a response message that uses the requests correlation id (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["RequestMsg.Id"]},"):"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"_-6","__idx":11},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#tab/net"},"children":["NET"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"csharp","header":{"controls":{"copy":{}}},"source":"if (Bus.Messages.HasRequestMessages)\n{\n    var requests = Bus.Messages.GetRequestMessages();\n\n    foreach (var request in requests)\n    {\n        if (request.Command == \"RequestName\")\n        {\n            // ... do something interesting ...\n        }\n    }\n}\n","lang":"csharp"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"_-7","__idx":12},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#tab/python"},"children":["Python"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"python","header":{"controls":{"copy":{}}},"source":"if bus_client.messages.has_request_messages:\n    msgs = bus_client.messages.get_request_messages()\n    for msg in msgs:\n        if msg.header.MessageType == \"RequestName\":\n            # do something interesting\n","lang":"python"},"children":[]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":5,"id":"events","__idx":13},"children":["Events"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The Events Schema describes Alert / Events to Agora Cloud via ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/solutions/agora/components/passthrough-handler#passthrough-handler"},"children":["Passthrough handler"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The class diagram for an EventMsg Schema is shown below."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/eventmsgschema.ad66791bb0cbb84d9fc7c18e49a8d1798d84b32e6eb8455cadacb5f027035bca.44b05d90.png","alt":"EventMgSchema Class Diagram"},"children":[]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"busmessagequeues","__idx":14},"children":["BusMessageQueues"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["BusMessageQueues"]}," is used for accessing the messages arriving via the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["BusClient"]},".  To communicate through the NATS Server, you"," ","should use ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#busclient-and-the-agora-edge-apps-message-broker"},"children":["BusClient"]}," as it provides methods that enable the core messages used by IIoT Edge Apps."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"_-8","__idx":15},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#tab/net"},"children":["NET"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Properties:"]}]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["HasApplicationMessage: bool"]}," - ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["True"]}," if Application Messages are available."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["HasDataInMessages: bool"]}," - ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["True"]}," if DataIn Messages are available. Requires ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["AEA2:BusClient:UseDataIn = True"]}," in the application configuration."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["HasRequestInMessages: bool"]}," - ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["True"]}," if RequestIn Messages are available. Requires ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["AEA2:BusClient:UseRequestIn = True"]}," in the application configuration."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["HasEventMessages: bool"]}," - ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["True"]}," if Event Messages are available."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Methods:"]}]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GetApplicationInMessages(): IList<byte[]>"]}," - Returns a list of raw Application Messages."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GetDataInMessages(): IList<IoDataReportMsg>"]}," - Returns a list of DataIn Messages waiting in the queue converted to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["IoDataReportMsg"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GetRequestInMessages(): IList<RequestMsg>"]}," - Returns a list of Request Messages waiting in the queue converted to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["RequestMsg"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GetEventMessages(): IList<EventMsg>"]}," - Returns a list of Event Messages waiting in the queue converted to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["EventMsg"]},"."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"_-9","__idx":16},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#tab/python"},"children":["Python"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Properties:"]}]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["has_application_messages: bool"]}," - ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["True"]}," if Application Messages are available."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["has_data_messages: bool"]}," - ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["True"]}," if DataIn Messages are available."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["has_request_messages: bool"]}," - ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["True"]}," if RequestIn Messages are available."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["has_event_messages: bool"]}," - ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["True"]}," if event Messages are available."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Methods:"]}]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["get_application_messages():"]}," - Returns a list of raw Application Messages."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["get_data_messages():"]}," -  Returns a list of DataIn Messages waiting in the queue converted to IoDataReportMsg."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["get_request_messages():"]}," - Returns a list of raw StateRequest Messages."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["get_event_messages():"]}," - Returns a list of raw event Messages."]}]}]},"headings":[{"value":"Messaging","id":"messaging","depth":2},{"value":"BusClient","id":"busclient","depth":2},{"value":"","id":"_","depth":1},{"value":"","id":"_-1","depth":1},{"value":"Configuring BusClient","id":"configuring-busclient","depth":4},{"value":"Mocking the connection to the message bus.","id":"mocking-the-connection-to-the-message-bus","depth":3},{"value":"","id":"_-2","depth":1},{"value":"","id":"_-3","depth":1},{"value":"Requests","id":"requests","depth":5},{"value":"","id":"_-4","depth":1},{"value":"","id":"_-5","depth":1},{"value":"","id":"_-6","depth":1},{"value":"","id":"_-7","depth":1},{"value":"Events","id":"events","depth":5},{"value":"BusMessageQueues","id":"busmessagequeues","depth":2},{"value":"","id":"_-8","depth":1},{"value":"","id":"_-9","depth":1}],"frontmatter":{"seo":{"title":"Messaging"}},"lastModified":"2026-01-14T00:18:30.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/solutions/agora/referencemanual/messaging","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}