Java Reference
In-Depth Information
As we can see, developing messaging applications using the JMS 2.0 API is very
simple, and it is made even simpler by employing NetBeans features such as code
generation and wizards.
In our example, we discussed only one message type, namely javax.jms.
TextMessage . In the following table, we briefly describe all JMS message types:
Subinterface
Description
BytesMessage
This is used to send an array of bytes as a message.
MapMessage
This is used to send name-value pairs as messages. The
names must be string objects and the values must be either
primitive types or Java objects.
ObjectMessage
This is used to send serializable objects as messages. A
serializable object is an instance of any class that implements
java.io.Serializable .
StreamMessage
This is used to send a stream of Java primitive types as a
message.
TextMessage
This is used to send a string as a message.
Summary
In this chapter, we covered an introduction to JMS and messaging systems in
general. We talked about the two JMS messaging domains, namely the PTP
messaging domain, in which a single listener processes a message, and the pub/sub
messaging domain, in which all subscribed message listeners process the message.
Then, we covered how to create JMS resources such as message queues quickly
and easily by taking advantage of the NetBeans JMS Resource wizard.
We also covered how to send JMS messages using JMS 2.0 included in Java EE 7,
and we saw how NetBeans can generate most of the JMS boilerplate code.
Then, we turned our attention to developing code to receive and process JMS
messages, specifically how to develop message-driven beans via the NetBeans
Message-Driven Bean wizard.
Search WWH ::




Custom Search