mirror of
https://github.com/elicpeter/nyx.git
synced 2026-06-09 19:45:13 +02:00
refactor(dynamic): add broker loopback stubs for Kafka, SQS, Pub/Sub, RabbitMQ, and NATS, enhance stub initialization and event recording logic across supported languages, and expand test coverage
This commit is contained in:
parent
170d2028d0
commit
c57cd233fc
8 changed files with 346 additions and 2 deletions
|
|
@ -3502,6 +3502,7 @@ fn emit_message_handler_harness(
|
|||
}}
|
||||
}});
|
||||
System.out.println({publish_marker:?} + " " + {queue:?});
|
||||
nyxRecordBrokerPublish("NYX_SQS_LOG", {queue:?}, payload);
|
||||
brokerRef.publish({queue:?}, payload);"#,
|
||||
handler = handler,
|
||||
queue = queue,
|
||||
|
|
@ -3533,6 +3534,7 @@ fn emit_message_handler_harness(
|
|||
}}
|
||||
}});
|
||||
System.out.println({publish_marker:?} + " " + {queue:?});
|
||||
nyxRecordBrokerPublish("NYX_RABBIT_LOG", {queue:?}, payload);
|
||||
chan.basicPublish("", {queue:?}, payload);"#,
|
||||
handler = handler,
|
||||
queue = queue,
|
||||
|
|
@ -3555,6 +3557,7 @@ fn emit_message_handler_harness(
|
|||
}}
|
||||
}});
|
||||
System.out.println({publish_marker:?} + " " + {queue:?});
|
||||
nyxRecordBrokerPublish("NYX_KAFKA_LOG", {queue:?}, payload);
|
||||
brokerRef.publish({queue:?}, payload);"#,
|
||||
handler = handler,
|
||||
queue = queue,
|
||||
|
|
@ -3599,6 +3602,21 @@ public class NyxHarness {{
|
|||
}}
|
||||
return "";
|
||||
}}
|
||||
|
||||
static void nyxRecordBrokerPublish(String envName, String destination, String payload) {{
|
||||
String path = System.getenv(envName);
|
||||
if (path == null || path.isEmpty()) return;
|
||||
String line = destination.replace('\t', ' ') + "\t" + payload + "\n";
|
||||
try {{
|
||||
java.nio.file.Files.write(
|
||||
java.nio.file.Paths.get(path),
|
||||
line.getBytes(java.nio.charset.StandardCharsets.UTF_8),
|
||||
java.nio.file.StandardOpenOption.CREATE,
|
||||
java.nio.file.StandardOpenOption.APPEND
|
||||
);
|
||||
}} catch (Exception ignored) {{
|
||||
}}
|
||||
}}
|
||||
}}
|
||||
"#,
|
||||
entry_class = entry_class,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue