microsoft / spring-data-cosmosdb

Access data with Azure Cosmos DB
MIT License
94 stars 64 forks source link

Provide support to use custom documentdbfactory bean #399

Closed warrenzhu25 closed 4 years ago

warrenzhu25 commented 5 years ago

I want to provide my own implementation of DocumentDbFactory bean. But now it's unsupported.

dsibilio commented 5 years ago

Isn't it sufficient to add the following in your project that uses spring-data-cosmosdb?

@Bean
@Primary
public DocumentDbFactory documentDbFactory(DocumentDBConfig config) {
    return new MyCustomDocumentDbFactory(config);
}

I've been checking the object ids in debug and it seems to be working fine for me.

kushagraThapar commented 4 years ago

@dsibilio - thanks for the answer :) @warrenzhu25 - I am closing this due to inactivity. In the upcoming semester, we are planning to support multi-database support through spring-data-cosmosdb. That should also enable you to support custom documentdb factory bean.