What is the purpose of the @QueryMapping annotation in Spring GraphQL?
@QueryMapping connects a field of the GraphQL Query type to a Spring controller method, matched by name, so you can write resolvers without extra interfaces.
2,886 posts about Java: questions with answers, tutorials and articles, newest first.
@QueryMapping connects a field of the GraphQL Query type to a Spring controller method, matched by name, so you can write resolvers without extra interfaces.
Add the GraphQL starter, write a schema, and map fields with @QueryMapping and @MutationMapping. Covers GraphiQL, batching, properties and tests.
Develop a GraphQL API with Spring Boot using Spring for GraphQL, covering schema, controllers, validation, error handling, testing and production tips.
Spring Cloud Sleuth is limited to Spring Boot 2. See how traces, spans and log correlation work and how to set up Micrometer Tracing with Zipkin on Spring Boot 3.
Spring Cloud Sleuth added trace and span IDs to Spring Boot 2 microservices. It is now replaced by Micrometer Tracing in Spring Boot 3 and later.
Centralized logging for microservices combines structured JSON logs, trace IDs, a log shipper and a searchable store such as Elasticsearch or Loki.
Query describes a search request and Criteria builds its field conditions. See CriteriaQuery, NativeQuery and ElasticsearchOperations in a complete example.
The @Document annotation maps a Java class to an Elasticsearch index. Learn its attributes, how it works with @Field and @Setting, and when indices get created.
Set up Spring Data Elasticsearch in Spring Boot 3, map a document, and run create, read, update, delete and search with ElasticsearchRepository or ElasticsearchOperations.
Add spring-boot-starter-data-elasticsearch and set spring.elasticsearch.uris plus credentials. Covers TLS, ElasticsearchClient, repositories and custom Java configuration.
It auto-configures an Elasticsearch client, template and repository support so you can index and search documents from Spring Boot.
The Spring AMQP ErrorHandler is called when a RabbitMQ listener throws. Use it to log, classify and reject messages so poison messages do not loop forever.
Avoid endless requeue loops in Spring AMQP: enable retry with back-off, configure a dead-letter queue and reject permanent failures without requeue.
MessageConverter turns Java objects into RabbitMQ messages and back. See the built-in converters, how to switch to JSON, and how to map types between services.
@RabbitListener makes a Spring method consume messages from RabbitMQ queues, handling the listener container, conversion and acknowledgement for you.
RabbitTemplate wraps the RabbitMQ client so you can publish, convert and receive messages in Spring Boot with minimal code, including JSON and publisher confirms.
Build a reliable RabbitMQ producer with Spring Boot: connection properties, exchange and queue beans, JSON conversion, RabbitTemplate and publisher confirms.
Spring Kafka retries failed records and sends them to a dead-letter topic with DefaultErrorHandler, which replaced the removed ErrorHandler interface.
Configure DefaultErrorHandler, retries and a dead-letter topic in Spring Kafka, and protect consumers from poison records and deserialization failures.
The Spring Kafka MessageConverter maps Kafka records to the Spring messages and objects your listener uses. See built-in converters and setup.