What Is the @Document Annotation in Spring Data MongoDB?
The @Document annotation marks a Java class as a MongoDB document, sets the collection name and works with @Id, @Field and @Indexed in Spring Boot.
Spread Your Knowledge. Questions with answers, tutorials and articles, newest first.
The @Document annotation marks a Java class as a MongoDB document, sets the collection name and works with @Id, @Field and @Indexed in Spring Boot.
Step-by-step CRUD with Spring Data MongoDB: map a document, use MongoRepository, expose a REST API and do partial updates with MongoTemplate.
The spring-boot-starter-data-mongodb starter brings Spring Data MongoDB and the Java driver, and auto-configures the client, template and repositories.
Combine Micrometer metrics, step listeners, the metadata tables and condition-based alerts to monitor large Spring Batch transformations reliably.
Validate Spring Batch data in layers with a parameters validator, Bean Validation, custom rules and a protected reject store.
Plan capacity from the deadline, project the finish time after every chunk, and scale threads or alert early so Spring Batch jobs meet their SLA.
Configure fault-tolerant Spring Batch steps with retry, skip and listeners, and compose restartable multi-source jobs with conditional flow.
Monitor Spring Batch at job, step, chunk and item level using Micrometer, Actuator and listeners, with low overhead for latency-sensitive datasets.
Detect failures, bad data and stalled jobs in Spring Batch within seconds using listeners, Micrometer metrics, alerts and a watchdog.
Spring Batch has no predictive validation feature, so you compose one. Launch jobs from events, validate items, score anomalies and record rejected rows.
Use Spring Batch partitioning, bounded executors, per-partition step counters and Micrometer metrics to track resources across distributed datasets.
Turn an SLA into throughput targets, then tune chunks, scale with threads or partitions, schedule with headroom and alert on duration before the deadline.
Expose Spring Batch metrics through a secured Actuator, audit job runs with listeners and keep secrets and personal data out of logs and parameters.
Combine retry, skip policies and restartable readers to keep large Spring Batch jobs running through transient failures and bad records.
The RabbitMQ Channel is a lightweight virtual connection used to declare queues, publish and consume messages. See Java examples and thread safety rules.
The Aggregation class builds MongoDB aggregation pipelines in Java. See match, group, project, lookup and unwind stages run through MongoTemplate.
Netflix Hystrix is in maintenance mode and gone from Spring Cloud. See how to build the same circuit breaker and fallback with Resilience4j in Spring Boot 3.
@HystrixCommand added circuit breaking and fallbacks, but Hystrix is retired. See how to migrate to Resilience4j in Spring Boot.
Add spring-boot-starter-actuator, expose only the endpoints you need, secure them, and extend them with custom health indicators and endpoints.
Write an @AutoConfiguration class, register it in the AutoConfiguration.imports file, make it overridable with conditions, and test it with ApplicationContextRunner.