@basaltkit/queue-kafka 1.0.0 → 1.0.1

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.
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2026 Machize Contributors
3
+ Copyright (c) 2026 Basalt Contributors
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/dist/index.js CHANGED
@@ -4,6 +4,7 @@ var HEADER = {
4
4
  attempt: "x-basalt-attempt",
5
5
  attempts: "x-basalt-attempts"
6
6
  };
7
+ var MAX_ATTEMPTS = 50;
7
8
  var defaultClient = async (options) => {
8
9
  const specifier = "kafkajs";
9
10
  const mod = await import(specifier);
@@ -79,7 +80,7 @@ var KafkaQueueDriver = class {
79
80
  await this.executor?.(jobName, JSON.parse(value));
80
81
  } catch {
81
82
  const attempt = Number(headers[HEADER.attempt] ?? 1);
82
- const attempts = Number(headers[HEADER.attempts] ?? 1);
83
+ const attempts = Math.min(Number(headers[HEADER.attempts] ?? 1) || 1, MAX_ATTEMPTS);
83
84
  const producer = await this.producer();
84
85
  if (attempt < attempts) {
85
86
  await producer.send({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@basaltkit/queue-kafka",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Kafka driver for @basaltkit/queue: produce/consume jobs with retry and dead-letter topics (no delayed delivery or priority — Kafka has neither).",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -14,7 +14,7 @@
14
14
  "dist"
15
15
  ],
16
16
  "dependencies": {
17
- "@basaltkit/queue": "^1.0.0"
17
+ "@basaltkit/queue": "^1.1.0"
18
18
  },
19
19
  "peerDependencies": {
20
20
  "kafkajs": "^2.0.0"