@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/index.mjs
CHANGED
|
@@ -26,6 +26,7 @@ __export(commons_exports, {
|
|
|
26
26
|
antiCachePath: () => antiCachePath,
|
|
27
27
|
cliLog: () => cliLog,
|
|
28
28
|
compilerLog: () => compilerLog,
|
|
29
|
+
createProducerConfig: () => createProducerConfig,
|
|
29
30
|
getClickhouseClient: () => getClickhouseClient,
|
|
30
31
|
getFileName: () => getFileName,
|
|
31
32
|
getKafkaClient: () => getKafkaClient,
|
|
@@ -51,18 +52,25 @@ function isTruthy(value) {
|
|
|
51
52
|
function mapTstoJs(filePath) {
|
|
52
53
|
return filePath.replace(/\.ts$/, ".js").replace(/\.cts$/, ".cjs").replace(/\.mts$/, ".mjs");
|
|
53
54
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
const producer = kafka.producer({
|
|
55
|
+
function createProducerConfig(maxMessageBytes) {
|
|
56
|
+
return {
|
|
57
57
|
kafkaJS: {
|
|
58
|
-
idempotent:
|
|
58
|
+
idempotent: false,
|
|
59
|
+
// Not needed for at-least-once delivery
|
|
59
60
|
acks: ACKs,
|
|
60
61
|
retry: {
|
|
61
62
|
retries: MAX_RETRIES_PRODUCER,
|
|
62
63
|
maxRetryTime: MAX_RETRY_TIME_MS
|
|
63
64
|
}
|
|
64
|
-
}
|
|
65
|
-
|
|
65
|
+
},
|
|
66
|
+
"linger.ms": 0,
|
|
67
|
+
// Send immediately - batching happens at application level
|
|
68
|
+
...maxMessageBytes && { "message.max.bytes": maxMessageBytes }
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
async function getKafkaProducer(cfg, logger, maxMessageBytes) {
|
|
72
|
+
const kafka = await getKafkaClient(cfg, logger);
|
|
73
|
+
const producer = kafka.producer(createProducerConfig(maxMessageBytes));
|
|
66
74
|
await producer.connect();
|
|
67
75
|
return producer;
|
|
68
76
|
}
|
|
@@ -2514,19 +2522,7 @@ var WebApp = class {
|
|
|
2514
2522
|
return app.callback();
|
|
2515
2523
|
}
|
|
2516
2524
|
if (typeof app.routing === "function") {
|
|
2517
|
-
|
|
2518
|
-
let readyPromise = null;
|
|
2519
|
-
if (typeof app.ready === "function") {
|
|
2520
|
-
readyPromise = app.ready().then(() => {
|
|
2521
|
-
isReady = true;
|
|
2522
|
-
});
|
|
2523
|
-
} else {
|
|
2524
|
-
isReady = true;
|
|
2525
|
-
}
|
|
2526
|
-
return async (req, res) => {
|
|
2527
|
-
if (!isReady && readyPromise) {
|
|
2528
|
-
await readyPromise;
|
|
2529
|
-
}
|
|
2525
|
+
return (req, res) => {
|
|
2530
2526
|
app.routing(req, res);
|
|
2531
2527
|
};
|
|
2532
2528
|
}
|
|
@@ -3309,6 +3305,7 @@ export {
|
|
|
3309
3305
|
createClickhouseParameter,
|
|
3310
3306
|
createConsumptionApi,
|
|
3311
3307
|
createMaterializedView,
|
|
3308
|
+
createProducerConfig,
|
|
3312
3309
|
dropView,
|
|
3313
3310
|
expressMiddleware,
|
|
3314
3311
|
getApi,
|