Search in sources :

Example 46 with JmsTemplate

use of org.springframework.jms.core.JmsTemplate in project camel by apache.

the class JmsPollingConsumer method setReceiveTimeout.

protected void setReceiveTimeout(long timeout) {
    if (template instanceof JmsTemplate) {
        JmsTemplate jmsTemplate = (JmsTemplate) template;
        jmsTemplate.setReceiveTimeout(timeout);
    } else {
        throw new IllegalArgumentException("Cannot set the receiveTimeout property on unknown JmsOperations type: " + template.getClass().getName());
    }
}
Also used : JmsTemplate(org.springframework.jms.core.JmsTemplate)

Aggregations

JmsTemplate (org.springframework.jms.core.JmsTemplate)46 Test (org.junit.Test)30 ConnectionFactory (javax.jms.ConnectionFactory)12 Session (javax.jms.Session)9 ActiveMQConnectionFactory (org.apache.activemq.ActiveMQConnectionFactory)8 Connection (javax.jms.Connection)7 TransactionStatus (org.springframework.transaction.TransactionStatus)7 DefaultTransactionDefinition (org.springframework.transaction.support.DefaultTransactionDefinition)7 Bean (org.springframework.context.annotation.Bean)6 Destination (javax.jms.Destination)4 TextMessage (javax.jms.TextMessage)4 CamelContext (org.apache.camel.CamelContext)4 SessionCallback (org.springframework.jms.core.SessionCallback)4 TransactionCallbackWithoutResult (org.springframework.transaction.support.TransactionCallbackWithoutResult)4 TransactionTemplate (org.springframework.transaction.support.TransactionTemplate)4 JMSException (javax.jms.JMSException)3 Message (javax.jms.Message)3 PooledConnectionFactory (org.apache.activemq.pool.PooledConnectionFactory)3 MockEndpoint (org.apache.camel.component.mock.MockEndpoint)3 JmsOperations (org.springframework.jms.core.JmsOperations)3