I would like to know which pattern is recommended to work with counter representing the number of message processed, with an application that should be stateless.
For example, in an architecture where an application is deployed on several servers, a database is used to store the persistent information (session, etc...). However, such information are not exposed to concurrent updates like a message counter would be. In a mono-instance application we could use singleton, but this is not the case here.
What would be your suggestion to implement a such counter ? Is using a counter a bad design ?