This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JBoss/WildFly and the fly likes How to check the MDB Pool size in JBOSS 5.1.0.GA Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "How to check the MDB Pool size in JBOSS 5.1.0.GA" Watch "How to check the MDB Pool size in JBOSS 5.1.0.GA" New topic
Author

How to check the MDB Pool size in JBOSS 5.1.0.GA

vijay sachin
Greenhorn

Joined: Jan 18, 2011
Posts: 23
Hi All,

I had written some code to configure the Size of the MDB.



I have some Question regarding to above code

1) Can any body please explain when MDB's are created(i.e creating MDB pool), I mean MDB's are created while Jboss is coming up (or) When any new Message comes to Queue?
2) Where can I check how many MDB's are Created in Jboss. (admin-console or jmx-console) ?
3) According to the Above code I specfied the maxSize=50 where can I check how many MDB's are used and how many MBD's are free?

Please help me in this....

Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5812
    
    7

1) As new messages come into the queue. You won't get additional MDBs until the existing ones cannot handle the load. For example, if you get a message per second, and it takes less than a second to process a messages, only one MDB will be created. But it you get 10 messages per second and it take about a second to process a messages, you will end up with 10 MDBs.

2&3) Nowhere that I know of. I use an AtomicInteger within my MDB to keep track of each one, and to know how many there are.


JBoss In Action
vijay sachin
Greenhorn

Joined: Jan 18, 2011
Posts: 23
@Peter Johnson: Thank you very much for the reply

I need to check what is this AtomicInteger, first time I heard about this.
may be I will also try to track MDB's using this AtomicInteger....
vijay sachin
Greenhorn

Joined: Jan 18, 2011
Posts: 23
I have one more doubt in MDB pool.

In my present code, there is MDB constructor which will create KnowledgeBase Object (Noting but reading drools xsl file) Which takes
some 10 to 15 Sec time, which is expensive.

As per my observation JBOSS is calling that constructor when ever message come.

But the purpose of writing that constructor is, before any message comes to the queue JBOSS should have to Invoke the constructor it should not be like message comes
invoke the constructor.

Is there any way to create the pool of MDB Objects when Jboss comes UP? (i.e Constructor Should be called before)

Please help me if some body knows......
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5812
    
    7

You might want to consider writing a service that on startup submits 15 messages so that the MDBs get initialized. Here is an example startup service:
http://community.jboss.org/wiki/ExampleHelloWorldService
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to check the MDB Pool size in JBOSS 5.1.0.GA
 
Similar Threads
javax.transaction.RollbackException in jboss 6
Increasing MDB'S instances
Setting JBoss JMS Queue size
how to force instantiation of MDBs when JBoss starts up?
javax.naming.NameNotFoundException: MyQueueName not bound