Skip to content

Commit

Permalink
update fields
Browse files Browse the repository at this point in the history
  • Loading branch information
AdoAdoAdo committed Feb 9, 2024
1 parent c6df1e4 commit 444df14
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
6 changes: 4 additions & 2 deletions cmd/connector/config/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@
retry_duration = 5
# This flag specifies if we should send an acknowledge signal upon recieving data
with_acknowledge = true
# The duration in seconds to wait for an acknowledgement message
acknowledge_timeout_in_sec = 5
# Signals if in case of data payload processing error, we should send the ack signal or not. If you want to block
# incoming data in case of a local error, this should be set to true.
blocking_ack_on_error = true
# This flag specifies if we should drop messages if there is no connection to the host
dropMessagesIfNoConnection = false
Version = 1
drop_messages_if_no_connection = false
version = 1
5 changes: 3 additions & 2 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ type WebSocketConfig struct {
Mode string `toml:"mode"`
RetryDuration uint32 `toml:"retry_duration"`
WithAcknowledge bool `toml:"with_acknowledge"`
AcknowledgeTimeoutInSec int `toml:"acknowledge_timeout_in_sec"`
BlockingAckOnError bool `toml:"blocking_ack_on_error"`
DropMessagesIfNoConnection bool // Set to `true` to drop messages if there is no active WebSocket connection to send to.
Version uint32 // Defines the payload version.
DropMessagesIfNoConnection bool `toml:"drop_messages_if_no_connection"` // Set to `true` to drop messages if there is no active WebSocket connection to send to.
Version uint32 `toml:"version"` // Defines the payload version.
}
3 changes: 3 additions & 0 deletions factory/wsConnectorFactory.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"github.com/multiversx/mx-chain-core-go/marshal"
"github.com/multiversx/mx-chain-core-go/marshal/factory"
logger "github.com/multiversx/mx-chain-logger-go"

"github.com/multiversx/mx-chain-ws-connector-template-go/config"
"github.com/multiversx/mx-chain-ws-connector-template-go/process"
)
Expand Down Expand Up @@ -79,6 +80,8 @@ func createWsHost(wsMarshaller marshal.Marshalizer, cfg config.WebSocketConfig)
RetryDurationInSec: int(cfg.RetryDuration),
BlockingAckOnError: cfg.BlockingAckOnError,
DropMessagesIfNoConnection: false,
AcknowledgeTimeoutInSec: cfg.AcknowledgeTimeoutInSec,
Version: cfg.Version,
},
Marshaller: wsMarshaller,
Log: log,
Expand Down

0 comments on commit 444df14

Please sign in to comment.