@lucaapp/service-utils 1.2.1 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -114,12 +114,17 @@ class KafkaClient {
114
114
  this.logger.debug(`Topic=${topic} already exists. Not creating.`);
115
115
  return;
116
116
  }
117
- await this.admin.createTopics({ topics: [{ topic }] });
118
- if (this.environment !== serviceIdentity_1.Environment.LOCAL) {
119
- await this.admin.createPartitions({
120
- topicPartitions: [{ topic, count: 2 }],
121
- });
122
- }
117
+ const numPartitions = this.environment == serviceIdentity_1.Environment.LOCAL ? 1 : 3;
118
+ const replicationFactor = this.environment == serviceIdentity_1.Environment.LOCAL ? 1 : 3;
119
+ await this.admin.createTopics({
120
+ topics: [
121
+ {
122
+ topic,
123
+ numPartitions,
124
+ replicationFactor,
125
+ },
126
+ ],
127
+ });
123
128
  this.logger.debug(`Topic=${topic} created.`);
124
129
  };
125
130
  this.consume = async (groupId, kafkaTopic, handler, fromBeginning = false) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lucaapp/service-utils",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [