SlideShare ist ein Scribd-Unternehmen logo
1 von 42
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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

Weitere ähnliche Inhalte

Was ist angesagt?

Vb net xp_10
Vb net xp_10Vb net xp_10
Vb net xp_10Niit Care
 
Software Architecture: Design Decisions
Software Architecture: Design DecisionsSoftware Architecture: Design Decisions
Software Architecture: Design DecisionsHenry Muccini
 
3 f6 9_distributed_systems
3 f6 9_distributed_systems3 f6 9_distributed_systems
3 f6 9_distributed_systemsop205
 
Context-Oriented Programming
Context-Oriented ProgrammingContext-Oriented Programming
Context-Oriented Programmingkim.mens
 
2 - Architetture Software - Software architecture
2 - Architetture Software - Software architecture2 - Architetture Software - Software architecture
2 - Architetture Software - Software architectureMajong DevJfu
 
Cipt1 implementing cisco unified communications ip telephony part 1
Cipt1   implementing cisco unified communications ip telephony part 1Cipt1   implementing cisco unified communications ip telephony part 1
Cipt1 implementing cisco unified communications ip telephony part 1bestip
 
Chapter 2 slides
Chapter 2 slidesChapter 2 slides
Chapter 2 slideslara_ays
 
3 f6 11_softdevmethodologies
3 f6 11_softdevmethodologies3 f6 11_softdevmethodologies
3 f6 11_softdevmethodologiesop205
 
Cipt2 implementing cisco unified communications ip telephony part 2
Cipt2   implementing cisco unified communications ip telephony part 2Cipt2   implementing cisco unified communications ip telephony part 2
Cipt2 implementing cisco unified communications ip telephony part 2bestip
 
3 f6 8_databases
3 f6 8_databases3 f6 8_databases
3 f6 8_databasesop205
 
Software Patterns
Software PatternsSoftware Patterns
Software Patternskim.mens
 
Survey paper
Survey paperSurvey paper
Survey paperIJASCSE
 
2010 01 lecture SIG UM MFES 2 - Patterns metrics quality
2010 01 lecture SIG UM MFES 2 - Patterns metrics quality2010 01 lecture SIG UM MFES 2 - Patterns metrics quality
2010 01 lecture SIG UM MFES 2 - Patterns metrics qualityjstvssr
 
Pitfalls of software product development
Pitfalls of software product developmentPitfalls of software product development
Pitfalls of software product developmentSofismo AG
 

Was ist angesagt? (20)

Dacj 4 1-a
Dacj 4 1-aDacj 4 1-a
Dacj 4 1-a
 
Vb net xp_10
Vb net xp_10Vb net xp_10
Vb net xp_10
 
Ajs 2 c
Ajs 2 cAjs 2 c
Ajs 2 c
 
Unit 08: Security for Web Applications
Unit 08: Security for Web ApplicationsUnit 08: Security for Web Applications
Unit 08: Security for Web Applications
 
Unit 04: From Requirements to the UX Model
Unit 04: From Requirements to the UX ModelUnit 04: From Requirements to the UX Model
Unit 04: From Requirements to the UX Model
 
Software Architecture: Design Decisions
Software Architecture: Design DecisionsSoftware Architecture: Design Decisions
Software Architecture: Design Decisions
 
3 f6 9_distributed_systems
3 f6 9_distributed_systems3 f6 9_distributed_systems
3 f6 9_distributed_systems
 
Context-Oriented Programming
Context-Oriented ProgrammingContext-Oriented Programming
Context-Oriented Programming
 
05 architectural design
05 architectural design05 architectural design
05 architectural design
 
2 - Architetture Software - Software architecture
2 - Architetture Software - Software architecture2 - Architetture Software - Software architecture
2 - Architetture Software - Software architecture
 
Cipt1 implementing cisco unified communications ip telephony part 1
Cipt1   implementing cisco unified communications ip telephony part 1Cipt1   implementing cisco unified communications ip telephony part 1
Cipt1 implementing cisco unified communications ip telephony part 1
 
Chapter 2 slides
Chapter 2 slidesChapter 2 slides
Chapter 2 slides
 
3 f6 11_softdevmethodologies
3 f6 11_softdevmethodologies3 f6 11_softdevmethodologies
3 f6 11_softdevmethodologies
 
Cipt2 implementing cisco unified communications ip telephony part 2
Cipt2   implementing cisco unified communications ip telephony part 2Cipt2   implementing cisco unified communications ip telephony part 2
Cipt2 implementing cisco unified communications ip telephony part 2
 
Unit03: Process and Business Models
Unit03: Process and Business ModelsUnit03: Process and Business Models
Unit03: Process and Business Models
 
