Skip to content

Commit f730103

Browse files
authored
Merge pull request #11 from Trendyol/feat/issue-10-gets-saslMechanism-and-securityProtocol-from-config
feature: remove default values of the SaslMechanism and SecurityProtocol
2 parents 90f3de2 + f6d4e8d commit f730103

File tree

7 files changed

+43
-14
lines changed

7 files changed

+43
-14
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
## v1.3.0 (October 26, 2024)
2+
3+
### Changed:
4+
- The default value of Kafka.SaslMechanism removed from configuration.
5+
- The default value of Kafka.SecurityProtocol removed from configuration.
6+
7+
> [!WARNING]
8+
> The default values for `Kafka.SaslMechanism` and `Kafka.SecurityProtocol` have been removed. Please ensure to set these values in your configuration to avoid any issues.
9+
110
## v1.2.0 (June 11, 2024)
211

312
- Project is now open source 🥳

README.md

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717

1818
## Description
1919

20-
- Polling Outbox Publisher is an outbox implementation for distributed systems. It uses an outbox algorithm and async transactions
20+
- Polling Outbox Publisher is an outbox implementation for distributed systems. It uses an outbox algorithm and async
21+
transactions
2122
to ensure that no events are lost during processing.
2223
- This application uses a straightforward approach where it periodically checks for new messages and publishes them in
2324
groups to the Kafka cluster. It deliberately avoids more complex data transfer technologies like Debezium Change Data
@@ -62,7 +63,8 @@ git clone https://github.com/Trendyol/PollingOutboxPublisher.git
6263
3. `ExceededEvents`: The data store that holds the messages that could not be published after the retry limit is
6364
reached.
6465
4. `OutboxOffset`: The data store that holds the last published `OutboxEvents` ID.
65-
- The scritps for creating data stores can be found under examples](https://github.com/Trendyol/PollingOutboxPublisher/tree/master/examples) folder
66+
- The scritps for creating data stores can be found under
67+
examples](https://github.com/Trendyol/PollingOutboxPublisher/tree/master/examples) folder
6668

6769
### Algorithm
6870

@@ -90,7 +92,8 @@ one instance should be the **Master Pod** at a time.
9092
value).
9193

9294
1. The first instance that take the `MasterPodLock` will be the **Master Pod** and will start publishing messages.
93-
* `MasterPodLock` is a simple redis key. If lock taken, the value of the key is setted as pod name which is getting from Environment value. If Environment doesn't have pod name, GUID is used.
95+
* `MasterPodLock` is a simple redis key. If lock taken, the value of the key is setted as pod name which is getting
96+
from Environment value. If Environment doesn't have pod name, GUID is used.
9497
3. The rest of the instances will be **Follower Pods** and will try to take the `MasterPodLock` every certain amount of
9598
time.
9699
4. Also, the **Master Pod** will try to extend the `MasterPodLock` every certain amount of time.
@@ -108,15 +111,21 @@ value).
108111
The application can be configured using the `config.json` and `secret.json` files. Here are the configurations you can
109112
set:
110113

114+
## Important Notes
115+
116+
> [!WARNING]
117+
> The default values for `Kafka.SaslMechanism` and `Kafka.SecurityProtocol` have been removed in version 1.3.0. Please
118+
> ensure to set these values in your configuration to avoid any issues.
119+
111120
| **Key** | **Type** | **Description** |
112121
|----------------------------------------------|----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------|
113122
| `Kafka.SaslUsername` | string | The username for the SASL authentication of the Kafka cluster. |
114123
| `Kafka.Brokers` | string | The addresses of the Kafka brokers. |
115124
| `Kafka.SaslPassword` | string | The password for the SASL authentication of the Kafka cluster. |
116125
| `Kafka.SslCaLocation` | string | The location of the SSL certificate for the Kafka cluster. |
117126
| `Kafka.SslKeystorePassword` | string | The SSL Keystore Password |
118-
| `Kafka.SaslMechanism` | string | The SSL Mechanism. **Default: ScramSha512** |
119-
| `Kafka.SecurityProtocol` | string | The SSL Protocol. **Default: SaslSsl** |
127+
| `Kafka.SaslMechanism` | string | The SSL Mechanism. |
128+
| `Kafka.SecurityProtocol` | string | The SSL Protocol. |
120129
| `Kafka.BatchSize` | string | The Batch Size of the Kafka Publisher. **Default: 512 * 1024** |
121130
| `Kafka.LingerMs` | string | The Linger of the Kafka Publisher. **Default: 10** |
122131
| `Kafka.CompressionType` | string | The Compression Type of the Kafka Publisher. **Default: Snappy** |
@@ -143,7 +152,7 @@ set:
143152
| `DataStoreSettings.ExceededEvents` | string | The name of the exceeded event data store. |
144153
| `DataStoreSettings.OutboxOffset` | string | The name of the outbox offset data store. Holds the last published `OutboxEvents` Id |
145154
| `MasterPodSettings.IsActive` | bool | A flag indicating whether the master pod checker is active. Should be active if multiple pods is using. |
146-
| `MasterPodSettings.CacheName` | string | The name of the distributed lock key. This key should be same for the multiple instances of the app. |
155+
| `MasterPodSettings.CacheName` | string | The name of the distributed lock key. This key should be same for the multiple instances of the app. |
147156
| `MasterPodSettings.MasterPodLifetime` | int | The lifetime of the master pod. The TTL of the distributed lock. |
148157
| `MasterPodSettings.MasterPodRaceInterval` | int | The interval to take `MasterPodLock` for **MasterPod** and **FollowerPods**. |
149158
| `MasterPodSettings.IsMasterPodCheckInterval` | int | The check interval for the `FollowerPods`. The check without intervals causes high CPU usage; because of that, this is needed. |
@@ -154,15 +163,20 @@ set:
154163
| `Serilog` | object | The configuration for Serilog. |
155164

