public Consumer createConsumer(Processor processor) throws Exception { validateOptions('C'); // we never create the collection createCollection = false; initializeConnection(); // select right consumer type if (consumerType == null) { consumerType = MongoDbConsumerType.tailable; } Consumer consumer = null; if (consumerType == MongoDbConsumerType.tailable) { consumer = new MongoDbTailableCursorConsumer(this, processor); } else { throw new CamelMongoDbException("Consumer type not supported: " + consumerType); } return consumer; }
public Producer createProducer() throws Exception { validateOptions('P'); initializeConnection(); return new MongoDbProducer(this); }