3 f6 8_databases
3 f6 8_databases3 f6 8_databases
3 f6 8_databases
 
Software Patterns
Software PatternsSoftware Patterns
Software Patterns
 
Survey paper
Survey paperSurvey paper
Survey paper
 
2010 01 lecture SIG UM MFES 2 - Patterns metrics quality
2010 01 lecture SIG UM MFES 2 - Patterns metrics quality2010 01 lecture SIG UM MFES 2 - Patterns metrics quality
2010 01 lecture SIG UM MFES 2 - Patterns metrics quality
 
Pitfalls of software product development
Pitfalls of software product developmentPitfalls of software product development
Pitfalls of software product development
 

Ähnlich wie Ajs 4 b

Anti key logging and real-time encrypting software | keystrokes encrypting so...
Anti key logging and real-time encrypting software | keystrokes encrypting so...Anti key logging and real-time encrypting software | keystrokes encrypting so...
Anti key logging and real-time encrypting software | keystrokes encrypting so...Mike Taylor
 
Introduction to vb.net
Introduction to vb.netIntroduction to vb.net
Introduction to vb.netsuraj pandey
 
Microservices Cloud Club 2015-02-26
Microservices Cloud Club 2015-02-26Microservices Cloud Club 2015-02-26
Microservices Cloud Club 2015-02-26Casey Bisson
 
Migrating to Microservices Patterns and Technologies (edition 2023)
 Migrating to Microservices Patterns and Technologies (edition 2023) Migrating to Microservices Patterns and Technologies (edition 2023)
Migrating to Microservices Patterns and Technologies (edition 2023)Ahmed Misbah
 
Multimedia authoring and user interface
Multimedia authoring and user interface Multimedia authoring and user interface
Multimedia authoring and user interface nirmalbj
 
IBM MQ Advanced - IBM InterConnect 2016
IBM MQ Advanced - IBM InterConnect 2016IBM MQ Advanced - IBM InterConnect 2016
IBM MQ Advanced - IBM InterConnect 2016Leif Davidsen
 
Microservices Architecture & Testing Strategies
Microservices Architecture & Testing StrategiesMicroservices Architecture & Testing Strategies
Microservices Architecture & Testing StrategiesAraf Karsh Hamid
 
Transforming to Microservices
Transforming to MicroservicesTransforming to Microservices
Transforming to MicroservicesKyle Brown
 
Introductorytocomputing
IntroductorytocomputingIntroductorytocomputing
IntroductorytocomputingAnne Starr
 
Messaging in the Cloud with IBM MQ Light and IBM Bluemix
Messaging in the Cloud with IBM MQ Light and IBM BluemixMessaging in the Cloud with IBM MQ Light and IBM Bluemix
Messaging in the Cloud with IBM MQ Light and IBM BluemixRobert Nicholson
 
Cloudtechnologyassociatepart 1
Cloudtechnologyassociatepart 1Cloudtechnologyassociatepart 1
Cloudtechnologyassociatepart 1Anne Starr
 
Microservices Architecture - Cloud Native Apps
Microservices Architecture - Cloud Native AppsMicroservices Architecture - Cloud Native Apps
Microservices Architecture - Cloud Native AppsAraf Karsh Hamid
 
MicroserviceArchitecture in detail over Monolith.
MicroserviceArchitecture in detail over Monolith.MicroserviceArchitecture in detail over Monolith.
MicroserviceArchitecture in detail over Monolith.PLovababu
 
Mobile app-and-microservices-with-ibm-cloud
Mobile app-and-microservices-with-ibm-cloudMobile app-and-microservices-with-ibm-cloud
Mobile app-and-microservices-with-ibm-cloudSrinivasan Nanduri
 
Over view of software artitecture
Over view of software artitectureOver view of software artitecture
Over view of software artitectureABDEL RAHMAN KARIM
 
Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Karmanjay Verma
 

Ähnlich wie Ajs 4 b (20)

Jms intro
Jms introJms intro
Jms intro
 
Anti key logging and real-time encrypting software | keystrokes encrypting so...
Anti key logging and real-time encrypting software | keystrokes encrypting so...Anti key logging and real-time encrypting software | keystrokes encrypting so...
Anti key logging and real-time encrypting software | keystrokes encrypting so...
 
Introduction to vb.net
Introduction to vb.netIntroduction to vb.net
Introduction to vb.net
 
Microservices Cloud Club 2015-02-26
Microservices Cloud Club 2015-02-26Microservices Cloud Club 2015-02-26
Microservices Cloud Club 2015-02-26
 
Umashankar Adha
Umashankar AdhaUmashankar Adha
Umashankar Adha
 
J2ME Unit_01
J2ME Unit_01J2ME Unit_01
J2ME Unit_01
 