156165
## EXAMPLE
157-
In the [examples](https://github.com/Trendyol/PollingOutboxPublisher/tree/master/examples) folder, you'll find example files for `config.json`, `secret.json`, and implementation on how to insert messages for each database type
166+
167+
In the [examples](https://github.com/Trendyol/PollingOutboxPublisher/tree/master/examples) folder, you'll find example
168+
files for `config.json`, `secret.json`, and implementation on how to insert messages for each database type
158169

159170
> [!WARNING]
160-
> For the Couchbase, incremental ID is used for the `OutboxEvents` data store. If you want to use the Couchbase, you should use a Counter for the ID. You can find the example code in the `CouchbaseExample` class.
171+
> For the Couchbase, incremental ID is used for the `OutboxEvents` data store. If you want to use the Couchbase, you
172+
> should use a Counter for the ID. You can find the example code in the `CouchbaseExample` class.
161173
162174
## LICENSE
175+
163176
Released under the [MIT License](https://github.com/Trendyol/PollingOutboxPublisher/blob/master/LICENSE).
164177

165178
## CONTRIBUTING
179+
166180
See the [CONTRIBUTING](./CONTRIBUTING.md) file for details.
167181

168182
## CONTRIBUTORS

example/Couchbase/config/config.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@
2222
"SaslUsername": "",
2323
"Brokers": "",
2424
"SslCaLocation": "",
25-
"ClientId": ""
25+
"ClientId": "",
26+
"SaslMechanism": "",
27+
"SecurityProtocol": ""
2628
},
2729
"BenchMarkOptions": {
2830
"IsPublishingOn": true

example/MsSql/config/config.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@
2222
"SaslUsername": "",
2323
"Brokers": "",
2424
"SslCaLocation": "",
25-
"ClientId": ""
25+
"ClientId": "",
26+
"SaslMechanism": "",
27+
"SecurityProtocol": ""
2628
},
2729
"BenchMarkOptions": {
2830
"IsPublishingOn": true

example/Postgres/config/config.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@
2222
"SaslUsername": "",
2323
"Brokers": "",
2424
"SslCaLocation": "",
25-
"ClientId": ""
25+
"ClientId": "",
26+
"SaslMechanism": "",
27+
"SecurityProtocol": ""
2628
},
2729
"BenchMarkOptions": {
2830
"IsPublishingOn": true

src/Coordinators/Services/KafkaProducer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ private void BuildProducer(Kafka kafka)
3030
SaslPassword = kafka.SaslPassword,
3131
SslCaLocation = kafka.SslCaLocation,
3232
SslKeystorePassword = kafka.SslKeystorePassword,
33-
SaslMechanism = kafka.SaslMechanism ?? SaslMechanism.ScramSha512,
34-
SecurityProtocol = kafka.SecurityProtocol ?? SecurityProtocol.SaslSsl,
33+
SaslMechanism = kafka.SaslMechanism,
34+
SecurityProtocol = kafka.SecurityProtocol,
3535
BatchSize = kafka.BatchSize ?? 512 * 1024, // 30000000
3636
LingerMs = kafka.LingerMs ?? 10,
3737
CompressionType = kafka.CompressionType ?? CompressionType.Snappy,

src/PollingOutboxPublisher.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<OutputType>Exe</OutputType>
55
<TargetFramework>net8.0</TargetFramework>
66
<IsPackable>false</IsPackable>
7-
<Version>1.2.0</Version>
7+
<Version>1.3.0</Version>
88
<RootNamespace>PollingOutboxPublisher</RootNamespace>
99
</PropertyGroup>
1010

0 commit comments

Comments
 (0)