JMS is a collection of interfaces that define
the specifications of messaging clients to use when there are communicating
with messaging systems. It is much similar to the way JDBC abstract relational
database access.
JMS API supports three major types of messaging systems. Those
are General messaging applications, Point-to-Point applications and
Publish-Subscribe applications. In order to build a general messaging
application, there are few components/interfaces that the application should adhere
to its implementation,
- ConnectionFactory
- Destination
- Connection
- Session
- Message
- MessageProducer
- MessageConsumer
According to JMS specifications, both ConnectionFactory and
Destination should be obtained through JNDI. Other objects can create with JMS
vendor implementations. The sequence is like as follows, once we have a
ConnectionFactory, we can create a Connection. With a Connection, we can create
a Session. Once we have a Session, we can create a Message, MessageProducer or
a MessageConsumer.
Overview of a general JMS application. |
Here below I have attached a github link to a demo
application that demonstrates the above connectivity.
GitHub repo: https://github.com/rootpox/JBoss-A-MQ-MessagingQueue
Image reference: Mark Richards, 2009. Java Message Service.
Second Edition Edition. O'Reilly Media.
Wonderful! Nice write up brother!
ReplyDeleteKeep writing further more!
Thanks for the interesting information regarding JMS!
Thanks for appreciating :)
Delete