Migrating to Microservices Patterns and Technologies (edition 2023)
 Migrating to Microservices Patterns and Technologies (edition 2023) Migrating to Microservices Patterns and Technologies (edition 2023)
Migrating to Microservices Patterns and Technologies (edition 2023)
 
Multimedia authoring and user interface
Multimedia authoring and user interface Multimedia authoring and user interface
Multimedia authoring and user interface
 
IBM MQ Advanced - IBM InterConnect 2016
IBM MQ Advanced - IBM InterConnect 2016IBM MQ Advanced - IBM InterConnect 2016
IBM MQ Advanced - IBM InterConnect 2016
 
Microservices Architecture & Testing Strategies
Microservices Architecture & Testing StrategiesMicroservices Architecture & Testing Strategies
Microservices Architecture & Testing Strategies
 
Transforming to Microservices
Transforming to MicroservicesTransforming to Microservices
Transforming to Microservices
 
Kushal
KushalKushal
Kushal
 
Introductorytocomputing
IntroductorytocomputingIntroductorytocomputing
Introductorytocomputing
 
Messaging in the Cloud with IBM MQ Light and IBM Bluemix
Messaging in the Cloud with IBM MQ Light and IBM BluemixMessaging in the Cloud with IBM MQ Light and IBM Bluemix
Messaging in the Cloud with IBM MQ Light and IBM Bluemix
 
Cloudtechnologyassociatepart 1
Cloudtechnologyassociatepart 1Cloudtechnologyassociatepart 1
Cloudtechnologyassociatepart 1
 
Microservices Architecture - Cloud Native Apps
Microservices Architecture - Cloud Native AppsMicroservices Architecture - Cloud Native Apps
Microservices Architecture - Cloud Native Apps
 
MicroserviceArchitecture in detail over Monolith.
MicroserviceArchitecture in detail over Monolith.MicroserviceArchitecture in detail over Monolith.
MicroserviceArchitecture in detail over Monolith.
 
Mobile app-and-microservices-with-ibm-cloud
Mobile app-and-microservices-with-ibm-cloudMobile app-and-microservices-with-ibm-cloud
Mobile app-and-microservices-with-ibm-cloud
 
Over view of software artitecture
Over view of software artitectureOver view of software artitecture
Over view of software artitecture
 
Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#
 

Mehr von Niit Care

Mehr von Niit Care (20)

Ajs 4 c
Ajs 4 cAjs 4 c
Ajs 4 c
 
Ajs 1 a
Ajs 1 aAjs 1 a
Ajs 1 a
 
Ajs 1 c
Ajs 1 cAjs 1 c
Ajs 1 c
 
Dacj 4 2-c
Dacj 4 2-cDacj 4 2-c
Dacj 4 2-c
 
Dacj 4 2-b
Dacj 4 2-bDacj 4 2-b
Dacj 4 2-b
 
Dacj 4 2-a
Dacj 4 2-aDacj 4 2-a
Dacj 4 2-a
 
Dacj 4 1-c
Dacj 4 1-cDacj 4 1-c
Dacj 4 1-c
 
Dacj 4 1-b
Dacj 4 1-bDacj 4 1-b
Dacj 4 1-b
 
Dacj 1-3 c
Dacj 1-3 cDacj 1-3 c
Dacj 1-3 c
 
Dacj 1-3 b
Dacj 1-3 bDacj 1-3 b
Dacj 1-3 b
 
Dacj 1-3 a
Dacj 1-3 aDacj 1-3 a
Dacj 1-3 a
 
Dacj 1-2 c
Dacj 1-2 cDacj 1-2 c
Dacj 1-2 c
 
Dacj 1-2 a
Dacj 1-2 aDacj 1-2 a
Dacj 1-2 a
 
Dacj 1-1 c
Dacj 1-1 cDacj 1-1 c
Dacj 1-1 c
 
Dacj 1-1 b
Dacj 1-1 bDacj 1-1 b
Dacj 1-1 b
 
Dacj 1-1 a
Dacj 1-1 aDacj 1-1 a
Dacj 1-1 a
 
Dacj 2-2 b
Dacj 2-2 bDacj 2-2 b
Dacj 2-2 b
 
Dacj 2-2 a
Dacj 2-2 aDacj 2-2 a
Dacj 2-2 a
 
Dacj 2-1 c
Dacj 2-1 cDacj 2-1 c
Dacj 2-1 c
 
Dacj 2-1 b
Dacj 2-1 bDacj 2-1 b
Dacj 2-1 b
 

Kürzlich hochgeladen

Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 

Kürzlich hochgeladen (20)

Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 

Ajs 4 b

  • 1. 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