Closed Zachery2008 closed 3 years ago
There are two questions only somewhat related.
When connecting via a connection string you should NOT have to re-create the client every hour. This is taken care of by the service client itself.
Now as to the question of what's going on with your file upload notification.
You can get logs by setting DEBUG="azure,rhea"
These will generate log files. Do not just publish the logs here. It will contain private data.
You should be able to examine the logs. Look particularly for strings of the form "Error on the file notification link". Are you seeing anything that looks like errors handling going on?
Is this always reproducible?
Does it happen after just 1 hour?
@anthonyvercolano Thank you for your response.
Quote: "When connecting via a connection string you should NOT have to re-create the client every hour. This is taken care of by the service client itself."
Does this suggest that the client will renew its SAS token at the client level even though it had only 1 hour valid SAS token when it was created? or the client SAS token will expire but each https request has a new SAS token at http request level so we don't have to worry?
Quote: "You can get logs by setting DEBUG="azure,rhea"
We actually never enabled this Azure logging. I will enable it as soon as possible.
Quote: "Is this always reproducible? Does it happen after just 1 hour?"
We actually opened an issue a month ago about losing connection of iothub file upload notification. And followed your suggestion to listening to "disconnect" event and reconnect. We're good about several days. However, there was an incident that we lost all connection, and we didn't know this during the weekend. and we didn't grab "disconnect" event. It's really hard to purposely reproduce.
Another question, say like a 'disconnect' happened a few days after the client was created. Could you still use the same client to open a new connection?
The not worry about it case would be if you created the client with an invocation of .fromConnectionString
You would have to provide a new SharedAccessSignature if you created the client with an invocation of .fromSharedAccessSignature. You would invoke .updateSharedAccessSignature on the client you created with .fromSharedAccessSignature.
Well in the case of a disconnect on the service side, is it simpler for you do simply do a close to clean up then after the callback from the close to do an open? Or you should be able to create a whole new client again at that point.
Closing due to in-activity.
We have a question about the IoTHub service client which is created by connectionSrtring. By default, the client's SAS token would expire in one hour. Does this mean we need to re-create the client every hour? or the client will automatically renew the token itself?
The real issue is: sometimes the client is losing connection of listening file upload notification silently, but we never successfully grabbed "disconnection" event. It's just gone. The solution we came up is that we establish the client connection periodically(1hour). To do this, do we need to re-create a new client or use the previous client to open the connection again with consideration of its SAS token already expired?
Right now, we are re-create the client everytime.