@BeforeAll
- public static void sendAndLoadStoredData(
- @Autowired
- KafkaTemplate<String, String> messageTemplate,
- @Autowired
- KafkaServicesApplicationRunner applicationRunner)
- throws Exception
+ public static void sendAndLoadStoredData(@Autowired KafkaTemplate<String, String> messageTemplate)
{
send(messageTemplate, "5c73531c-6fc4-426c-adcb-afc5c140a0f7","{ \"id\": \"5c73531c-6fc4-426c-adcb-afc5c140a0f7\", \"shard\": 2, \"name\": \"FOO\" }", "command_create_chatroom");
send(messageTemplate,"5c73531c-6fc4-426c-adcb-afc5c140a0f7","{ \"id\" : 1, \"user\" : \"peter\", \"text\" : \"Hallo, ich heiße Peter!\" }", "event_chatmessage_received");
send(messageTemplate,"5c73531c-6fc4-426c-adcb-afc5c140a0f7","{ \"id\" : 1, \"user\" : \"ute\", \"text\" : \"Ich bin Ute...\" }", "event_chatmessage_received");
send(messageTemplate,"5c73531c-6fc4-426c-adcb-afc5c140a0f7","{ \"id\" : 2, \"user\" : \"peter\", \"text\" : \"Willst du mit mir gehen?\" }", "event_chatmessage_received");
send(messageTemplate,"5c73531c-6fc4-426c-adcb-afc5c140a0f7","{ \"id\" : 1, \"user\" : \"klaus\", \"text\" : \"Ja? Nein? Vielleicht??\" }", "event_chatmessage_received");
-
- applicationRunner.run(new DefaultApplicationArguments());
}
static void send(KafkaTemplate<String, String> kafkaTemplate, String key, String value, String typeId)
}
@AfterAll
- static void joinConsumerJob(
- @Autowired
- KafkaServicesApplicationRunner applicationRunner)
+ static void joinConsumerJob(@Autowired KafkaServicesApplicationRunner applicationRunner)
{
applicationRunner.joinChatRoomChannelConsumerJob();
}