Files
Soby Chacko 760683cc2a Restructuing with maven revision feature
Preserving the maven revision feature from the previous commit,
but perform a bit more restructuring the hierarchy.
2020-10-13 15:17:52 -04:00
..
2020-08-13 15:01:31 -04:00
2020-08-11 13:08:28 -04:00

# 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 link:src/main/java/org/springframework/cloud/fn/consumer/mongo/MongoDBConsumerProperties.java[MongoDBConsumerProperties].

## Examples

See this link:src/test/java/org/springframework/cloud/fn/consumer/mongo/MongoDBConsumerApplicationTests.java[test suite] for the various ways, this consumer is used.

## Other usage

See this https://github.com/spring-cloud/stream-applications/blob/master/applications/sink/mongodb-sink/README.adoc[README] where this consumer is used to create a Spring Cloud Stream application where it makes a MongoDB sink.