Stream live MXAccess advice events from the Rust worker

This commit is contained in:
Joseph Doherty
2026-11-21 08:56:01 -05:00
parent 1a44b5ac31
commit 00a597b08b
9 changed files with 1560 additions and 46 deletions
+34 -9
View File
@@ -6,15 +6,21 @@ schemas at build time.
The worker authenticates the launch nonce, negotiates a frame limit, activates
LMXProxy on a dedicated message-pumping STA, and reports readiness and heartbeats.
It supports Register, Unregister, AddItem, RemoveItem, and the worker diagnostic
commands. Shutdown unregisters any remaining clients before releasing COM. The
existing C# worker is the gateway default.
It supports Register, Unregister, AddItem, RemoveItem, Advise, UnAdvise, and the
worker diagnostic commands. The worker uses the base MXAccess COM connection
point for OnDataChange, OperationComplete, and OnWriteComplete notifications.
OnDataChange carries the value, quality, MXAccess status records, source
timestamp when available, and worker sequence and timestamp. The bounded queue
faults the session on overflow. Shutdown detaches the sink, unadvises remaining
items, and unregisters clients before releasing COM. The C# worker is the
gateway default.
COM connection points, event delivery, Advise, value and status conversion beyond
integer handles, writes, bulk commands, alarms, and record-info pinning remain to
be implemented. Unsupported commands return `InvalidRequest`. The prototype
serializes commands and does not interrupt COM calls on cancellation. If a call
exceeds the STA timeout, the worker faults the session and exits.
Event conversion supports standard Automation scalar values and homogeneous
arrays of those types. Other variant types are reported as unknown with the
Automation type in the diagnostic. Writes, buffered or supervisory advice,
bulk commands, and alarms remain to be implemented. Unsupported commands
return `InvalidRequest`. The worker serializes commands. If a COM call exceeds
the STA timeout, the worker faults the session and exits.
## Build and test
@@ -41,15 +47,34 @@ handshake, heartbeat, registration, item lifecycle when configured, and graceful
shutdown. It runs without a gateway service. Portable framing tests also run
with `cargo test --locked` on macOS and Linux.
From the repository root on a Windows development host with
`TestMachine_001.TestChangingInt` deployed, run the opt-in HTTP/2 test to verify
the Rust worker through the gateway:
```powershell
$env:MXGATEWAY_RUN_RUST_WORKER_LIVE_TESTS = '1'
$env:MXGATEWAY_LIVE_MXACCESS_WORKER_EXE = (Resolve-Path 'src/mxgateway-worker-rust/target/i686-pc-windows-msvc/release/mxgateway-worker-rust.exe').Path
dotnet test src/ZB.MOM.WW.MxGateway.IntegrationTests --filter FullyQualifiedName~GatewayGrpc_WithRustWorker_StreamsChangingIntegersAndUnadvises
```
The test starts the gateway gRPC service on an ephemeral loopback port and
launches the configured Rust worker. It verifies that the client receives
distinct good-quality integer values in sequence and that the worker emits no
new data for the item after UnAdvise.
## COM interface evidence
The native adapter uses the dual `ILMXProxyServer` interface from the installed
`ArchestrA.MxAccess` 3.2.0.0 assembly. REA inspection confirmed the declaration
order and managed signatures for Register, Unregister, AddItem, and RemoveItem.
Windows reflection confirmed the interface IID, dual-interface flag, DISPIDs, and
BSTR input annotations. The live test exercises the corresponding native calls.
BSTR input annotations. REA and Windows reflection also identified the base
event dispatch interface and the `MXSTATUS_PROXY` layout. The live tests exercise
the corresponding native calls and event callbacks.
- Assembly SHA-256
`cba8b607305ee0c70ca38b09eca645ae3b98c35a7b78ec051eb4381f48d9e0b1`
- REA managed member evidence
`ev_78053da509335e3e3749b8e6bb020f28c45255b54d910546659c6760eb52160b`
- REA event member evidence
`ev_97162abcd831b2d84b5b43fb72cd9876252bbe3bb0af5c4673a6954911500e54`