Search in sources :

Example 1 with ProducerThread

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

the class ActiveMQProducerFactory method updateInternal.

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

Aggregations

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