File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
sdk/core/azure-core-amqp/src/main/java/com/azure/core/amqp/implementation/handler Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,7 @@ public class ConnectionHandler extends Handler {
4242 static final Symbol USER_AGENT = Symbol .valueOf ("user-agent" );
4343
4444 static final int MAX_FRAME_SIZE = 65536 ;
45+ static final int CONNECTION_IDLE_TIMEOUT = 60_000 ; // milliseconds
4546
4647 private final Map <String , Object > connectionProperties ;
4748 private final ConnectionOptions connectionOptions ;
@@ -113,6 +114,11 @@ public int getMaxFrameSize() {
113114 * @param transport Transport to add layers to.
114115 */
115116 protected void addTransportLayers (Event event , TransportInternal transport ) {
117+ // default connection idle timeout is 0.
118+ // Giving it a idle timeout will enable the client side to know broken connection faster.
119+ // Refer to http://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-transport-v1.0-os.html#doc-doc-idle-time-out
120+ transport .setIdleTimeout (CONNECTION_IDLE_TIMEOUT );
121+
116122 final SslDomain sslDomain = Proton .sslDomain ();
117123 sslDomain .init (SslDomain .Mode .CLIENT );
118124
You can’t perform that action at this time.
0 commit comments