You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/docs/features/features.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -96,6 +96,9 @@ Extended features add connectivity and monitoring capabilities:
96
96
97
97
-[olink](olink.md) - provides client and server adapters for the [ObjectLink](/docs/protocols/objectlink/intro) protocol. Use this to connect your Unreal application to remote services or the ApiGear simulation tools.
98
98
-[msgbus](msgbus.md) - provides adapters using Unreal's built-in Message Bus for inter-process communication within the Unreal ecosystem.
99
+
100
+
> **Choosing between OLink and Message Bus?** See the [comparison guide](msgbus.md#when-to-use-message-bus-vs-olink) for a detailed breakdown.
101
+
99
102
-[monitor](monitor.md) - generates a middleware layer which logs all API events to the [CLI](/docs/cli/intro) or the [Studio](/docs/studio/intro).
@@ -11,7 +11,7 @@ import helloWorldModuleComponent from '!!raw-loader!./data/helloworld.module.yam
11
11
12
12
# Message Bus
13
13
14
-
The `msgbus` feature provides client and adapter implementations using Unreal Engine's built-in [Message Bus](https://docs.unrealengine.com/5.0/en-US/API/Runtime/Messaging/IMessageBus/) system. This enables:
14
+
The `msgbus` feature provides client and adapter implementations using Unreal Engine's built-in [Message Bus](https://dev.epicgames.com/documentation/en-us/unreal-engine/API/Runtime/Messaging/IMessageBus) system. This enables:
15
15
16
16
-**Inter-process communication**: Connect Unreal applications running on the same machine
17
17
-**Editor-to-game communication**: Share data between editor tools and PIE sessions
@@ -68,20 +68,6 @@ The following file structure is generated in the `IoWorldMsgBus` module:
68
68
┗ 📜IoWorldMsgBus.Build.cs
69
69
```
70
70
71
-
## Message Protocol
72
-
73
-
The Message Bus feature uses generated message structures (`IoWorldHelloMsgBusMessages.h`) for communication between client and adapter. These messages handle:
74
-
75
-
-**Connection lifecycle** - service discovery, initialization, and disconnect
76
-
-**Heartbeat monitoring** - ping/pong messages to detect connection health
77
-
-**Property synchronization** - change requests and notifications
78
-
-**Operation request/response** - calls with correlation IDs for matching replies
79
-
-**Signal broadcasting** - events sent to all connected clients
80
-
81
-
:::note
82
-
You don't need to interact with these message types directly - they are used internally by the client and adapter classes.
83
-
:::
84
-
85
71
## Message Bus Client
86
72
87
73
The `UIoWorldHelloMsgBusClient` class implements `IIoWorldHelloInterface` and communicates with a remote adapter via Message Bus.
@@ -94,6 +80,32 @@ The `UIoWorldHelloMsgBusClient` class implements `IIoWorldHelloInterface` and co
94
80
4.**Caches state**: Maintains local copies of properties synchronized from the adapter
95
81
5.**Monitors health**: Tracks connection status with heartbeat ping/pong
96
82
83
+
```mermaid
84
+
graph TB
85
+
subgraph Local[" Your Application "]
86
+
Code[Application Code]
87
+
end
88
+
89
+
subgraph Client[" MsgBus Client "]
90
+
Interface["IIoWorldHelloInterface"]
91
+
end
92
+
93
+
subgraph Transport[" Message Bus "]
94
+
Bus((UDP))
95
+
end
96
+
97
+
subgraph Remote[" Remote "]
98
+
Adapter[MsgBus Adapter]
99
+
end
100
+
101
+
Code -->|uses| Interface
102
+
Interface <-->|requests| Bus
103
+
Bus -.->|updates| Interface
104
+
Bus <-->|messages| Adapter
105
+
```
106
+
107
+
*The client acts as a **Remote Proxy** - it implements the same interface as the backend service but forwards calls over Message Bus. Properties are cached locally for fast reads.*
108
+
97
109
### Connection Management
98
110
99
111
The client provides methods to manage the connection lifecycle:
@@ -168,6 +180,37 @@ The `UIoWorldHelloMsgBusAdapter` wraps a local `IIoWorldHelloInterface` implemen
168
180
4. **Broadcasts updates**: Publishes property changes and signals to all subscribed clients
169
181
5. **Tracks clients**: Monitors connected clients and handles timeouts
*The adapter uses the **Adapter Pattern** - it wraps any `IIoWorldHelloInterface` implementation and exposes it over Message Bus. Multiple clients can connect simultaneously.*
213
+
171
214
### Connection Management
172
215
173
216
The adapter provides methods to control when it accepts client connections:
- For high-frequency updates, consider using direct connections
262
305
- Property changes are only broadcast when values actually change
263
306
- The client tracks sent values to avoid redundant network requests
307
+
308
+
## Message Protocol
309
+
310
+
The Message Bus feature uses generated message structures (`IoWorldHelloMsgBusMessages.h`) for communication between client and adapter. These messages handle:
311
+
312
+
-**Connection lifecycle** - service discovery, initialization, and disconnect
313
+
-**Heartbeat monitoring** - ping/pong messages to detect connection health
314
+
-**Property synchronization** - change requests and notifications
315
+
-**Operation request/response** - calls with correlation IDs for matching replies
316
+
-**Signal broadcasting** - events sent to all connected clients
317
+
318
+
:::note
319
+
You don't need to interact with these message types directly - they are used internally by the client and adapter classes.
320
+
:::
321
+
322
+
### Communication Flow
323
+
324
+
The following diagram shows how messages flow between client and adapter for each type of interaction:
325
+
326
+
```mermaid
327
+
sequenceDiagram
328
+
participant App as Application
329
+
participant Client as MsgBusClient
330
+
participant Bus as Message Bus
331
+
participant Adapter as MsgBusAdapter
332
+
participant Backend as Backend Service
333
+
334
+
rect rgb(240, 248, 255)
335
+
Note over Client,Adapter: Service Discovery & Connection
0 commit comments