Hi Kevin,
I ran into this problem again after a while.
Your suggested solution works fine. However, I think the way how the monitoring parameters are derived from the subscription could be improved.
I kinda learn the OPC UA via the SDK, so it caused me a bit of a misunderstanding to see this figure:
Based on this, I believe the data change filter and other parameters (like default queue size, discard oldest) should be configurable per monitored items.
Currently only the sampling interval parameter can be passed to ManagedSubscription's createDataItemsAsync method.
How about extending createDataItems methods by method overloading in ManagedSubscription?
Something like this:
public CompletableFuture<List<ManagedDataItem>> createDataItemsAsync(
double samplingInterval, ExtensionObject filter, UInteger queueSize, boolean discardOldest,
List<ReadValueId> readValueIds,
Consumer<ManagedDataItem> consumer
)
...or add the complete MonitoringParameters object as an extra parameter?
Kind Regards,
Istvan