Search in sources :

Example 1 with ConsumerThread

use of io.fabric8.mq.ConsumerThread in project fabric8 by jboss-fuse.

the class ActiveMQConsumerFactory method updateInternal.

private void updateInternal(Map<String, ?> configuration) throws Exception {
    try {
        LOG.info("Starting consumer");
        consumerService = new ActiveMQService(connectionFactory);
        consumerService.setMaxAttempts(10);
        consumerService.start();
        String destination = (String) configuration.get("destination");
        if (destination == null) {
            destination = DEFAULT_DESTINATION;
        }
        consumer = new ConsumerThread(consumerService, destination);
        consumer.start();
        LOG.info("Consumer started");
    } catch (JMSException e) {
        throw new Exception("Cannot start consumer", e);
    }
}
Also used : ActiveMQService(io.fabric8.mq.ActiveMQService) ConsumerThread(io.fabric8.mq.ConsumerThread) JMSException(javax.jms.JMSException) JMSException(javax.jms.JMSException)

Aggregations

ActiveMQService (io.fabric8.mq.ActiveMQService)1 ConsumerThread (io.fabric8.mq.ConsumerThread)1 JMSException (javax.jms.JMSException)1