Skip to content

Latest commit

 

History

History
31 lines (16 loc) · 1.49 KB

File metadata and controls

31 lines (16 loc) · 1.49 KB

MongoDB Consumer

A consumer that allows you to insert records into MongoDB.

Beans for injection

You can import MongoDbConsumerConfiguration in the application and then inject one of the following beans.

Function<Message<?>, Mono<Void>> mongodbConsumerFunction - Allows you to subscribe.

Consumer<Message<?>> mongodbConsumer - Wraps the function as a Consumer with no-op subscriber.

You can use mongodbConsumer or mongodbConsumerFunction as a qualifier when injecting.

The return value from the function can be ignored as this is used as a consumer to send records to MongoDB.

Configuration Options

All configuration properties are prefixed with mongodb.consumer.

For more information on the various options available, please see MongoDBConsumerProperties.

A ComponentCustomizer<ReactiveMongoDbStoringMessageHandler> bean can be added in the target project to provide any custom options for the ReactiveMongoDbStoringMessageHandler configuration used by the mongodbConsumer.

Examples

See this test suite for the various ways, this consumer is used.

Other usage

See this README where this consumer is used to create a Spring Cloud Stream application where it makes a MongoDB sink.