어설픈 해석보다는 원문 그대로를 적어본다.
ActiveMQ 사용에 있어서의 JmsTemplate 사용에 대한 좋은 내용이다.
ActiveMQ 사용에 있어서의 JmsTemplate 사용에 대한 좋은 내용이다.
- Never use a regular ConnectionFactory unless you are totally sure it does all the pooling you need
- If using in an EJB ensure you use the EJB containers ConnectionFactory; otherwise consider using Jencks to create it for you
- If not using in an EJB then use Jencks to create the ConnectionFactory
- If you are only publishing messages and you are not in an EJB and you are using ActiveMQ then you can use the PooledConnectionFactory
- Ifyou are consuming messages its probably simpler & more efficient& less likely to loose messages to avoid using the receive() methodand use
Message Driven POJOs instead - unless you absolutely must pull messages on demand from inside an EJB.