@Autowired
ConfigurableApplicationContext context;
- @Autowired
- Consumer<Integer, CreateChatRoomRequestTo> chatRoomChannelConsumer;
@Autowired
ChatMessageChannel chatMessageChannel;
@Autowired
Consumer<String, ChatMessageTo> chatMessageChannelConsumer;
- CompletableFuture<Void> chatRoomChannelConsumerJob;
CompletableFuture<Void> chatMessageChannelConsumerJob;
});
}
- @PreDestroy
- public void joinChatRoomChannelConsumerJob()
- {
- log.info("Signaling the consumer of the CahtRoomChannel to quit its work");
- chatRoomChannelConsumer.wakeup();
- log.info("Waiting for the consumer of the ChatRoomChannel to finish its work");
- chatRoomChannelConsumerJob.join();
- log.info("Joined the consumer of the ChatRoomChannel");
- }
-
@PreDestroy
public void joinChatMessageChannelConsumerJob()
{