I have a few related questions regarding Milo SDK subscriptionTransfer.
When a subscription transfer failed, we need re-create a new subscription and the monitored items, regarding the monitoredItems, can we use the old subscription to obtain the MonitoredItemCreateRequest
? Say, convert the MonitoredItem
saved in the old subscription to MonitoredItemCreateRequest
? Or we should save the previous MonitoredItemCreateRequest
in order to recreate them?
When the subscription is in transfer failed state, will the subscription be recycled by milo or we can still safely use the MonitoredItems
?
The MonitoredItemCreateRequest
has an parameter MonitoringParameters
which takes a parameter called clientHandle
. When we recreate the monitoredItems, shall we use the same clientHandle
, or we can create and use new values as the clientHandle
? If we can use the same clientHandle
, are there any advantages for use the old one?
If the attempt to recreate the subscription, or monitoredItems failed in the onSubscriptionTransferFailed
handler, what would be the suggested action?
It's not saved for you. Your application needs to keep enough of its own bookkeeping that you can create your Subscriptions and MonitoredItems again.
Not sure what you mean by "use them" - they no longer exist on the server.
You do not need to re-use the client handle. You are creating entirely new Subscriptions and MonitoredItems.
The same thing you would do if it failed while you tried to create it any other time. Presumably you have some idea of what you want to be subscribed vs. what is actually subscribed, and you retry again after some time.