Skip to main content

(nbjrcg) Is it possible to control the number of concurrent instances of a Message-Driven-Bean?

9 replies [Last post]
Anonymous

From: Jorge Campins
To: users@glassfish.dev.java.net
Sent: Thursday, June 12, 2008 6:55 AM
Subject: (nbjrcg) Is it possible to control the number of concurrent instances of a Message-Driven-Bean?

Is it possible to control the number of concurrent instances of a Message-Driven-Bean?

In particular I would like to avoid messages from a specific queue to be retrieved in parallel by 2 or more instances of the corresponding MDB.

Thanks.

[att1.html]

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Jorge Campins

Abel,

This is how I solved my problem. I followed Ramesh Parthasarathy's advice
and I still use the @MessageDriven annotation at the bean but also added
this at
the sun-ejb-jar:


RequestMessageBean

1
1
1

600

You should adjust the parameters according to your needs. I was trying to
"serialize" the processing of a particular kind of messages so I send those
messages to a special queue and set max-pool-size to 1.

I hope this can help.

----- Original Message -----
From:
To:
Sent: Thursday, June 26, 2008 6:47 AM
Subject: Re: (nbjrcg) Is it possible to control the number of concurrent
instances o

> Hi, could somebody explain us how to configure pool size per MDB in EJB3,
> under Glassfish V2UR1?
> Is there any propietary annotation?
> sun-ejb-jar.xml is just for EJB 2.1, isn't it?
>
> Thanks,
> Abel.
> [Message sent by forum member 'abelmj' (abelmj)]
>
> http://forums.java.net/jive/thread.jspa?messageID=282737
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: users-help@glassfish.dev.java.net
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net

abelmj
Offline
Joined: 2006-05-03

Thanks a lot. I'll give it a try!

abelmj
Offline
Joined: 2006-05-03

Jorge and ksak, it worked like a charm.
Thanks again!

Ramesh Parthasarathy

Hi Jorge,
Do you want only one MDB instance to consume from a queue at any point.
And your MDB is deployed on a standalone instance (or DAS).
Have you tried setting the max-pool-size to 1.


1
1
1

Please let me know if i have mis-understood your question.

Thanks
-Ramesh

Jorge Campins wrote:
> *From:* Jorge Campins
> *To:* users@glassfish.dev.java.net
> *Sent:* Thursday, June 12, 2008 6:55 AM
> *Subject:* (nbjrcg) Is it possible to control the number of concurrent
> instances of a Message-Driven-Bean?
>
> Is it possible to control the number of concurrent instances of a
> Message-Driven-Bean?
>
>
>
> In particular I would like to avoid messages from a specific queue to be
> retrieved in parallel by 2 or more instances of the corresponding MDB.
>
>
>
> Thanks.
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net

Jorge Campins

Hi Ramesh,

I'm really new to JMS. I'm trying to implement a fork-and-join pattern. I
thought the easiest way to join the answers was to store them as they arrive
and process them all when the last one arrives. I also thought the easiest
way to do this was to have a special queue for those messages and make sure
they were retrieved one by one.

Where do I set the pool size for an MDB and just for that MDB? I have other
MDBs in the same project and I don't want them to have a single thread pool.

Regards,

Jorge

----- Original Message -----
From: "Ramesh Parthasarathy"
To:
Sent: Thursday, June 12, 2008 7:19 AM
Subject: Re: (nbjrcg) Is it possible to control the number of concurrent
instances of a Message-Driven-Bean?

> Hi Jorge,
> Do you want only one MDB instance to consume from a queue at any point.
> And your MDB is deployed on a standalone instance (or DAS).
> Have you tried setting the max-pool-size to 1.
>
>
> 1
> 1
> 1
>

>
> Please let me know if i have mis-understood your question.
>
> Thanks
> -Ramesh
>
> Jorge Campins wrote:
>> *From:* Jorge Campins
>> *To:* users@glassfish.dev.java.net
>> *Sent:* Thursday, June 12, 2008 6:55 AM
>> *Subject:* (nbjrcg) Is it possible to control the number of concurrent
>> instances of a Message-Driven-Bean?
>>
>> Is it possible to control the number of concurrent instances of a
>> Message-Driven-Bean?
>>
>> In particular I would like to avoid messages from a specific queue to be
>> retrieved in parallel by 2 or more instances of the corresponding MDB.
>>
>> Thanks.
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: users-help@glassfish.dev.java.net
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net

Ramesh Parthasarathy

Hi,
Please configure it in sun-ejb-jar.xml (under ). Yes, the
information is per MDB and will not affect other MDBs in your application

Thanks
-Ramesh

Jorge Campins wrote:
> Hi Ramesh,
>
> I'm really new to JMS. I'm trying to implement a fork-and-join pattern.
> I thought the easiest way to join the answers was to store them as they
> arrive and process them all when the last one arrives. I also thought
> the easiest way to do this was to have a special queue for those
> messages and make sure they were retrieved one by one.
>
> Where do I set the pool size for an MDB and just for that MDB? I have
> other MDBs in the same project and I don't want them to have a single
> thread pool.
>
> Regards,
>
> Jorge
>
> ----- Original Message ----- From: "Ramesh Parthasarathy"
>
> To:
> Sent: Thursday, June 12, 2008 7:19 AM
> Subject: Re: (nbjrcg) Is it possible to control the number of concurrent
> instances of a Message-Driven-Bean?
>
>
>> Hi Jorge,
>> Do you want only one MDB instance to consume from a queue at any
>> point. And your MDB is deployed on a standalone instance (or DAS).
>> Have you tried setting the max-pool-size to 1.
>>
>>
>> 1
>> 1
>> 1
>>

