July 2018
Intermediate to advanced
336 pages
9h 23m
English
The Email Formatter consumer is responsible for listening for messages coming from the Apache Kafka topic and doing the actual formatting and sending of emails. Consider the following code:
@SpringBootApplicationpublic class SpringBootEmailFormatter { private static final Logger LOGGER = LoggerFactory.getLogger(SpringBootEmailFormatterConsumerApplication.class); @Autowired private EmailSenderService emailSenderService; @KafkaListener(id="resetPasswordRequests", topics = "resetPasswordRequests") public String listen(String in) { try { ResetPasswordRequest resetPasswordRequest = objectMapper().readValue(in, ResetPasswordRequest.class); emailSenderService.sendResetPasswordEmail(resetPasswordRequest) ...
Read now
Unlock full access