Provider (Broker) - Software That Stores A Message and Then
Provider (Broker) - Software That Stores A Message and Then
. Destination location within the provider where the message is stored. Can be of 2 types Q e es and !opics " Point-to-point# $n this model one client p ts a message on a % e e and another client receives the message. Once the message is acknowledged the provider removes the message from the Queue. Q e es retain message ntil the message is cons med or the message e&pires. !he p2p model sho ld be sed if there is only one receiver for a message. 'hen yo p t a message on the Q e e if there are several cons mers listening to it once the first cons mer pic(s it p the message is gone from the provider)s destination. $n *2* the order is not defined and th s there is no g arantee that messages will be delivered in a partic lar order.
" p blish"s bscribe# $n this model the destination is called !opic. A client p blishes a message to the !opic and all s bscribers to the !opic get the message. !he message is not removed from the topic.
JMS Standard api that allows to connect to provider+ create a message+ send a message and receive a message. Messages are sent asynchrono sly. JMS is very similar to J,BC in that J,BC api allows to connect to several database while JMS api connects to several MQ providers - 'ebsphere MQ+ .pen MQ+ 'eblogic MQ/. M,B)s are message listeners r nning within the 0JB container. Client cannot invo(e an M,B directly. !he only way to comm nicate with an M,B is by sending a message to the destination that the M,B is listening. M,B)s are stateless so they process each message b t do not have any state information. Steps#
" get an initial conte&t and get the administered ob1ects Connection2actory and a Q e e-or !opic/. " 2rom the Connection2actory get a Connection and from the connection ob1ect get a Session. " 2rom the Session ob1ect pass the Q e e ob1ect and get a prod cer and also from the session ob1ect create a message. " 3sing the prod cer yo co ld send a message. !he main difference between a sender and a receiver is that the sender has to create a Message*rod cer while the receiver has to have a MessageCons mer. A message bro(er m st provide administered ob1ects for a client to comm nicate.