SMTP With JMS Technology

General Tech Technology & Software 2 years ago

0 2 0 0 0 tuteeHUB earn credit +10 pts

5 Star Rating 1 Rating

Posted on 16 Aug 2022, this text provides information on Technology & Software related to General Tech. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.

Take Quiz To Earn Credits!

Turn Your Knowledge into Earnings.

tuteehub_quiz

Answers (2)

Post Answer
profilepic.png
manpreet Tuteehub forum best answer Best Answer 2 years ago


I know the concept of Message Driven Beans within the EJB/Spring Framework. I know how to send e-mails using the Java Mail API and I know the JMS Architecture in terms of the 2 protocols:

  • publish and subscribe (Topic)
  • point to point (Queue)

I have to use JMS as the technology to process e-mails. Java Spring provides Message Driven Beans support and JMS support. My question is how can I configure JMS Queues for an SMTP Server? I cannot find anything online about this, but people have done it.

So what I would like to do is, the message queue would listen for e-mails coming in and when an e-mail comes in then it does some processing. I know I have to use Message Driven Beans but the question is how can I configure JMS with the connection to an SMTP Server.

Any help would be appreciated. It would be great if you could include some examples. I have tried looking on Google but nothing shows up.

profilepic.png
manpreet 2 years ago


You can't really setup JMS Queues to be directly used by an SMTP server. What you can do is

  1. Setup a JMS Queue in your server
  2. Create a JMS Producer, which when invoked, should receive the email data (subject, body, to , cc etc) and post it to the Queue setup in step 1
  3. Create a JMS Consumer, which subscribes to the Queue created in Step 1, and its onMessage should call the JavaMail API to send the email.

Why do all these? So that the JavaMail call is asynchronous.


0 views   0 shares

No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.