What is the size of the pool affected to the MDBs ?
Emmanuel
Le 28/08/2025 à 17:11, 'Christoffer A. Nilsen' via WildFly a écrit :
> We are testing to see how many concurrent /MessageListener/ sessions that are working at the same time. And it seems like the startup or
> breakdown of the /MessageListener/ is very slow. Meaning that we are not able to get more than around 5 concurrent MDB's working at the
> same time. However, by using a /ExecutorService/ we can greatly improve the performance by splitting the workload of our code and the
> startup and breakdown.
>
> I'm wondering if anyone has any ideas on why, how we could investigate this further, and/or if it is recommended/common to use a
> /ExecutorService/ in the MDB?
>
> *Our test setup*
>
> * Wildfly 31.0.0.Final
> * Remote ActiveMQ Artemis 2.30.0
> * MDB maxSessions: 40
> * I disable the MDB while filling the ActiveMQ queue with 1000 messages.
> * Keep a count of current working threads
> o At the start of the onMessage() method we add 1 to a global counter
> o At the end of the onMessage() method we subtract 1 from the global counter
> o Log the counter in onMessage()
> * The onMessage() method does work that takes approx. 500ms.
>
> *
> *
> *Expected behavior*
> The majority of the logged messages should be: /"Running 40/40", /except at startup and when we are close to finished with all 1000 messages.
> *
> *
> *Results without ExecutorService*
> When I start the MDB again, having 1000 messages queued, we see the counter jump to 40/40 as expected. But after the first 40 are finished
> processing, it might take around 2000ms before we see 1/40 working threads, and it increases and stabilize around 5/40 until all 1000
> messages are done processing.
>
> *Results with ExecutorService*
> I add a global /ExecutorService/ with /FixedThreadPool/=40, and have all my /onMessage()/ method logic handles by the /ExecutorService/.
>
> When I start the MDB again, having 1000 messages queued, we see the expected behavior having 40/40 working threads until all 1000 messages
> are done processing. This is also a lot quicker than not using the /ExecutorService/.
>
> My thought is that by using a /ExecutorService/, we delegate 40 threads to the startup and breakdown of the MDBs, and 40 threads to the
> /onMessage()/ processing. Meaning the startup or most likely the breakdown of the MDB is slower than my /onMessage()/ processing, creating
> a huge bottleneck.
>
> Any thoughts?
> *
> *
> --
> You received this message because you are subscribed to the Google Groups "WildFly" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
wildfly+u...@googlegroups.com.
> To view this discussion visit
https://groups.google.com/d/msgid/wildfly/adfecdc8-9358-4967-b6a0-0bb36a096fbdn%40googlegroups.com
> <
https://groups.google.com/d/msgid/wildfly/adfecdc8-9358-4967-b6a0-0bb36a096fbdn%40googlegroups.com?utm_medium=email&utm_source=footer>.