s-project.dnos-lib-all.1.1.5.source-code.SampleApp Maven / Gradle / Ivy
The newest version!
public class SampleApp {
public static void main(String args[]) {
// PacketProcessor packetProcessor = new PacketProcessor();
// ExecutorService executorService = Executors.newSingleThreadExecutor();
// String appName = "PacketConsumerApp";
// String EventType = "PACKET";
// JsonBuilder jsonBuilder = new JsonBuilder();
// EventConsumerService monitor = new EventConsumerService();
// BufferedReader PacketsBufferReader = monitor.kafkaRegister(appName);
// JSONObject registerReponse = jsonBuilder.createJsonObject(PacketsBufferReader);
// monitor.kafkaSubscribe(EventType, appName, registerReponse);
// PacketEventMonitor packetInEventMonitor = new PacketEventMonitor(registerReponse, EventType);
// class PacketInEventListener extends EventListener {
// @Override
// public void onEvent(ConsumerRecord record) {
// PacketContextProto packetContextProto = null;
// try {
// packetContextProto = PacketContextProto.parseFrom(record.value().get());
// } catch (InvalidProtocolBufferException e) {
// e.printStackTrace();
// }
// PacketContextProto finalPacketContextProto = packetContextProto;
// executorService.execute(() -> {
// packetProcessor.process(finalPacketContextProto);
// });
// }
// }
// PacketInEventListener packetInEventListener = new PacketInEventListener();
// packetInEventMonitor.addEventListener(packetInEventListener);
// Thread t = new Thread(packetInEventMonitor);
// t.start();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy