users@glassfish.java.net

Re: mdb & cluster

From: Nigel Deakin <nigel.deakin_at_oracle.com>
Date: Mon, 02 Apr 2012 17:14:29 +0100

> I have some problems understanding work load managment regarding a mdb
> using application in a cluster...
>
> As far as I know only one instance of the mdb is executed...In this
> instance I use an enterprise bean - by injection - to handle the
> incoming messages...
>
> I wonder if the actual handling is really spread over all the cluster
> members or if it's happening only where the enterprise bean instance
> resides...?

When you deploy a MDB you're actually creating a pool of MDB instance on each instance in the cluster. If the MDB is
listening on a queue then *one* MDB instance, somewhere in the cluster, will be selected to receive each message.

If the MDB is listening on a topic then the same applies. However for non-durable subscriptions you have the option of
changing this behaviour so that one MDB in each instance (rather than one MDB in the cluster) receives a copy of each
message.

Nigel