Ejemplo n.º 1
0
  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;
  }
Ejemplo n.º 2
0
 public Producer createProducer() throws Exception {
   validateOptions('P');
   initializeConnection();
   return new MongoDbProducer(this);
 }