1

I am writing a client using the Milo library in the Java programming language. I have seen examples where the setValueConsumer(Value Consumer value Consumer) or setEventConsumer(EventConsumer eventConsumer) method of the UaMonitoredItem object is used, but as I understood it is necessary only for debugging information/logs. Like in this example:

monitoredItem.setEventConsumer((item, vs) -> {
            logger.info(
                "Event Received from {}",
                item.getReadValueId().getNodeId());
});

The question is how to catch the UaMonitoredItem change when using a subscription in order to use this notification in other parts of the application?

1 Answers1

2

There's no reason you can't use this callback in your application as well. The example just doesn't other parts of an application to do anything with it.

Kevin Herron
  • 6,500
  • 3
  • 26
  • 35
  • Thank you so much for your answer, Kevin Herron, there were just some doubts about the correctness of my decision, due to the lack of documentation. You saved me from the torment of my mind! – Killpop3770 Aug 31 '22 at 14:44
  • See https://github.com/eclipse/milo/wiki/Client#subscriptions also – Kevin Herron Aug 31 '22 at 14:59