Chapter 7, Integrating JavaMail and JMS with Spring

Q1. What is a JavaMail API?

A JavaMail API provides a protocol and platform independent framework to provide e-mail support for a Java application. The JavaMail API is a collection of classes and interfaces that comprise an e-mail system. These steps are involved in sending a simple email, using the JavaMail API. They are as follows:

  1. Connect to a e-mail server by specifying the username and password, let's say an example; if you want to send an email from [email protected], then you need to connect to the e-mail server of xyz.com.
  2. Create a message by specifying the recipient's addresses that can include Cc and Bcc addresses as well.
  3. Add attachments to the message if any.
  4. Transport the message to the e-mail server.

Q2. What is message and messaging?

Message is nothing but bytes of data or information, which are being exchanged between two parties. By taking different specifications; a message can be described in various ways. However, it is nothing but an entity of communication. A message can be used to transfer a piece of information from one application to another application, which may or may not run in the same platform.

Messaging is communication between different applications (in a distributed environment), or system components which are loosely coupled unlike its peers, like TCP sockets, Remote Method Invocation (RMI) or CORBA, which is tightly coupled. The advantage of Java messaging includes the ability to integrate different platforms, increase the scalability and reliability of message delivery and reduces the system bottlenecks. Using messaging, we can increase the systems and clients who are consuming and producing the message as much as we want.

Q3. What is JMS?

The JMS, that is, Java Message Service is a Java Message Oriented Middleware (MOM) API for sending messages between two or more clients. JMS is a part of Java Enterprise edition. JMS is a broker like a postman, who acts like a mediator between the message sender and receiver.

JMS is a specification that describes a common way for Java programs to create, send, and read distributed enterprise messages. It advocates the loosely coupled communication without caring about sender and receiver. It provides asynchronous messaging, that means it doesn't matter whether the sender and the receiver are present at the same time or not. The two systems that are sending or receiving messages need not be up at same time.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.226.24