use of io.openmessaging.connector.api.exception.DataConnectException in project rocketmq-externals by apache.
the class RabbitMQPatternProcessor method connectionFactory.
public ConnectionFactory connectionFactory() {
RMQConnectionFactory connectionFactory = new RMQConnectionFactory();
try {
List<String> urlList = new ArrayList<>();
urlList.add(config.getBrokerUrl());
connectionFactory.setUris(urlList);
} catch (JMSException e) {
throw new DataConnectException(ErrorCode.START_ERROR_CODE, e.getMessage(), e);
}
return connectionFactory;
}
use of io.openmessaging.connector.api.exception.DataConnectException in project rocketmq-externals by apache.
the class BaseJmsSourceTask method start.
@Override
public void start(KeyValue props) {
try {
this.config = new Config();
this.config.load(props);
this.sourcePartition = ByteBuffer.wrap(config.getBrokerUrl().getBytes("UTF-8"));
this.replicator.start();
} catch (Exception e) {
log.error("activemq task start failed.", e);
throw new DataConnectException(ErrorCode.START_ERROR_CODE, e.getMessage(), e);
}
}
use of io.openmessaging.connector.api.exception.DataConnectException in project rocketmq-externals by apache.
the class ActivemqSourceTask method start.
@Override
public void start(KeyValue props) {
try {
this.config = new Config();
this.config.load(props);
this.sourcePartition = ByteBuffer.wrap(config.getActivemqUrl().getBytes("UTF-8"));
this.replicator = new Replicator(config);
this.replicator.start();
} catch (Exception e) {
log.error("activemq task start failed.", e);
throw new DataConnectException(ErrorCode.START_ERROR_CODE, e.getMessage(), e);
}
}
Aggregations