You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pubsub-lib/JetStreamUtil.go
+4-2Lines changed: 4 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -125,10 +125,12 @@ type NatsTopic struct {
125
125
}
126
126
typeConfigJsonstruct {
127
127
// StreamConfigJson is a json string of map[string]NatsStreamConfig
128
-
StreamConfigJsonstring`env:"STREAM_CONFIG_JSON"`
128
+
StreamConfigJsonstring`env:"STREAM_CONFIG_JSON" description:"This is json map of nats stream configurations per stream. eg: {"ORCHESTRATOR":{"max_age":3600,"replicas":1}}"`
129
+
129
130
// ConsumerConfigJson is a json string of map[string]NatsConsumerConfig
NatsMsgProcessingBatchSizeint`env:"NATS_MSG_PROCESSING_BATCH_SIZE" envDefault:"1" description:"NatsMsgProcessingBatchSize is the number of messages that will be processed in one go"`
40
+
40
41
41
42
// NatsMsgBufferSize is the number of messages that will be buffered in memory (channel size)
42
43
// it is recommended to set this value equal to NatsMsgProcessingBatchSize as we want to process maximum messages in the buffer in one go.
@@ -45,10 +46,10 @@ type NatsClientConfig struct {
45
46
// NatsMsgBufferSize can be configured independently of NatsMsgProcessingBatchSize if needed by setting its value to positive value in env.
46
47
// if NatsMsgBufferSize set to a non-positive value then it will take the value of NatsMsgProcessingBatchSize.
47
48
// Note: always get this value by calling GetNatsMsgBufferSize method
NatsMsgBufferSizeint`env:"NATS_MSG_BUFFER_SIZE" envDefault:"-1" description:"NatsMsgBufferSize is the number of messages that will be buffered in memory (channel size)"`
50
+
NatsMsgMaxAgeint`env:"NATS_MSG_MAX_AGE" envDefault:"86400" description:"Age for the message to persist"`
51
+
NatsMsgAckWaitInSecsint`env:"NATS_MSG_ACK_WAIT_IN_SECS" envDefault:"120" description:"Time to wait for acknowledging the message"`
52
+
NatsMsgReplicasint`env:"NATS_MSG_REPLICAS" envDefault:"0" description:"Replica count for runnings nats instance"`
52
53
}
53
54
54
55
func (nccNatsClientConfig) GetNatsMsgBufferSize() int {
UseCustomTransportbool`env:"USE_CUSTOM_HTTP_TRANSPORT" envDefault:"false" description:"There is an issue in updating cluster bearer token with same cluster url due to transport layer token caching in k8s client lib. so we added a custom transport while calling k8s api server. this flag controls the usage of this transport.(custom or k8s)"`
189
+
TimeOutint`env:"K8s_TCP_TIMEOUT" envDefault:"30" description:"Is the maximum amount of time a dial will wait for a connect to complete, required only if USE_CUSTOM_HTTP_TRANSPORT is true."`
190
+
KeepAliveint`env:"K8s_TCP_KEEPALIVE" envDefault:"30" description:"Specifies the interval between keep-alive probes for an active, required only if USE_CUSTOM_HTTP_TRANSPORT is true."`
191
+
TLSHandshakeTimeoutint`env:"K8s_TLS_HANDSHAKE_TIMEOUT" envDefault:"10" description:"Specifies the maximum amount of time to wait for a TLS handshake. Zero means no timeout, required only if USE_CUSTOM_HTTP_TRANSPORT is true."`
192
+
MaxIdleConnsPerHostint`env:"K8s_CLIENT_MAX_IDLE_CONNS_PER_HOST" envDefault:"25" description:"k8s client max idle connections per host"`
193
+
IdleConnTimeoutint`env:"K8s_TCP_IDLE_CONN_TIMEOUT" envDefault:"300" description:"Maximum amount of time an idle (keep-alive) connection will remain idle before closing itself, required only if USE_CUSTOM_HTTP_TRANSPORT is true."`
LocalDevModeLocalDevMode`env:"RUNTIME_CONFIG_LOCAL_DEV" envDefault:"false" description: "Used in local development process. Allows to read from local kube config file path for default cluster operations."`
0 commit comments