ArticleslgStudy

computer science

Jakarta Messaging

Jakarta Messaging is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Jakarta Messaging rather than just read about it. In short: The Jakarta Messaging (formerly Java Message Service or JMS) is a Java application programming interface (API) for message-oriented middleware. It provides generic messaging models, able to handle the producer–consumer problem, that can be used to facilitate the sending and receiving of messages between software systems.

Key takeaways

  • Jakarta Messaging belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Jakarta Messaging to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Jakarta Messaging from memory before moving on to harder problems.

Reference excerpt

The Jakarta Messaging (formerly Java Message Service or JMS) is a Java application programming interface (API) for message-oriented middleware. It provides generic messaging models, able to handle the producer–consumer problem, that can be used to facilitate the sending and receiving of messages between software systems. Jakarta Messaging is a part of Jakarta EE and was originally defined by a specification developed at Sun Microsystems before being guided by the Java Community Process.

General idea of messaging

Messaging is a form of loosely coupled distributed communication, where in this context the term 'communication' can be understood as an exchange of messages between software components. Message-oriented technologies attempt to relax tightly coupled communication (such as TCP network sockets, CORBA or RMI) by the introduction of an intermediary component. This approach allows software components to communicate with each other indirectly. Benefits of this include message senders not needing to have precise knowledge of their receivers. The advantages of messaging include the ability to integrate heterogeneous platforms, reduce system bottlenecks, increase scalability, and respond more quickly to change.

Version history JMS 1.0 JMS 1.0.1 (October 5, 1998) JMS 1.0.1a (October 30, 1998) JMS 1.0.2 (December 17, 1999) JMS 1.0.2a (December 23, 1999) JMS 1.0.2b (August 27, 2001) JMS 1.1 (April 12, 2002) JMS 2.0 (May 21, 2013). It was maintained under the Java Community Process as JSR 343. JMS 2.0a (March 16, 2015) Jakarta Messaging 2.0.2 is the first release under Eclipse Foundation and Jakarta EE Jakarta Messaging 3.0.0 is a part of Jakarta EE 9 Jakarta Messaging 3.1.0 is a part of Jakarta EE 10

Elements The following are JMS elements:

JMS provider An implementation of the JMS interface for message-oriented middleware (MOM). Providers are implemented as either a Java JMS implementation or an adapter to a non-Java MOM. JMS client An application or process that produces and/or receives messages. JMS producer/publisher A JMS client that creates and sends messages. JMS consumer/subscriber A JMS client that receives messages. JMS message An object that contains the data being transferred between JMS clients. JMS queue A staging area that contains messages that have been sent and are waiting to be read (by only one consumer). As the name queue suggests, the messages are delivered in the order sent. A JMS queue guarantees that each message is processed only once. JMS topic A distribution mechanism for publishing messages that are delivered to multiple subscribers.

Models The JMS API supports two distinct models:

Point-to-point Publish-and-subscribe

Point-to-point model Under the point-to-point messaging system, messages are routed to individual consumers who maintain queues of incoming messages. This messaging type is built on the concept of message queues, senders, and receivers. Each message is addressed to a specific queue, and the receiving clients extract messages from the queues established to hold their messages. While any number of producers can send messages to the queue, each message is guaranteed to be delivered, and consumed by one consumer. Queues retain all messages sent to them until the messages are consumed or until the messages expire. If no consumers are registered to consume the messages, the queue holds them until a consumer registers to consume them.

Publish-and-subscribe model The publish-and-subscribe model supports publishing messages to a particular message "topic". Subscribers may register interest in receiving messages published on a particular message topic. In this model, neither the publisher nor the subscriber knows about each other. A good analogy for this is an anonymous bulletin board.

Zero or more consumers will receive the message. There is a timing dependency between publishers and subscribers. The publisher has to create a message topic for clients to subscribe. The subscriber has to remain continuously active to receive messages, unless it has established a durable subscription. In that case, messages published while the subscriber is not connected will be redistributed whenever it reconnects. JMS provides a way of separating the application from the transport layer of providing data. The same Java classes can be used to communicate with different JMS providers by using the Java Naming and Directory Interface (JNDI) information for the desired provider. The classes first use a connection factory to connect to the queue or topic, and then use populate and send or publish the messages. On the receiving side, the clients then receive or subscribe to the messages.

URI scheme RFC 6167 defines a jms: URI scheme for the Java Message Service.

Provider implementations To use JMS, one must have a JMS provider that can manage the sessions, queues and topics. Starting from Java EE version 1.4, a JMS provider has to be contained in all Java EE application servers. This can be implemented using the message inflow management of the Java EE Connector Architecture, which was first made available in that version. The following is a list of common JMS providers:

Amazon SQS's Java Messaging Library Apache ActiveMQ Classic Apache ActiveMQ Artemis Apache Qpid, using AMQP IBM MQ (formerly MQSeries, then WebSphere MQ) IBM WebSphere Application Server's Service Integration Bus (SIBus) JBoss Messaging and HornetQ from JBoss JORAM from the OW2 Consortium Open Message Queue from Eclipse Foundation OpenJMS from the OpenJMS Group Oracle WebLogic Server and Oracle AQ PubSub+ from Solace RabbitMQ from Pivotal Software TIBCO Enterprise Message Service

See also Message Driven Beans Message queue — the concept underlying JMS Service-oriented architecture Event-driven SOA Messaging technologies that do not implement the JMS API include: Advanced Message Queuing Protocol (AMQP) — standardized message queue protocol with multiple independent implementations Data Distribution Service (DDS) — An Object Management Group (OMG) standardized real-time messaging system with over ten implementations that have demonstrated interoperability between publishers and subscribers Microsoft Message Queuing — similar technology, implemented for .NET Framework

References

Further reading Richards, Mark; Richard Monson-Haefel; David A. Chappell (2009). Java Message Service, Second Edition. O'Reilly. ISBN 978-0-596-52204-9.

External links

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Jakarta Messaging

Start with the simplest possible case. Write down what Jakarta Messaging claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Jakarta Messaging before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Jakarta Messaging ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Jakarta Messaging

In research
Jakarta Messaging appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Jakarta Messaging in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Jakarta Messaging is common in secondary-school and first-year university syllabi. It links to neighbouring topics Java enterprise platform, Java specification requests, Message-oriented middleware, so understanding it makes those chapters shorter.
In everyday life
Look for Jakarta Messaging outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Jakarta Messaging” →

How to study Jakarta Messaging in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Jakarta Messaging means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Jakarta Messaging out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Jakarta Messaging in simple terms?

The Jakarta Messaging (formerly Java Message Service or JMS) is a Java application programming interface (API) for message-oriented middleware. It provides generic messaging models, able to handle the producer–consumer problem, that can be used to facilitate the sending and receiving of messages be…

Why does Jakarta Messaging matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Jakarta Messaging?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Jakarta Messaging.

Tags

  • Java enterprise platform
  • Java specification requests
  • Message-oriented middleware
  • Software architecture

Keep exploring