fix(lmxproxy): make MxAccess client name unique per instance

Multiple instances registering with the same name may cause MxAccess to
conflict on callback routing. ClientName is now configurable via
appsettings.json, defaulting to a GUID-suffixed name if not set.
Instances A and B use "LmxProxy-A" and "LmxProxy-B" respectively.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Joseph Doherty
2026-03-22 23:17:55 -04:00
parent a59d4ad76c
commit a326a8cbde
5 changed files with 14 additions and 5 deletions

View File

@@ -107,8 +107,9 @@ namespace ZB.MOM.WW.LmxProxy.Host.MxAccess
_lmxProxy.OnDataChange += OnDataChange;
_lmxProxy.OnWriteComplete += OnWriteComplete;
// Register with MxAccess
_connectionHandle = _lmxProxy.Register("ZB.MOM.WW.LmxProxy.Host");
// Register with MxAccess using unique client name
_connectionHandle = _lmxProxy.Register(_clientName);
Log.Information("Registered with MxAccess as '{ClientName}'", _clientName);
if (_connectionHandle <= 0)
{