@514labs/moose-lib 0.6.338 → 0.6.339
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/moose-runner.js +6 -36
- package/dist/moose-runner.js.map +1 -1
- package/dist/moose-runner.mjs +6 -36
- package/dist/moose-runner.mjs.map +1 -1
- package/package.json +1 -1
package/dist/moose-runner.js
CHANGED
|
@@ -2535,7 +2535,6 @@ init_commons();
|
|
|
2535
2535
|
init_cluster_utils();
|
|
2536
2536
|
init_internal();
|
|
2537
2537
|
init_json();
|
|
2538
|
-
init_compiler_config();
|
|
2539
2538
|
var { Kafka: Kafka2 } = import_kafka_javascript2.KafkaJS;
|
|
2540
2539
|
var HOSTNAME = process3.env.HOSTNAME;
|
|
2541
2540
|
var AUTO_COMMIT_INTERVAL_MS = 5e3;
|
|
@@ -2808,26 +2807,6 @@ var sendMessageMetrics = (logger2, metrics) => {
|
|
|
2808
2807
|
metrics.count_out = 0;
|
|
2809
2808
|
setTimeout(() => sendMessageMetrics(logger2, metrics), 1e3);
|
|
2810
2809
|
};
|
|
2811
|
-
async function loadStreamingFunctionPrecompiled(functionFilePath) {
|
|
2812
|
-
let streamingFunctionImport;
|
|
2813
|
-
try {
|
|
2814
|
-
const useCompiled2 = shouldUseCompiled();
|
|
2815
|
-
const sourceDir = getSourceDir();
|
|
2816
|
-
let actualPath = functionFilePath;
|
|
2817
|
-
if (useCompiled2) {
|
|
2818
|
-
const sourceDirPattern = `/${sourceDir}/`;
|
|
2819
|
-
actualPath = functionFilePath.replace(sourceDirPattern, `/.moose/compiled/${sourceDir}/`).replace(/\.ts$/, ".js");
|
|
2820
|
-
streamingFunctionImport = await loadModule(actualPath);
|
|
2821
|
-
} else {
|
|
2822
|
-
const pathWithoutExt = actualPath.replace(/\.(ts|js)$/, "");
|
|
2823
|
-
streamingFunctionImport = require(pathWithoutExt);
|
|
2824
|
-
}
|
|
2825
|
-
} catch (e) {
|
|
2826
|
-
cliLog({ action: "Function", message: `${e}`, message_type: "Error" });
|
|
2827
|
-
throw e;
|
|
2828
|
-
}
|
|
2829
|
-
return streamingFunctionImport.default;
|
|
2830
|
-
}
|
|
2831
2810
|
async function loadStreamingFunction(sourceTopic, targetTopic) {
|
|
2832
2811
|
const transformFunctions = await getStreamingFunctions();
|
|
2833
2812
|
const transformFunctionKey = `${topicNameToStreamName(sourceTopic)}_${targetTopic ? topicNameToStreamName(targetTopic) : "<no-target>"}`;
|
|
@@ -2871,21 +2850,12 @@ var startConsumer = async (args, logger2, metrics, _parallelism, consumer, produ
|
|
|
2871
2850
|
logger2.log(
|
|
2872
2851
|
`Starting consumer group '${streamingFuncId}' with source topic: ${args.sourceTopic.name} and target topic: ${args.targetTopic?.name || "none"}`
|
|
2873
2852
|
);
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
);
|
|
2881
|
-
streamingFunctions = result.functions;
|
|
2882
|
-
fieldMutations = result.fieldMutations;
|
|
2883
|
-
} else {
|
|
2884
|
-
streamingFunctions = [
|
|
2885
|
-
[await loadStreamingFunctionPrecompiled(args.functionFilePath), {}]
|
|
2886
|
-
];
|
|
2887
|
-
fieldMutations = void 0;
|
|
2888
|
-
}
|
|
2853
|
+
const result = await loadStreamingFunction(
|
|
2854
|
+
args.sourceTopic,
|
|
2855
|
+
args.targetTopic
|
|
2856
|
+
);
|
|
2857
|
+
const streamingFunctions = result.functions;
|
|
2858
|
+
const fieldMutations = result.fieldMutations;
|
|
2889
2859
|
await consumer.subscribe({
|
|
2890
2860
|
topics: [args.sourceTopic.name]
|
|
2891
2861
|
// Use full topic name for Kafka operations
|