Skip to content

Commit

Permalink
feature: add compress request body config (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
mhmtszr committed May 10, 2023
1 parent 3e81169 commit 8a6ce52
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ Check out on [go-dcp-client](https://github.com/Trendyol/go-dcp-client#configura
| `elasticsearch.batchByteSizeLimit` | int | no | 10485760 |
| `elasticsearch.maxConnsPerHost` | int | no | 512 |
| `elasticsearch.maxIdleConnDuration` | time.Duration | no | 10s |
| `elasticsearch.compressionEnabled` | boolean | no | false |

---

Expand Down
1 change: 1 addition & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ type Elasticsearch struct {
BatchSizeLimit int `yaml:"batchSizeLimit"`
BatchByteSizeLimit int `yaml:"batchByteSizeLimit"`
BatchTickerDuration time.Duration `yaml:"batchTickerDuration"`
CompressionEnabled bool `yaml:"compressionEnabled"`
}

type Config struct {
Expand Down
1 change: 1 addition & 0 deletions elasticsearch/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ func NewElasticClient(config *config.Config) (*elasticsearch.Client, error) {
Addresses: config.Elasticsearch.Urls,
DiscoverNodesOnStart: true,
Transport: newTransport(config.Elasticsearch),
CompressRequestBody: config.Elasticsearch.CompressionEnabled,
})
if err != nil {
return nil, err
Expand Down

0 comments on commit 8a6ce52

Please sign in to comment.