>>
>> Please let me know if i have mis-understood your question.
>>
>> Thanks
>> -Ramesh
>>
>> Jorge Campins wrote:
>>> *From:* Jorge Campins
>>> *To:* users@glassfish.dev.java.net
>>> *Sent:* Thursday, June 12, 2008 6:55 AM
>>> *Subject:* (nbjrcg) Is it possible to control the number of
>>> concurrent instances of a Message-Driven-Bean?
>>>
>>> Is it possible to control the number of concurrent instances of a
>>> Message-Driven-Bean?
>>>
>>> In particular I would like to avoid messages from a specific queue
>>> to be retrieved in parallel by 2 or more instances of the
>>> corresponding MDB.
>>>
>>> Thanks.
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
>> For additional commands, e-mail: users-help@glassfish.dev.java.net
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: users-help@glassfish.dev.java.net
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net

Jorge Campins

That leads me to another question.

It is my current understanding that Glassfish V2 implements EJB3 and
therefore Message Driven Beans are now controlled by the @MessageDriven
annotation at the bean, not by the sun-ejb-jar.xml.

I haven't been able to find a complete explanation of all possible
properties that can be configured using the @MessageDriven annotation . This
task seems to be closely related to the Application Server. I've tried
looking at Glassfish documentation and also at Sun Application Server 9
documentation. (I did found the mention to the sun-ejb-jar.xml but that was
at Sun Application Server 8 documentation and, as I said, I understand that
is EJB2).

Could you please point me to a good resource for @MessageDriven and/or
sun-ejb-jar.xml.documentation?

Thanks again.

Jorge

----- Original Message -----
From: "Ramesh Parthasarathy"
To:
Sent: Thursday, June 12, 2008 7:47 AM
Subject: Re: (nbjrcg) Is it possible to control the number of concurrent
instances of a Message-Driven-Bean?

> Hi,
> Please configure it in sun-ejb-jar.xml (under ). Yes, the information
> is per MDB and will not affect other MDBs in your application
>
> Thanks
> -Ramesh
>
> Jorge Campins wrote:
>> Hi Ramesh,
>>
>> I'm really new to JMS. I'm trying to implement a fork-and-join pattern. I
>> thought the easiest way to join the answers was to store them as they
>> arrive and process them all when the last one arrives. I also thought the
>> easiest way to do this was to have a special queue for those messages and
>> make sure they were retrieved one by one.
>>
>> Where do I set the pool size for an MDB and just for that MDB? I have
>> other MDBs in the same project and I don't want them to have a single
>> thread pool.
>>
>> Regards,
>>
>> Jorge
>>
>> ----- Original Message ----- From: "Ramesh Parthasarathy"
>>
>> To:
>> Sent: Thursday, June 12, 2008 7:19 AM
>> Subject: Re: (nbjrcg) Is it possible to control the number of concurrent
>> instances of a Message-Driven-Bean?
>>
>>
>>> Hi Jorge,
>>> Do you want only one MDB instance to consume from a queue at any point.
>>> And your MDB is deployed on a standalone instance (or DAS).
>>> Have you tried setting the max-pool-size to 1.
>>>
>>>
>>> 1
>>> 1
>>> 1
>>>

>>>
>>> Please let me know if i have mis-understood your question.
>>>
>>> Thanks
>>> -Ramesh
>>>
>>> Jorge Campins wrote:
>>>> *From:* Jorge Campins
>>>> *To:* users@glassfish.dev.java.net
>>>>
>>>> *Sent:* Thursday, June 12, 2008 6:55 AM
>>>> *Subject:* (nbjrcg) Is it possible to control the number of concurrent
>>>> instances of a Message-Driven-Bean?
>>>>
>>>> Is it possible to control the number of concurrent instances of a
>>>> Message-Driven-Bean?
>>>>
>>>> In particular I would like to avoid messages from a specific queue to
>>>> be retrieved in parallel by 2 or more instances of the corresponding
>>>> MDB.
>>>>
>>>> Thanks.
>>>>
>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
>>> For additional commands, e-mail: users-help@glassfish.dev.java.net
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
>> For additional commands, e-mail: users-help@glassfish.dev.java.net
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: users-help@glassfish.dev.java.net
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net

abelmj
Offline
Joined: 2006-05-03

Hi, could somebody explain us how to configure pool size per MDB in EJB3, under Glassfish V2UR1?
Is there any propietary annotation?
sun-ejb-jar.xml is just for EJB 2.1, isn't it?

Thanks,
Abel.

ksak
Offline
Joined: 2005-05-20

Hi Abel,

We have not defined annotations for our vendor-specific configuration. sun-ejb-jar.xml is not
specific to EJB 2.1. There is a different DTD for each version of Java EE. You can find them
all in /lib/dtds.

To configure MDB-specific pool behavior, set one or more sub-elements of in
sun-ejb-jar.xml.