I would like to ask when to use ManagedSubscription and when UaSubscription in OPC UA milo and what is the difference between them (I would like to know the basic idea behind it)
ManagedSubscription
presents a higher-level and easier to use API that provides easier to use blocking method calls.
It uses the UaSubscription API underneath, which is async first and a more direct representation of the service calls as defined by the spec. It's more flexible but is more difficult to use, especially if you are not familiar with OPC UA or Java's CompletableFuture API.