Java message service(JMS) introduction : Communication between two or more applications is done in form of messages. The Message contains two parts business data (business transaction) plus routing information. Messages are sent by Message oriented middle ware. Message oriented middle (MOM) ware is responsible for fault tolerance, load balancing, scalability and reliability. Virtual channels called â€œdestination â€œare used to exchange messages. Applications subscribe the destination and receive messages. Different MOM is similar in basic semantics .These similarity makes JMS API possible to work with many different MOMs.
Enterprise messaging: - Asynchronous messaging: The sender to have to wait until the message is received by the recipient. - Synchronous messaging: The sender continue to send without care about if the old messages handled or not.
Enterprise messaging architecture - Centralized architecture: Depends on a center server to perform routing. Each client canâ€™t see the other clients. It only sees the server which is responsible to deliver its message successfully. Clients are removed easily. Minimum number of communications.
- Decentralized architecture: Use IP multicast groups, each client join a group. IP network address is used to distribute the messages to all the members in the group. There is not center server.
- Hybrid architecture: Implement both centralized and decentralized architecture. Note: TCP/IP, HTTP, SSL is used.
Java message service : Java message service (JMS) API created by sun micro systems provides you with the ability to create system with application to application messaging. In our world people communicate using messages .They use phones, chat messaging, mails and other communications technologies. The same to the application, we can make application send messages to each other. In JMS we are talking about the enterprise applications.JMS is not a messaging system it is just an abstract and interfaces to different MOM implementations needed by messaging client. It is just like JDBC for databases and JNDI for naming and directory services.
JMS messaging models:
1- Publish-and-Subscribe (PUB/SUB): one to many communication. Producer send massage to many consumer due a channel called â€œTopicâ€. Any client want to listen it must subscribe this topic first. 2- Point to point (P2P): JMS clients send and receive messages via channels called â€œQueueâ€ .Messaging can be synchronously or asynchronously. Messages are request from the queue instead of sending it immediately to the receiver. Queue may have many receivers but only one receiver can consume each message
1- Enterprise application integration (EAI): communication between new implemented applications that is cannot be interoperated. 2- Business to business: exchanging business data.