The correct choice depends not just on whether you are a good bean-sheller and a poor bean-counter, but on whether the world is full of better cooks and worse accountants.
The statistics are being collected by a message-driven bean (MDB) that is constructed to listen to the topic and increment an internal counter when a message is received.