Sorry, my last reply was a little rushed as I was on my phone. With respect
to JBoss, I don't know how those stats are computed, so I can't make too
much comment there. In TomEE, the stuff under org.apache.activemq is
provided by the ActiveMQ embedded inside TomEE. TomEE provides these
"as-is", so we don't have any control over the values. Your config exposes
the broker with an NIO OpenWire port, so any stats would also include
external connections to that port.

I did a quick test with your config, and used the ActiveMQ
producer/consumer commands (e.g. ./activemq consumer --brokerUrl
nio://localhost:54545 --destination queue://TEST --messageCount 100000)
which use 20 threads by default, and this also shows as one consumer in the
broker JMX stats.

For reference, here's the class that provides the MBean you're looking at
in JConsole:
https://github.com/apache/activemq/blob/activemq-5.15.x/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/SubscriptionView.java
-
you're really looking at subscription to the queue for the connection, so
I'd only expect to see one.

Usually when I see these types of questions, people are really more
concerned about concurrency and getting the right throughput through their
MDBs, and having an accurate measure of that. The "instanceCount" should
provide an accurate measure there (feedback is welcome!), but a test is
worthwhile. This is a basic test that you can build on:
https://github.com/apache/tomee/blob/master/container/openejb-core/src/test/java/org/apache/openejb/core/mdb/MaxInstanceEndpointHandlerTest.java

It:

* loads a queue up with messages:
https://github.com/apache/tomee/blob/master/container/openejb-core/src/test/java/org/apache/openejb/core/mdb/MaxInstanceEndpointHandlerTest.java#L90-L96
* starts the MDB:
https://github.com/apache/tomee/blob/master/container/openejb-core/src/test/java/org/apache/openejb/core/mdb/MaxInstanceEndpointHandlerTest.java#L99
* and checks we had the concurrency we expected (30 concurrent instances):
https://github.com/apache/tomee/blob/master/container/openejb-core/src/test/java/org/apache/openejb/core/mdb/MaxInstanceEndpointHandlerTest.java#L102

If you wanted to have a go building on this test to include multiple queues
and MDBs that would be really awesome. Adding some checks in there for the
instance count through JMX would be a good improvement too.

I hope that helps. I appreciate that this isn't necessarily
straightforward, so if you have more questions, please ask!

Jon


On Tue, Jul 7, 2020 at 9:38 AM Dignesh <[email protected]> wrote:

> Thank you Jon.
> I was expecting the consumer count shown in the jconsole tool to be matched
> with maxsessions/InstanceLimit.
>
> When I switch the Appserver to JBoss, I do notice the consumer count value
> shown properly.
>
> If it is expected in TomEE, the only way to find the number of consumers is
> via InstanceLimit ? Am i correct ? Jboss-ConsumerCoun.png
> <
> http://tomee-openejb.979440.n4.nabble.com/file/t375864/Jboss-ConsumerCoun.png>
>
> TomEE_-_consumercount.JPG
> <
> http://tomee-openejb.979440.n4.nabble.com/file/t375864/TomEE_-_consumercount.JPG>
>
>
> I have attached the screenshots of both the application servers.
>
>
>
> --
> Sent from:
> http://tomee-openejb.979440.n4.nabble.com/TomEE-Dev-f982480.html
>

Reply via email to