protected void activate()

in org.apache.aries.events.mongo/src/main/java/org/apache/aries/events/mongo/MongoMessaging.java [81:90]


    protected void activate(MongoEndpoint config) {
        MongoClientURI uri = new MongoClientURI(config.mongoUri());
        client = new MongoClient(uri);
        String dbName = Optional.ofNullable(uri.getDatabase()).orElse(DEFAULT_DB_NAME);
        this.database = client.getDatabase(dbName);
        this.senderFactory = cachingFactory(topic -> {
            MongoCollection<Document> collection = database.getCollection(topic);
            return messageSender(collection, config.maxAge());
        });
    }