use of io.fabric8.mq.ActiveMQService 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);
}
}
use of io.fabric8.mq.ActiveMQService 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);
}
}
Aggregations