@514labs/moose-lib 0.6.252-ci-3-g37e54b29 → 0.6.252-ci-3-gf88b2b20
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/dist/{browserCompatible-DnYA4Zgi.d.mts → browserCompatible-BTN82akc.d.mts} +1 -1
- package/dist/{browserCompatible-B_aEflr_.d.ts → browserCompatible-CoxWbneN.d.ts} +1 -1
- package/dist/browserCompatible.d.mts +2 -2
- package/dist/browserCompatible.d.ts +2 -2
- package/dist/browserCompatible.js +15 -19
- package/dist/browserCompatible.js.map +1 -1
- package/dist/browserCompatible.mjs +15 -19
- package/dist/browserCompatible.mjs.map +1 -1
- package/dist/compilerPlugin.js.map +1 -1
- package/dist/compilerPlugin.mjs.map +1 -1
- package/dist/dmv2/index.d.mts +1 -1
- package/dist/dmv2/index.d.ts +1 -1
- package/dist/dmv2/index.js +15 -19
- package/dist/dmv2/index.js.map +1 -1
- package/dist/dmv2/index.mjs +15 -19
- package/dist/dmv2/index.mjs.map +1 -1
- package/dist/{index-rECDLgTX.d.mts → index-CNlTyF6R.d.mts} +0 -1
- package/dist/{index-rECDLgTX.d.ts → index-CNlTyF6R.d.ts} +0 -1
- package/dist/index.d.mts +28 -5
- package/dist/index.d.ts +28 -5
- package/dist/index.js +17 -19
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +16 -19
- package/dist/index.mjs.map +1 -1
- package/dist/moose-runner.js +100 -202
- package/dist/moose-runner.js.map +1 -1
- package/dist/moose-runner.mjs +100 -202
- package/dist/moose-runner.mjs.map +1 -1
- package/package.json +1 -1
package/dist/dmv2/index.mjs
CHANGED
|
@@ -20,6 +20,7 @@ __export(commons_exports, {
|
|
|
20
20
|
antiCachePath: () => antiCachePath,
|
|
21
21
|
cliLog: () => cliLog,
|
|
22
22
|
compilerLog: () => compilerLog,
|
|
23
|
+
createProducerConfig: () => createProducerConfig,
|
|
23
24
|
getClickhouseClient: () => getClickhouseClient,
|
|
24
25
|
getFileName: () => getFileName,
|
|
25
26
|
getKafkaClient: () => getKafkaClient,
|
|
@@ -45,18 +46,25 @@ function isTruthy(value) {
|
|
|
45
46
|
function mapTstoJs(filePath) {
|
|
46
47
|
return filePath.replace(/\.ts$/, ".js").replace(/\.cts$/, ".cjs").replace(/\.mts$/, ".mjs");
|
|
47
48
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
const producer = kafka.producer({
|
|
49
|
+
function createProducerConfig(maxMessageBytes) {
|
|
50
|
+
return {
|
|
51
51
|
kafkaJS: {
|
|
52
|
-
idempotent:
|
|
52
|
+
idempotent: false,
|
|
53
|
+
// Not needed for at-least-once delivery
|
|
53
54
|
acks: ACKs,
|
|
54
55
|
retry: {
|
|
55
56
|
retries: MAX_RETRIES_PRODUCER,
|
|
56
57
|
maxRetryTime: MAX_RETRY_TIME_MS
|
|
57
58
|
}
|
|
58
|
-
}
|
|
59
|
-
|
|
59
|
+
},
|
|
60
|
+
"linger.ms": 0,
|
|
61
|
+
// Send immediately - batching happens at application level
|
|
62
|
+
...maxMessageBytes && { "message.max.bytes": maxMessageBytes }
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
async function getKafkaProducer(cfg, logger, maxMessageBytes) {
|
|
66
|
+
const kafka = await getKafkaClient(cfg, logger);
|
|
67
|
+
const producer = kafka.producer(createProducerConfig(maxMessageBytes));
|
|
60
68
|
await producer.connect();
|
|
61
69
|
return producer;
|
|
62
70
|
}
|
|
@@ -2396,19 +2404,7 @@ var WebApp = class {
|
|
|
2396
2404
|
return app.callback();
|
|
2397
2405
|
}
|
|
2398
2406
|
if (typeof app.routing === "function") {
|
|
2399
|
-
|
|
2400
|
-
let readyPromise = null;
|
|
2401
|
-
if (typeof app.ready === "function") {
|
|
2402
|
-
readyPromise = app.ready().then(() => {
|
|
2403
|
-
isReady = true;
|
|
2404
|
-
});
|
|
2405
|
-
} else {
|
|
2406
|
-
isReady = true;
|
|
2407
|
-
}
|
|
2408
|
-
return async (req, res) => {
|
|
2409
|
-
if (!isReady && readyPromise) {
|
|
2410
|
-
await readyPromise;
|
|
2411
|
-
}
|
|
2407
|
+
return (req, res) => {
|
|
2412
2408
|
app.routing(req, res);
|
|
2413
2409
|
};
|
|
2414
2410
|
}
|