Subham Krishna software developer.
16/01/2026
▶️ Stuck issue ------------/ways to make your pc/laptop faster:-
Press start button and search Commant Prompt and run as administrator =>sfc /scannow after that 100% type : DISM /Online /Cleanup-Image /RestoreHealth Press start button and search Commant Prompt and run as administrator >> DISM /Online /Cleanup-Image /ScanHealth Press start button and search Commant Prompt and run as administrator >> chkdsk Go to search >> %temp% => delete all temp files win + R =>prefetch => delete everything Go to search >>Type disk cleanup => clean Go to search >>Type services >> Windows Update >> disable win + R =>sysdm.cpl =>> advanced => settings => click adjust for best performance
31/12/2025
8. After that make a package named as service(you can keep it anything but most preferably you should write the name as service as it is providing service of sending mail) and then make a class in it(here it's NotificationService) and write the following code to enable consumer to consume the request and act accordingly here sending mail) like this :
package com.techie.microservices.notification.service;
import com.techie.microservices.order.event.OrderPlacedEvent;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.mail.MailException;
import org.springframework.mail.javamail.JavaMailSender;
import org.springframework.mail.javamail.MimeMessageHelper;
import org.springframework.mail.javamail.MimeMessagePreparator;
import org.springframework.stereotype.Service;
public class NotificationService {
private final JavaMailSender javaMailSender;
(topics = "order-placed")
public void listen(OrderPlacedEvent orderPlacedEvent){
log.info("Got Message from order-placed topic {}",orderPlacedEvent);
// Send email to the customer
MimeMessagePreparator messagePreparator = mimeMessage -> {
MimeMessageHelper messageHelper = new MimeMessageHelper(mimeMessage);
messageHelper.setFrom("[email protected]");
messageHelper.setTo(orderPlacedEvent.getEmail());
messageHelper.setSubject(String.format("Your Order with OrderNumber %s is placed successfully",orderPlacedEvent.getOrderNumber()));
messageHelper.setText(String.format("""
Hi
Any msg in the body(here i'm providing message as Your order with order number %s is now placed successfully)
Best Regards
Spring Shop
""",
Any Dynamic msg you want to print in as %s variable Name(here it's orderPlacedEvent.getOrderNumber()));
};
try{
javaMailSender.send(messagePreparator);
log.info("Order Notification email sent!!");
}catch(MailException e){
log.error("Exception occurred when sending mailed");
throw new RuntimeException("Exception occured when sending mail to [email protected]",e);
}
}
}
Click here to claim your Sponsored Listing.
Category
Website
Address
Patna