Mais conteúdo relacionado Semelhante a Ajs 4 b (20) Ajs 4 b1. Messaging and Internationalization
Pre-assessment Questions
1. Which statement defines the asymmetric cryptography?
a) Uses the same key for both encryption and decryption of data
b) Uses different keys for encryption and decryption of data
c) Uses an encrypted text to authenticate the sender of a message or
a document
d) Uses a signed statement, which contains information about an
entity and its public key
2. Which package stores the classes and interfaces related to JCE API to
implement encryption and generate keys and MAC algorithms?
a) java.security
b) java.util
c) javax.security
d) javax.crypto
©NIIT Architecting J2EE Solutions Lesson 4B / Slide 1 of 42
2. Messaging and Internationalization
Pre-assessment Questions
3. Which class provides the functionality for encrypting and decrypting
data using a key agreement protocol?
a) CipherInputStream
b) Cipher
c) KeyAgreement
d) FileInputStream
4. Select the class that you can use to generate symmetric keys to perform
symmetric encryptions.
a) KeyGenerator
b) Mac
c) KeyAgreement
d) Cipher
©NIIT Architecting J2EE Solutions Lesson 4B / Slide 2 of 42
3. Messaging and Internationalization
Pre-assessment Questions
5. Which mode initializes a Cipher object to begin encryption of data?
a) ENCRYPT_MODE
b) DECRYPT_MODE
c) WRAP_MODE
d) UNWRAP_MODE
©NIIT Architecting J2EE Solutions Lesson 4B / Slide 3 of 42
4. Messaging and Internationalization
Solutions to Pre-assessment Questions:
1. b) Uses different keys for encryption and decryption of data
2. d) javax.crypto
3. c) KeyAgreement
4. a) KeyGenerator
5. a) ENCRYPT_MODE
©NIIT Architecting J2EE Solutions Lesson 4B / Slide 4 of 42
5. Messaging and Internationalization
Objectives
In this lesson you will learn to:
• Identify the need and architecture of messaging
• Identify the types, models, and components of JMS
• Develop effective messaging solution
• Implement JMS
• Internationalize J2EE applications
©NIIT Architecting J2EE Solutions Lesson 4B / Slide 5 of 42
6. Messaging and Internationalization
Messaging Using JMS
• Message-oriented Middleware (MOM) provides an infrastructure enabling
application to send and receive messages in an enterprise environment.
• Java Message Service (JMS) is an API from Sun Microsystems that interacts
with Message Oriented Middleware (MOM) services, enabling developers to
send and receive messages quickly and efficiently.
• Introduction to Messaging
• Messaging is a mode of communication among two or more applications
without the human association.
• The applications may be running on different hardware devices or different
operating system.
• Need for Messaging
• In an e-business scenario, messaging allows communication between
application components.
• Messaging facilitates integrating disparate systems and automates
business.
©NIIT Architecting J2EE Solutions Lesson 4B / Slide 6 of 42
7. Messaging and Internationalization
Messaging Using JMS (Contd.)
• Need for Messaging (Contd.)
• Integrating Disparate Systems
• An enterprise consists of many applications that run on different
systems and different operating systems.
• Messaging enables the applications to communicate with each other.
• As a result, system integration is achieved without changing the
underlying applications.
• Business Automation
• Messaging enables an enterprise to automate their business functions
and transactions to enhance efficiency and productivity.
• The messaging technology handles the entire automation process,
such as checking inventory levels, checking business rules, and
placing the order.
©NIIT Architecting J2EE Solutions Lesson 4B / Slide 7 of 42
8. Messaging and Internationalization
Messaging Using JMS (Contd.)
• Messaging Architecture
• Two architectures are implemented based on the suitability to the needs of
an enterprise. The two architectures are:
• Hub-and-Spoke Architecture: Uses a central message server that
handles all communication among the application clients.
• Bus Architecture: Provides each application client the functionality of
a message server.
• The advantages of hub-and-spoke architecture are:
• Reduced Number of Network Connections
• Flexible Deployment of Clients
• Application Clients With Minimum Software Components
• The message bus is the network layer of the IP multicast protocol. The
multicast network layer performs routing of the messages among the
application clients.
©NIIT Architecting J2EE Solutions Lesson 4B / Slide 8 of 42
9. Messaging and Internationalization
Messaging Using JMS (Contd.)
• Types of Messaging
• Synchronous Messaging: The sender of the message needs
acknowledgement from the receiver for the message being processed
before the sender switches to another message.
• Asynchronous Messaging: The sender can send multiple messages and can
continue with its further processing without waiting for a response from
the receiver.
• Messaging Models
• Point-to-Point: Enables you to create one-to-one messaging application. It
enables a single client to communicate with another messaging client
using a message queue.
• Publish/Subscribe: Enables you to create one-to-many messaging
application. Publish/Subscribe model enables a messaging client to send
messages to the various messaging clients using the message topic.
©NIIT Architecting J2EE Solutions Lesson 4B / Slide 9 of 42
10. Messaging and Internationalization
Messaging Using JMS (Contd.)
• Messaging Servers
• A messaging server is a middleware system that facilitates messaging
between enterprise applications.
• Messaging server sits between a messaging client and receiver to
receive message from clients, route message to a receiver, and perform
other functions, such as ensuring reliable messaging and provide
acknowledgement.
• Consideration for Selecting a Messaging Server
• Internet-based Design
• Guaranteed Messaging
• Security Management
• Restrictive Control Flow Support
• Interoperability
• Support for Dynamic Environments
©NIIT Architecting J2EE Solutions Lesson 4B / Slide 10 of 42
11. Messaging and Internationalization
Messaging Using JMS (Contd.)
• Types of Messaging Servers
• IBM WebSphere MQ: Enables you to exchange information across different
platforms and to integrate existing business applications in the process.
WebSphere MQ uses Secure Sockets Layer (SSL) to provide secure
communication.
• SonicMQ: Allows integration of existing Internet applications and wireless
devices, which depend on HTTP. Sonic Continuous Availability Architecture
(CAA) provides immediate fail over through real-time replication between
active and standby brokers.
• SwiftMQ: Provides a message store that reconstructs persistent data
reliably after a crash. SwiftMQ supports distributed transactions and
provide a Java Connector Architecture (JCA) resource adapter for standard
J2EE integration.
©NIIT Architecting J2EE Solutions Lesson 4B / Slide 11 of 42
12. Messaging and Internationalization
Messaging Using JMS (Contd.)
• Messaging with JMS
• Java Messaging Service (JMS) is an API in the J2EE platform that
supports enterprise messaging systems.
• JMS enables messaging between two applications that are known as
JMS clients.
• Key JMS Features are:
• Flexible Programming Model
• Resilience
• Flexible Event-based Mechanisms
• Transaction Support
• Subject-based Routing
©NIIT Architecting J2EE Solutions Lesson 4B / Slide 12 of 42
13. Messaging and Internationalization
Messaging Using JMS (Contd.)
• Components of a JMS Application are:
• Administered Objects: Are JMS objects that are created and maintained
by the administrator of JMS application server for the use of JMS clients.
• Administered objects are of two types:
• Connection factories
• Destinations
• Connection: Is an object of the Connection interface that establishes a
logical connection between the JMS client and the JMS provider.
• The optimization techniques for creating and using connections are:
• Start the Connection when appropriate
• Process messages concurrently
• Close the Connection when finished
©NIIT Architecting J2EE Solutions Lesson 4B / Slide 13 of 42
14. Messaging and Internationalization
Messaging Using JMS (Contd.)
• Components of a JMS Application are (Contd.):
• Sessions
• Interaction that takes place between a JMS client and JMS provider
during a particular task is encapsulated in a session.
• A session is responsible for sending and receiving messages and
handling message acknowledgements.
• The optimization techniques that you need to consider when you create
a session object are:
• Choose proper acknowledgement mode
• Control Transaction
• Close the Session when finished
©NIIT Architecting J2EE Solutions Lesson 4B / Slide 14 of 42
15. Messaging and Internationalization
Messaging Using JMS (Contd.)
• Components of a JMS Application are (Contd.):
• Message Producers
• A message producer is an object of the MessageProducer interface
that is created by a session object to send messages to a
destination object.
• Message Consumers
• A message consumer is an object of the MessageConsumer
interface that is created by a session object to receive messages
from a destination object.
• The optimization techniques for producer and consumers are:
• Choose non-durable messages where appropriate.
• Set TimeToLive value properly.
• Receive messages asynchronously.
• Close Producer and Consumer when finished.
©NIIT Architecting J2EE Solutions Lesson 4B / Slide 15 of 42
16. Messaging and Internationalization
Messaging Using JMS (Contd.)
• Components of a JMS Application are (Contd.):
• Messages
• Messages are the components of a JMS application, which is
transferred between destinations of a JMS application.
• The various components of a JMS application along with their association:
©NIIT Architecting J2EE Solutions Lesson 4B / Slide 16 of 42
17. Messaging and Internationalization
Messaging Using JMS (Contd.)
• Components of JMS Message
• A message is a data, event, or software component that is sent from
one messaging client to another messaging client.
• The JMS Message interface enables you to create messages, which
matches the basic format of the JMS message to the format used by
non-JMS application.
• A JMS message contains the following three parts:
• Message Header: Contains data, such as destination, delivery
mode, message id, timestamp, priority, and such data enables JMS
client and JMS provider to identify and route messages.
• Message Properties: Provides additional information such as
compatibility with other messaging systems that you can set for a
message apart from the header fields.
• Message Body: Contains the content of a message.
©NIIT Architecting J2EE Solutions Lesson 4B / Slide 17 of 42
18. Messaging and Internationalization
Messaging Using JMS (Contd.)
• The following are the different types of message types supported by JMS API:
• StreamMessage: Uses stream to represent the content of the body. The
stream contains sequence of primitive types supported by java that are
entered and read in a sequential manner.
• MapMessage: Represents the content of the body in key-value or name-
value pair. The content can be read either sequential or by providing
name/key. The name/key is a String object and value is any primitive
data type supported by java.
• BytesMessage: Represents the content of the body in a stream of
interpreted bytes. It is used to access the existing legacy messaging
system to use the existing message format.
• TextMessage: Represents the content of body as Strings. It is used
when XML data needs to be exchanged.
• ObjectMessage: Represents the content of body as a single serializable
object or as a collection of objects.
©NIIT Architecting J2EE Solutions Lesson 4B / Slide 18 of 42
19. Messaging and Internationalization
Messaging Using JMS (Contd.)
• Developing Effective messaging Solutions
• You need to analyze, issues such as, JMS model that will suite the need
of the application, selection of J2EE component to process messages,
and type of JMS client to send messages.
• Incorporate messaging into J2EE processes
• You can use the combination of session beans with a JMS resource
connection to incorporate messaging into a J2EE process.
• You can use existing session beans to access one or more topics
and queues and to handle requests for business services.
• Access multiple topics and queues from one component
• A business process requires conditional access to message
destinations then you cannot use Message Driven Beans (MDBs).
• The simple JMS client is suitable for applets, Swing applications,
and stand-alone console applications.
©NIIT Architecting J2EE Solutions Lesson 4B / Slide 19 of 42
20. Messaging and Internationalization
Messaging Using JMS (Contd.)
• Developing Effective messaging Solutions (Contd.)
• Access session and entity beans asynchronously
• MDBs are used to consume asynchronous messages and access
enterprise functionality.
• The client establishes a synchronous RMI connection with the
application server on receiving a message, and invokes the session
or entity beans.
• Build the thinnest possible JMS client
• You can build a thin JMS client using the simple JMS client.
• You can choose the simple JMS client if you want to provide a
lightweight messaging compared to have the scalability and
robustness of a J2EE client such as a session bean.
• Concurrently send and receive messages
• Message-driven beans enable you to concurrently send and receive
messages.
©NIIT Architecting J2EE Solutions Lesson 4B / Slide 20 of 42
21. Messaging and Internationalization
Messaging Using JMS (Contd.)
• Developing Effective messaging Solutions (Contd.)
• Identifying Appropriate JMS Clients
• The various JMS clients are: simple JMS client, combination of
session beans and JMS, and message-driven beans.
• You can select the appropriate JMS client depending on the
requirement of an application.
• Various JMS Clients are:
• Simple JMS client
• You can add enterprise messaging capabilities to a Java applet,
command-line application, Swing application, or Java WebStart
client to make them JMS-capable application.
• A new application that utilizes JMS can be deployed with a little
client-side configuration.
• The simple JMS client has disadvantage in case of security,
transaction handling, and scalability.
©NIIT Architecting J2EE Solutions Lesson 4B / Slide 21 of 42
22. Messaging and Internationalization
Messaging Using JMS (Contd.)
• Various JMS Clients are (Contd.):
• Session beans and JMS
• You can use a session bean as the JMS client to enable JMS
communication in a larger business transaction.
• The steps to enable EJB to obtain a connection to a JMS session
are:
• Get a connection-factory reference using JNDI lookup.
• Get a connection using the factory reference.
• Use the topic or queue connection object for JMS.
• Message-driven beans
• Provide a reusable J2EE messaging component that can leverage
existing investments in J2EE application servers, and EJB
technology specifically.
• send and receive messages asynchronously using a messaging
server.
©NIIT Architecting J2EE Solutions Lesson 4B / Slide 22 of 42
23. Messaging and Internationalization
Implementing JMS
• Implementing Synchronous Messaging
• Synchronous messaging is implemented using PTP model.
• This model can be used in the following situation:
• Instant messaging
• Supply-chain processing
• Transaction oriented task
©NIIT Architecting J2EE Solutions Lesson 4B / Slide 23 of 42
24. Messaging and Internationalization
Implementing JMS (Contd.)
• Implementing Synchronous Messaging (Contd.)
• Following are the steps and interfaces required to implement
synchronous messaging:
1. Obtain the QueueConnectionFactory object by performing a JNDI
lookup.
2. Obtain the QueueConnection object corresponding to a JMS
provider using the object of QueueConnectionFactory.
3. Obtain the QueueSession object corresponding to a JMS provider
using the object of QueueConnection.
4. Obtain the queue by performing JNDI lookup
5. Create an object of either QueueSender or QueueReceiver using
the QueueSession object for the required queue.
6. Send or receive the message.
7. Close QueueConnection, which correspondingly closes the
QueueSender or QueueReceiver and the QueueSession.
©NIIT Architecting J2EE Solutions Lesson 4B / Slide 24 of 42
25. Messaging and Internationalization
Implementing JMS (Contd.)
• Implementing Asynchronous Messaging
• Asynchronous messaging is implemented using Pub/Sub Model.
• This model enables application to publish messages on a one-to-one or
a many-to-many basis.
• This model can be used in the following situation:
• Sending messages to all the employees within an organization.
• Sending information to specific user group based on interest
• Sending information, the response for which is not time critical
©NIIT Architecting J2EE Solutions Lesson 4B / Slide 25 of 42
26. Messaging and Internationalization
Implementing JMS (Contd.)
• Implementing Asynchronous Messaging
• Following are the steps and interfaces required to implement
asynchronous messaging:
1. Obtain the TopicConnectionFactory object by performing a JNDI
lookup.
2. Obtain the TopicConnection object corresponding to a JMS
provider using the object of TopicConnectionFactory.
3. Obtain the TopicSession object corresponding to a JMS provider
using the object of TopicConnection.
4. Obtain the topic by performing a JNDI lookup
5. Create an object of either TopicPublisher or TopicSubscriber
using the TopicSession object for the required topic.
6. Publish or subscribe the message.
7. Close TopicConnection, which correspondingly closes
TopicPublisher or TopicSubscriber and the TopicSession.
©NIIT Architecting J2EE Solutions Lesson 4B / Slide 26 of 42
27. Messaging and Internationalization
Implementing Synchronous
Messaging Using JMS
• Problem Statement
• Create a synchronous messaging applications using JMS API that
consists of sender and receiver. The sender application sends
the messages directly to the receiver application through a
message topic.
• Solution
• To create the above messaging application using JMS API, you
need to perform the following tasks:
1. Create the JMS clients.
2. Create JMS administered object.
3. Deploy the application using the J2EE Deploytool.
4. Run the JMS application.
©NIIT Architecting J2EE Solutions Lesson 4B / Slide 27 of 42
28. Messaging and Internationalization
Internationalization of J2EE
Applications
• Internationalization enables an application to be adapted to a new language
where as localization enables an internationalized application to be adapted
to a specific country or region.
• The Need of Internationalization: As Internet has become the backbone
for most of the companies whether they are small, medium, or large in
terms of turn over, enabling them to expand their business across
countries.
• When going global, the information system needs to address issues
such as:
• Language differences
• Cultural difference
• Geographical and political differences
©NIIT Architecting J2EE Solutions Lesson 4B / Slide 28 of 42
29. Messaging and Internationalization
Internationalization of J2EE
Applications (Contd.)
• The process of designing application that is portable to every language
without re-engineering is internationalization.
• The related terminology to internationalization are:
• Localization
• Is a way of identifying and using the exact language and cultural
settings for a specific session of a user.
• A set of political, cultural, and region-specific environment being
represented in an application is defined as a locale.
• A locale consists of two basic elements: language code and country
code and an optional variant element.
• The variant element is a browser-specific and vendor-specific code
to determine platform differences.
©NIIT Architecting J2EE Solutions Lesson 4B / Slide 29 of 42
30. Messaging and Internationalization
Internationalization of J2EE
Applications (Contd.)
• The related terminology to internationalization are (Contd.):
• Date and Number Formatting
• Every enterprise application stores, compares, and perform
arithmetic operations on date and numbers.
• To represent date, time, and number according to locale, dates,
and time formatters are available.
• Character Sets
• Is a set of textual and graphical symbols that maps to a set of non-
negative integers, called code points.
• Unicode represents code points in 21 bits and includes alphabetic
scripts, ideographic writing systems, and phonetic.
©NIIT Architecting J2EE Solutions Lesson 4B / Slide 30 of 42
31. Messaging and Internationalization
Internationalization of J2EE
Applications (Contd.)
• The related terminology to internationalization are (Contd.):
• Encoding
• Is the technique of mapping the set of code points of a character
set to the units of a specific width.
• Defines rules for representing and serializing a character set.
• Examples of encoding are UTF-8 and UTF-16.
• Stream Input/Output
• The java.io package provides classes to read and write data form
streams using various encoding schemes.
• The classes used to read data from a stream include
BufferedReader and InputStreamReader and classes to write data
to a stream include BufferedWriter, PrintWriter, and
OutputStreamWriter.
©NIIT Architecting J2EE Solutions Lesson 4B / Slide 31 of 42
32. Messaging and Internationalization
Internationalization of J2EE
Applications (Contd.)
• J2EE provides the following classes for internationalization:
• java.util.Locale class
• java.util.ResourceBundle class
• java.text.NumberFormat class
• java.text.DecimalFormat class
• java.text.DateFormat class
• java.text.SimpleDateFormat class
• java.text.MessageFormat class
• java.text.Collator class
• java.text.BreakIterator class
©NIIT Architecting J2EE Solutions Lesson 4B / Slide 32 of 42
33. Messaging and Internationalization
Internationalization of J2EE
Applications (Contd.)
• The java.util.Locale Class
• In Java 2 platform, a Locale object encapsulates the cultural,
geographical, political, and regional information specific to a particular
session or user.
• The elements used to identify a locale are:
• Language: This is the basic identifier of a locale and contains a
two-letter language code. For example, en for English and es for
Spanish.
• Regional Variation: This represents and contains a two-letter
country code. For example, US for United States of America, CO for
Colombia.
• Variant: This is an optional element and is used to create a locale-
specific to a particular browser or vendor. Variant enables you to
create more than one locale for a country and language
combination.
©NIIT Architecting J2EE Solutions Lesson 4B / Slide 33 of 42
34. Messaging and Internationalization
Internationalization of J2EE
Applications (Contd.)
• The java.util.ResourceBundle Class
• Java 2 platform applications store locale-specific information, such as
presentation of user interface elements including menu list, color of the
interface, look and feel of the design of the interface, help text in a
resource bundle.
• The java.util.ResourceBundle class defines naming convention for
the locales, which are used while organizing resources according to a
specific locale.
• The java.text.NumberFormat class
• The NumberFormat class is an abstract class that enables you to format
and parse numbers according to a specific-locale.
• The format() and parse() methods are used for formatting and
parsing.
• The INTEGER_FIELD and FRACTION_FIELD constants in the
NumberFormat class are used to identify fields within decimal numbers.
©NIIT Architecting J2EE Solutions Lesson 4B / Slide 34 of 42
35. Messaging and Internationalization
Internationalization of J2EE
Applications (Contd.)
• The java.text.DecimalFormat Class
• The DecimalFormat class extends the NumberFormat class to support
formatting and presentation of numbers and currencies with decimal
accuracy.
• A number of get and set methods are provided to get access to specific
formatting parameters.
• The java.text.DateFormat Class
• DateFormat is an abstract class that provides locale-specific APIs to
parse, format, and normalize date and time values.
• To determine the length of the formatted output, the class provides four
constants: FULL, LONG, MEDIUM, and SHORT constants. To display date
and time according to a specific locale, an object of DateFormat needs
to be created using the getInstance(), getDateInstance(),
getTimeInstance(), or getDateTimeInstance() methods.
©NIIT Architecting J2EE Solutions Lesson 4B / Slide 35 of 42
36. Messaging and Internationalization
Internationalization of J2EE
Applications (Contd.)
• The java.text.SimpleDateFormat Class
• The SimpleDateFormat class extends the DateFormat class and
supports default implementation of date formatting and parsing
capabilities.
• The constructor of SimpleDateFormat takes a pattern as an argument
to create a format pattern specific object.
• The java.text.MessageFormat Class
• The MessageFormat class extends the Message class and enables you to
create concatenated messages.
• The MessageFormat constructor takes a String object as an argument
that specifies a message-formatting pattern.
• The format() method formats the specified argument using a
MessageFormat created with the specified pattern.
• The parse() method is used to parse the object contained in the
pattern string.
©NIIT Architecting J2EE Solutions Lesson 4B / Slide 36 of 42
37. Messaging and Internationalization
Internationalization of J2EE
Applications (Contd.)
• The java.text.Collator Class
• Collation is a process of sorting text strings presented in different
languages.
• The java.text.Collator is an abstract class that supports sorting or
ordering of text data using language-specific or script-specific rules and
is locale-specific.
• The getInstance() method can be used to get an instance of Collator
class specific to a locale.
• The java.text.BreakIterator Class
• The BreakIterator class supports the identification of breaks by
character, word, sentence, or line in text and is locale-specific.
• It provides static methods for parsing sequence of character by word,
line, or sentence.
©NIIT Architecting J2EE Solutions Lesson 4B / Slide 37 of 42
38. Messaging and Internationalization
Implementing Internationalization
• Problem Statement
• Create an application that displays the current time and date in
American language. Along with American language, you want to
display the current time and date in German and French.
• Solution
• To solve the preceding problem, perform the following tasks:
1. Write the Java code.
2. Create the .properties file.
3. Compile the Java code.
4. Run the program.
©NIIT Architecting J2EE Solutions Lesson 4B / Slide 38 of 42
39. Messaging and Internationalization
Implementing Asynchronous
Messaging Using JMS
• Problem Statement
• Create an asynchronous messaging applications using JMS API
that consists of sender and receiver. The sender application
sends the messages directly to the receiver application through
a message topic.
• Solution
• To create the above messaging application using JMS API, you
need to perform the following tasks:
1. Create the JMS clients.
2. Create JMS administered object.
3. Deploy the application using the Deploytool.
4. Run the JMS application.
©NIIT Architecting J2EE Solutions Lesson 4B / Slide 39 of 42
40. Messaging and Internationalization
Summary
• In this lesson, you learned:
• JMS is a Java API that enables you to create a messaging application
that can send or receive the messages over different platforms.
• Two messaging architectures, Hub-and-Spoke Architecture and Bus
Architecture.
• JMS API provides two types of messaging model:
• Publish/Subscribe: Enables you to create one-to-many messaging
application. Publish/Subscribe model enables a messaging client to
send messages to the various messaging clients using the message
topic.
• Point-to-Point: Enables you to create one-to-one messaging
application. It enables a single client to communicate with another
messaging client using a message queue.
• Messaging server is a middleware system that facilitates messaging
between the enterprise applications. Examples of some messaging
servers are IBM WebSphere MQ, SonicMQ, and SwiftMQ.
©NIIT Architecting J2EE Solutions Lesson 4B / Slide 40 of 42
41. Messaging and Internationalization
Summary(Contd.)
• A JMS application consists of the following parts:
• JMS provider: Provides the administrative and control features for
the messaging application.
• JMS client: Represents the Java program that can send or receive
the messages.
• Administered objects: Represents the pre-configured JMS objects
that enable the messaging clients to send or receive the messages.
• Connection factory is an object that is used to create connection between the
JMS client and the JMS provider. The ConnectionFactory class encapsulates
the various parameters that are necessary for connection configuration.
• Destination is an object that is used to specify the target of a message and
the source of a message.
• Connection object is used to create the virtual connection between the JMS
provider and JMS clients.
©NIIT Architecting J2EE Solutions Lesson 4B / Slide 41 of 42
42. Messaging and Internationalization
Summary(Contd.)
• Session is a single-threaded object that provides the context for
producing or consuming the message.
• The message producer created by the session is used to send the
message to the message destination.
• The message consumer created by the session is used to receive the
message from the message source.
• Message listener is an object that provides an asynchronous event
handler for the messages.
• Message selector is an object that enables the message consumer to
specify if the message is consumed or not.
• JMS message contains message header, message properties, and
message body.
• Internationalization enables an application to be adapted to a new
language and region.
©NIIT Architecting J2EE Solutions Lesson 4B / Slide 42 of 42