we have couple of steps that are created in lisa to listen to the request xml
TRANSCRIPT
-
7/28/2019 We Have Couple of Steps That Are Created in Lisa to Listen to the Request XML
1/4
-
7/28/2019 We Have Couple of Steps That Are Created in Lisa to Listen to the Request XML
2/4
What is Messaging?
Messaging is a method of communication between software components or applications.A
messaging system is a peer-to-peer facility: A messaging client can send messages to, and receive
messages from, any other client. Each client connects to a messaging agent that provides facilities
for creating, sending, receiving, and reading messages. Messaging enables distributedcommunication that is loosely coupled. A component sends a message to a destination, and the
recipient can retrieve the message from the destination. However, the sender and the receiver do
not have to be available at the same time in order to communicate. In fact, the sender does not need
to know anything about the receiver; nor does the receiver need to know anything
about the sender. The sender and the receiver need to know only what message format and what
destination to use. In this respect, messaging differs from tightly coupled technologies, such as
Remote Method Invocation (RMI) or RPC which require an application to know a remote
applications methods.
Overview
Enterprise messaging products (or as they are sometimes called, Message Oriented Middleware
products) are becoming an essential component for integrating intra-company operations. They
allow separate business components to be combined into a reliable, yet flexible, system.
In addition to the traditional MOM vendors, enterprise messaging products are also provided by
several database vendors and a number of internet related companies.Java language clients and
Java language middle tier services must be capable of using these messaging systems. JMS
provides a common way for Java language programs to access these systems.the JMS API defines
a common set of interfaces and associated semantics that allow programs written in the Java
programming language to communicate with other messaging implementations.
And thats where JMS is useful and if you add Message Driven Beans(MDB) (combination of Session
beans and JMS clients) ,introduced as part of EJB2.0 Specification,then you have an effective
asynchronous messaging system in your middletier which covers areas like security, concurrency,
transaction etc.
TheJMS APIenables communication that is not only loosely coupled but also
Asynchronous. A JMS provider can deliver messages to a client as they arrive;a client does not
have to request messages in order to receive them.
Reliable. The JMS API can ensure that a message is delivered once and only once. Lower levels of
reliability are available for applications that can afford to miss messages or to receive duplicate
messages.
Why do you need JMS ?
There are several reasons why you need JMS in a enterprise middleware application :
http://java.sun.com/products/jms/http://java.sun.com/products/jms/http://java.sun.com/products/jms/http://java.sun.com/products/jms/http://java.sun.com/products/jms/ -
7/28/2019 We Have Couple of Steps That Are Created in Lisa to Listen to the Request XML
3/4
i)Decoupling : Different parts of an application can be developed such that they are not closely tied
to each other
ii)Flexible Integration:Conversely loosely coupled systems can be put together by using MDB for
wrapping existing systems.
iii)Separation of elements involved in messaging applications,for example a logging event can beseparated from ,say retrieving a customer details in a bank application.
iv)Delivering low-level services of an application in offline-mode,meaning although the service must
be provided, the main workflow doesnt have to wait for its completion,for example a logging service
v)Delivering same information to multiple-parties
vi)Most of the top J2EE application servers support messaging.Sun provides a list of JMS vendors
athttp://java.sun.com/products/jms/vendors.html .
Some myths & drawbacks about using JMS
1)Additional overhead in handling messages and messaging systems2)Message-based system can be a single point of failure.
Different types of Messages
There are two main ways to send messages: point-to-point and publish-subscribe.
A point-to-point messaging(queue) application has a single producer (usually) and a single
consumer. The producer produces messages while the consumer consumes them.A point-to-point
system can actually have multiple producers,but usually only a single consumer. For example a print
server,any machine on the network can send a print job to a particular print server.
The publish-subscribe messaging model (pub-sub) is more of a broadcast-oriented model. Publish-
subscribe is based on the idea of topics and typically has many consumers-and potentially many
producers as well.For example, subscription to any forum
Fundamentals in JMS API
The basic elements in JMS are administered objects(connection factories &
destinations),connections,sessions,message producers,message consumers ,queues ,topics and
messages.
A connection factory is the object a client uses to create a connection with a provider.A connection
factory encapsulates a set of connection configuration parameters that has been defined by an
administrator. A pair of connection factories come preconfigured with the J2EE SDK and are
accessible as soon as you start the service.Each connection factory is an instance of either the
QueueConnectionFactory or the TopicConnectionFactory interface.
http://java.sun.com/products/jms/vendors.htmlhttp://java.sun.com/products/jms/vendors.htmlhttp://java.sun.com/products/jms/vendors.htmlhttp://java.sun.com/products/jms/vendors.htmlhttp://java.sun.com/products/jms/vendors.html -
7/28/2019 We Have Couple of Steps That Are Created in Lisa to Listen to the Request XML
4/4
A message producer is an object created by a session and is used for sending messages to a
destination. The Point-to-Point form of a message producer implements the Queue-Sender interface.
The pub/sub form implements the TopicPublisher interface.
A message consumer is an object created by a session and is used for receiving messages sent to adestination. A message consumer allows a JMS client to register interest in a destination with a JMS
provider. The JMS provider manages the delivery of messages from a destination to the registered
consumers of the destination.The PTP form of message consumer implements the QueueReceiver
interface.The pub/sub form implements the TopicSubscriber interface.
Different JMS Message Types
The JMS API defines five message body formats, also called message types, which allow you to
send and to receive data in many different forms and provide compatibility with existing messaging
formats.i)TextMessage : A java.lang.String object (for example, the contents of an Extensible Markup
Language file).
ii)MapMessage : A set of name/value pairs, with names as String objects and values as primitive
types in the Java programming language. The entries can be accessed sequentially by enumerator
or randomly by name. The order of the entries is undefined.
iii)BytesMessage : A stream of uninterpreted bytes. This message type is for literally encoding a
body to match an existing message format.
iv)StreamMessage: A stream of primitive values in the Java programming language,filled and read
sequentially.
v)ObjectMessage :A Serializable object in the Java programming language.
vi)Message : Composed of header fields and properties only. This message type is useful when a
message body is not required.