@RefreshScope(proxyMode = ScopedProxyMode.DEFAULT)
    @Bean
    @ConditionalOnMissingBean(name = "mongoEventsTemplate")
    public MongoOperations mongoEventsTemplate(final CasConfigurationProperties casProperties,
                                               @Qualifier(CasSSLContext.BEAN_NAME)
                                             final CasSSLContext casSslContext) {
        val mongo = casProperties.getEvents().getMongo();
        val factory = new MongoDbConnectionFactory(casSslContext.getSslContext());
        val mongoTemplate = factory.buildMongoTemplate(mongo);
        MongoDbConnectionFactory.createCollection(mongoTemplate, mongo.getCollection(), mongo.isDropCollection());
        return mongoTemplate;
    }
This is {@link CasMongoDbEventsAutoConfiguration}, defines certain beans via configuration
while delegating some to Spring namespaces inside the context config file.

@author Misagh Moayyed
@since 5.0.0
support/cas-server-support-events-mongo/src/main/java/org/apereo/cas/config/CasMongoDbEventsAutoConfiguration.java