'What is the best/recommended way to start and stop FlowReceiver in J2EE/JEE application?

What is the best place to start/stop Solace listener which subscribes to a topic. Is it ok to create/initialize connection in PostConstruct and close it in PreDestroy methods? In all the examples I see CountDownLatch is used to read just 'n' message, whereas I need to listen for all the messages .



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source