Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using reactive and non-reactive client in the same project #34

Closed
l0co opened this issue Apr 30, 2020 · 0 comments
Closed

Using reactive and non-reactive client in the same project #34

l0co opened this issue Apr 30, 2020 · 0 comments

Comments

@l0co
Copy link

l0co commented Apr 30, 2020

In 2.0.0.M2 BOM this is currently not possible because of NonUniqueBeanException for com.mongodb.MongoClientSettings bean (two the primary beans introduced by DefaultReactiveMongoClientFactory and DefaultMongoClientFactory). This can be worked around by:

@Factory
public class ReactiveMongoFactory {

	@Singleton
	@Replaces(bean = MongoClientSettings.class, factory = DefaultReactiveMongoClientFactory.class)
	public MongoClientSettings mongoClientSettings(DefaultMongoConfiguration mongoConfiguration) {
		return mongoConfiguration.buildSettings();
	}

}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant