Add sessionIdleTimeoutInSec md
@@ -80,6 +80,7 @@ const (
keyQueueName = "queueName"
keyRequireSessions = "requireSessions"
keyMaxConcurrentSessions = "maxConcurrentSessions"
+ keySessionIdleTimeoutInSec = "sessionIdleTimeoutInSec"
)
// Defaults.
@@ -115,6 +116,7 @@ const (
defaultPublishInitialRetryInternalInMs = 500
defaultMaxConcurrentSessions = 8
+ defaultSesssionIdleTimeoutInSec = -1 // -1 means use the value from `defaultTimeoutInSec`.
)
// Modes for ParseMetadata.
@@ -282,6 +284,14 @@ func ParseMetadata(md map[string]string, logger logger.Logger, mode byte) (m *Me
}
}
+ m.SessionIdleTimeoutInSec = defaultSesssionIdleTimeoutInSec
+ if val, ok := md[keySessionIdleTimeoutInSec]; ok && val != "" {
+ m.SessionIdleTimeoutInSec, err = strconv.Atoi(val)
+ if err != nil {
+ return m, fmt.Errorf("invalid sessionIdleTimeoutInSec %s: %s", val, err)
+ }
+ }
+
/* Nullable configuration settings - defaults will be set by the server. */
if val, ok := md[keyMaxDeliveryCount]; ok && val != "" {
var valAsInt int64
