When a Python subscriber connects to the C# STTP publisher, metadata for external measurements can be silently excluded. Python defines OperationalModes.RECEIVEINTERNALMETADATA and RECEIVEEXTERNALMETADATA, but DataSubscriber._send_operationalmodes() sends neither flag, and neither Config nor Settings exposes an option to enable them.
The C# publisher's AcquireMetadata() interprets this combination by applying Internal <> 0 to MeasurementDetail and, unless MutualSubscription is enabled, OriginalSource IS NULL to DeviceDetail. Consequently, an external-only input selection produces an empty measurement metadata table even when the publisher's SQL returns the intended records.
Reproduction and confirmed workaround
- Connect a Python Subscriber with the default Config to a C# STTP publisher whose selected measurements are external (
Internal=0).
- Request metadata, as the subscriber does automatically by default.
- Observe that the returned MeasurementDetail table is empty.
- Add the following flags in
_send_operationalmodes() before sending DEFINEOPERATIONALMODES, then reconnect:
operationalModes |= OperationalModes.RECEIVEINTERNALMETADATA
operationalModes |= OperationalModes.RECEIVEEXTERNALMETADATA
Enabling these flags was confirmed to resolve the issue in the affected runtime. Offline examination of the corresponding database also showed that the publisher SQL selected 19 external measurements, 1 device, and 6 phasors; the existing metadata inclusion filters explain why those records were excluded. A version row can remain, so a successful response or positive aggregate metadata count does not establish that measurement metadata was received.
Requested change
Expose internal/external metadata inclusion as supported Python connection configuration, equivalent to the C# subscriber options:
config = Config(
receiveinternalmetadata=True,
receiveexternalmetadata=True,
)
subscriber.connect("publisher:port", config)
Suggested implementation:
- Add documented options and defaults to Config/Defaults.
- Propagate them to DataSubscriber in Subscriber._connect().
- Set the corresponding OperationalModes bits in
_send_operationalmodes(), including on reconnect.
- Document the chosen defaults and their compatibility implications. Explicit configuration should allow external metadata regardless of the default policy.
- Add tests for flag combinations and configuration propagation, ensuring compression/version/encoding bits are preserved.
Relevant source
Config.metadatafilters cannot provide this behavior: those expressions further restrict metadata and do not override the internal/external inclusion flags. Currently, an application must modify the library or intercept the outgoing operational-mode command to request both categories.
When a Python subscriber connects to the C# STTP publisher, metadata for external measurements can be silently excluded. Python defines
OperationalModes.RECEIVEINTERNALMETADATAandRECEIVEEXTERNALMETADATA, butDataSubscriber._send_operationalmodes()sends neither flag, and neitherConfignorSettingsexposes an option to enable them.The C# publisher's
AcquireMetadata()interprets this combination by applyingInternal <> 0to MeasurementDetail and, unless MutualSubscription is enabled,OriginalSource IS NULLto DeviceDetail. Consequently, an external-only input selection produces an empty measurement metadata table even when the publisher's SQL returns the intended records.Reproduction and confirmed workaround
Internal=0)._send_operationalmodes()before sending DEFINEOPERATIONALMODES, then reconnect:Enabling these flags was confirmed to resolve the issue in the affected runtime. Offline examination of the corresponding database also showed that the publisher SQL selected 19 external measurements, 1 device, and 6 phasors; the existing metadata inclusion filters explain why those records were excluded. A version row can remain, so a successful response or positive aggregate metadata count does not establish that measurement metadata was received.
Requested change
Expose internal/external metadata inclusion as supported Python connection configuration, equivalent to the C# subscriber options:
Suggested implementation:
_send_operationalmodes(), including on reconnect.Relevant source
_send_operationalmodes()_connect()AcquireMetadata()Config.metadatafilterscannot provide this behavior: those expressions further restrict metadata and do not override the internal/external inclusion flags. Currently, an application must modify the library or intercept the outgoing operational-mode command to request both categories.