Skip to content

Commit

Permalink
update mx chain comm go
Browse files Browse the repository at this point in the history
  • Loading branch information
miiu96 committed Jun 7, 2023
1 parent db1ca8e commit 299ae21
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 9 deletions.
4 changes: 3 additions & 1 deletion cmd/elasticindexer/config/prefs.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@
# Retry duration (receive/send ack signal) in seconds
retry-duration-in-seconds = 5
# Signals if in case of data payload processing error, we should send the ack signal or not
blocking-ack-on-error = false
blocking-ack-on-error = true
# After a message will be sent it will wait for an ack message if this flag is enabled
with-acknowledge = true
# The duration in seconds to wait for an acknowledgment message, after this time passes an error will be returned
acknowledge-timeout-in-seconds = 50

[config.elastic-cluster]
use-kibana = false
Expand Down
1 change: 1 addition & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ type ClusterConfig struct {
RetryDurationInSec uint32 `toml:"retry-duration-in-seconds"`
BlockingAckOnError bool `toml:"blocking-ack-on-error"`
WithAcknowledge bool `toml:"with-acknowledge"`
AckTimeoutInSec uint32 `toml:"acknowledge-timeout-in-seconds"`
} `toml:"web-socket"`
ElasticCluster struct {
UseKibana bool `toml:"use-kibana"`
Expand Down
11 changes: 6 additions & 5 deletions factory/wsIndexerFactory.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,12 @@ func prepareIndices(availableIndices, disabledIndices []string) []string {
func createWsHost(clusterCfg config.ClusterConfig, wsMarshaller marshal.Marshalizer) (factoryHost.FullDuplexHost, error) {
return factoryHost.CreateWebSocketHost(factoryHost.ArgsWebSocketHost{
WebSocketConfig: data.WebSocketConfig{
URL: clusterCfg.Config.WebSocket.URL,
WithAcknowledge: clusterCfg.Config.WebSocket.WithAcknowledge,
Mode: clusterCfg.Config.WebSocket.Mode,
RetryDurationInSec: int(clusterCfg.Config.WebSocket.RetryDurationInSec),
BlockingAckOnError: clusterCfg.Config.WebSocket.BlockingAckOnError,
URL: clusterCfg.Config.WebSocket.URL,
WithAcknowledge: clusterCfg.Config.WebSocket.WithAcknowledge,
Mode: clusterCfg.Config.WebSocket.Mode,
RetryDurationInSec: int(clusterCfg.Config.WebSocket.RetryDurationInSec),
AcknowledgeTimeoutInSec: int(clusterCfg.Config.WebSocket.AckTimeoutInSec),
BlockingAckOnError: clusterCfg.Config.WebSocket.BlockingAckOnError,
},
Marshaller: wsMarshaller,
Log: log,
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.17

require (
github.com/elastic/go-elasticsearch/v7 v7.12.0
github.com/multiversx/mx-chain-communication-go v1.0.2
github.com/multiversx/mx-chain-communication-go v1.0.3-0.20230607101542-b80e6e676772
github.com/multiversx/mx-chain-core-go v1.2.4
github.com/multiversx/mx-chain-logger-go v1.0.11
github.com/multiversx/mx-chain-vm-common-go v1.4.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -471,8 +471,8 @@ github.com/multiformats/go-varint v0.0.2/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXS
github.com/multiformats/go-varint v0.0.5/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE=
github.com/multiformats/go-varint v0.0.6/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE=
github.com/multiversx/concurrent-map v0.1.4/go.mod h1:8cWFRJDOrWHOTNSqgYCUvwT7c7eFQ4U2vKMOp4A/9+o=
github.com/multiversx/mx-chain-communication-go v1.0.2 h1:1AKdqFZNmigt1kcwYMl+L8fzolsb+WpeTX6yzpmvbV4=
github.com/multiversx/mx-chain-communication-go v1.0.2/go.mod h1:OnnSUjnSP87H5MtQtxn33FGnTVRVgo2Huo3ijmCgN2M=
github.com/multiversx/mx-chain-communication-go v1.0.3-0.20230607101542-b80e6e676772 h1:K5lIIlpjBckiQtNJLCpTHkaYAnEUBA3xSkQ6kC0MpUY=
github.com/multiversx/mx-chain-communication-go v1.0.3-0.20230607101542-b80e6e676772/go.mod h1:OnnSUjnSP87H5MtQtxn33FGnTVRVgo2Huo3ijmCgN2M=
github.com/multiversx/mx-chain-core-go v1.1.30/go.mod h1:8gGEQv6BWuuJwhd25qqhCOZbBSv9mk+hLeKvinSaSMk=
github.com/multiversx/mx-chain-core-go v1.2.1-0.20230510143029-ab37792342df/go.mod h1:jzYFSiYBuO0dGpGFXnZWSwcwcKP7Flyn/X41y4zIQrQ=
github.com/multiversx/mx-chain-core-go v1.2.1/go.mod h1:8gGEQv6BWuuJwhd25qqhCOZbBSv9mk+hLeKvinSaSMk=
Expand Down

0 comments on commit 299ae21

Please sign in to comment.