This depends a lot on how your vendor handles clustering of MDBs. The
specification you quoted is referring to the two different deployments
(enterprise beans) that subscribe to the same destination.  With queues,
messages are only consumed once.  So if you send a message to a queue, only one
of the MDB deployments will be able to get it; the message won't be available
for other MDBs. (some of this depends on transactions and how the JMS provider
handles certain idiosyncrasies.)  Using a point-to-point or a Topic based
destination avoids this problem since all subscribers get their own copy of
every message.

In a clustered environment, the cluster would, ideally, ensure that only one
MDB in one of the clustered servers were able to process a message from a Queue
or a Topic.  This is pretty easy to do with queues since they ensure that only
one client can process a message anyway, which provides for natural load
balancing between servers. With Topic based destinations, however, is more
complicated because JMS will usually deliver all messages to all subscribers.

To really understand how all this works you'll need to take some time to study
JMS and the different message delivery protocols.  Its an exciting and powerful
technology but its not a simple as its API would lead you to believe.

Richard
--
Richard Monson-Haefel
Author of Enterprise JavaBeans, 2nd Edition  (O'Reilly 2000)
Co-Author of Java Message Service (O'Reilly 2000)
http://www.jMiddleware.com

Wei Jiang wrote:

> Hi,
>
> Can any one clarify this for me please?
>
> Say, I have a message-driven bean Ear. I deploy it on each
> server in a clustering environmen. If I send message to all
> instances of the same bean. Will all instances of the same
> bean get my message?
>
> Thanks.
>
> >>>>>>>>>>>>>>>>>>>>>>>>>>
> EJB 2.0 spec:
>
> 14.4.9 Association of a message-driven bean with a destination
>
> The Deployer should avoid associating more than one message-driven bean
> with the same JMS Queue.
>
> If there are multiple JMS consumers for a queue, JMS does not define how
> messages are distribued
> between the queue receivers.
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Auctions - buy the things you want at great prices
> http://auctions.yahoo.com/
>
> ===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff EJB-INTEREST".  For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to