An overview of Spring beans. Part 1 – Spring Boot and the Integration Framework
GraphQL is an API query language competing in REST. Allows one request to get a limited set of fields from different objects of the subject area. This reduces the load on the network and the server – reduces the number of requests and the amount of data transferred. Drawbacks of GraphQL – Doesn’t support caching and loading files.
The application can use both REST and GraphQL controllers at the same time. In my opinion, most of the benefits of GraphQL can be obtained using only REST paired with DTO (Data Transfer Object). And GraphQL has no alternative in those cases that require the use of dynamic database queries, for example, through Hibernate Criteria.
37.Spring Web Services
Extended SOAP support.
Note: basic support is implemented in the Spring Framework – Integration component.
38. Spring REST Docs
Automatically generates Open API (Swagger) documentation for REST APIs.
MQ (Message Queue)
Message Queuing (MQ) is a modern way to reliably integrate functional subsystems and exchange data between microservices. It differs from Web Services (SOAP) by reducing labor costs for the development of integration interactions, and from REST by reliability that meets the requirements of enterprise applications.
MQ supports work within the framework of global transactions, which simultaneously include JPA queries to the database. If a series of MQ and JPA requests fails during the interaction of microservices, the state will be rolled back by transactional mechanisms.
The MQ class includes protocols:
JMS – implemented in the “Spring Framework – Integration”, supports the exchange only between java applications.
AMQP – supports applications written in different languages.
Kafka (its own unique protocol) – supports applications written in different languages, is characterized by high performance and scalability.
39. Spring AMQP
AMQP (Advanced Message Queuing Protocol – extended MQ protocol). Differs from JMS in support of applications written in different languages.
For the AMQP protocol, Spring recommends using the RabbitMQ broker, with which the tightest integration is implemented – configuration through property files to implement the third principle of 12-factor applications.
According to reviews, it differs from Kafka in less administration requirements – with moderate loads, it “just works without requiring attention.”
40. Spring for Apache Kafka
Apache Kafka is the most popular message broker. Supports applications written in different languages. Differs in record performance and scalability.
Enterprise Integration Framework
41. Spring Integration
Designed to connect systems using different integration protocols and intermediate data conversion.
Includes libraries for:
data processing in XML,
a collection of 30 integration modules containing 92 adapters.
Application code interacts with adapters through the Message abstraction. The role of adapters is to convert a Message to a message of the required protocol and vice versa.
Supported protocols and data types:
According to reviews, the struggle for popularity, this framework lost to a competitor – Apache Camel. At the same time, it became the basis for the Spring Cloud Stream micro-framework.
The first part of the review introduced the components of Spring Boot and the enterprise integration framework. The second part will describe the components of Spring Cloud.
Surely among the readers there will be those who deeply know this or that component. Corrections and clarifications are welcome.
No position, in search (java developer – monolith / microservices).