I want to make an application where:
- Users will send a message to queue
- Listener will listen messages of queue After processing of message in listener, listener will create a new response message and send it to another success or fail开发者_如何学Goure queue.
Questions:
- Should I use activemq as storage of processed messages?
- Will I be able to retrieve all messages of one queue without listing to them?
- Do we have any other solution for keeping all processed messages? I want to make a report of all processed messages present in success and failure queue.
You can find a minimalistic sample here and here for using ActiveMQ with Spring. About persistence options, read ActiveMQ docs. Also you might want to check out these slides, to get a general overview on Spring JMS with ActiveMQ.
ActiveMQ is not a storage facility, it is a message-passing facility.
If you want to store the messages after processing them then use a database. For example, create a table that has a status flag for success or failure, then for reporting query that table.
精彩评论