→ Javamessaging service is used for the cross platform communication. JMS can keep track of every message that is being transferred between two Applications.
→ An enterprise messaging system enables applications to communicate with one another through the exchange of messages.
→ A message is a request, report, and/or event that contains information needed to coordinate communication between different applications.
→ A message provides a level of abstraction, allowing you to separate the details about the destination system from the application code.
The Java Message Service (JMS) is a standard API for accessing enterprise messaging systems. Specifically, JMS:
1. Enables Java applications sharing a messaging system to exchange messages
2. Simplifies application development by providing a standard interface for creating, sending, and receiving messages
The following figure illustrates Weblogic JMS messaging.
Weblogic JMS Messaging:
→ In case of any Message failure, JMS has the capacity of reprocessing those messages.
→ JMS has different stores to save the messages that is being transferred.
→ JMS uses different communication channels to reprocess the messages.
SCENARIOS WHERE WE USE JMS:
1. For cross platform communication
2. To keep track of every message.
3. To reprocess the messages.
4. For Applicationtracking.(like Login examples).
→ JMS use persistent stores to store the messages. We have 2 different stores available.
1. File store.
2. JDBC store.
→ It is just a folder in Unix mount, which is used by Weblogic to store the messages.
→ In some architectures these messages will be stored in the database using JDBC, which is called as JDBC STORE.
→ JMS is used for 2 different communication modes.
1. One to One communication
2. One to Many communication
ONE TO ONE COMMUNICATION:
→ Whencommunication need to be done in one single user, we can call it as O-O or PTP communication. (POINT TO POINT).
→ The point-to-point (PTP) messaging model enables one application to send a message to another. PTP messaging applications send and receive messages using named queues.
→ A queue sender(producer) sends a message to a specific queue. A queue receiver (consumer) receives messages from a specific queue.
The following figure illustrates PTP messaging.
Point-to-Point (PTP) Messaging:
ONE TO MANY COMMUNICATION:
→ whencommunication need to be send a group of users when it call as one to many or PTS communication. (PUBLISHERS TO SUBSCRIBERS).
→ The publish/subscribe messaging model enables an application to send a message to multiple applications. pub/sub messaging applications send and receive messages by subscribing to a topic.
→ A topic publisher(producer) sends message to a specific topic. A topic subscriber(consumer) retrieves message from a specific topic.
→ The following figure illustrates publisher/subscriber messaging.
Publish/Subscribe (Pub/Sub) Messaging:
→ JMS has 2 different communication channels.
→ QUEUEis mostly used for PTP communication, which is having the capacity of reprocessing the messages.
→ TOPICis mostly used for PTS or one to many communication.
→ Out of above two communication channels QUEUE is most reliable communication channel.
STEPS TO CREATE JMS SERVERS:
1. create persistent stores (either it may be file based or JDBC) [at UNIX server].
2. Goto console----->services---->select persistent store and then select file store or JDBC store.
3. Provide the store name and select the path we have created at Unix server.
4. Target the persistent store to manage server.
5. Select messaging and select JMS servers.
6. Provide the JMS server name and map to the persistent store and then target to the manage server.
STEPS TO CREATE QUEUE OR TOPIC:
1. Goto console-------->services------->messaging----->JMS modules
2. select New and provide the module name.
3. Target the module to the manage server.
4. Open module and select New.
5. Select the QUEUE and provide the QUEUE name and JNDI name.
6. Save the configuration.