How to Build a Spring Boot Application with MySQL
Set up a Spring Boot application with MySQL using mysql-connector-j, JPA and a REST controller, with Docker, migrations and troubleshooting tips.
2,881 posts about Java: questions with answers, tutorials and articles, newest first.
Set up a Spring Boot application with MySQL using mysql-connector-j, JPA and a REST controller, with Docker, migrations and troubleshooting tips.
Set Spring Boot properties from Docker with -e, env files and Compose, and keep secrets out of the image.
Three ways to containerise Spring Boot: Buildpacks build-image, a basic Dockerfile and a multi-stage layered build with a slim JRE and non-root user.
Package Spring Boot in Docker with a multi-stage Dockerfile or buildpacks, run it as non-root on a maintained JRE image, and configure it with environment variables.
SimpMessagingTemplate lets any Spring bean push STOMP messages to topics or single users. See broker setup, broadcasting, user queues and common mistakes.
Broadcast to all connected clients in Spring Boot using STOMP, @SendTo and SimpMessagingTemplate, then scale out and secure the WebSocket endpoint.
Learn the controller side of Spring Boot WebSockets: @MessageMapping, @SendTo, @SendToUser, SimpMessagingTemplate and error handling.
Set up WebSockets in Spring Boot 3 with a STOMP endpoint, simple broker, message controller and browser client, plus security and scaling.
It adds WebSocket and STOMP messaging support to servlet-based Spring Boot applications, for real-time features such as chat, notifications and live data feeds.
Compare raw WebSocketHandler and STOMP in Spring Boot with working code for both, plus guidance on SockJS, origins and production settings.
Camel's error handler decides what happens when a route step fails: retry, dead letter, handle or propagate. See how to configure it with the Java DSL.
Camel does not retry by default. See how to combine error handlers, onException, doTry and dead letter channels to handle failures in routes.
There is no @Route annotation in Apache Camel. See where @Route really comes from and how to define and auto-register Camel routes with RouteBuilder.
Learn how Apache Camel transforms messages with setBody, processors, beans, JSON and XML data formats and XSLT, and when to choose each one.
How Spring's @Component makes Apache Camel routes discoverable in Spring Boot, how to inject services into routes, and how to control which routes load.
Extend RouteBuilder, annotate it with @Component and define from/to steps. Covers Camel 4 dependencies, file and REST routes, error handling and testing.
camel-spring-boot-starter wires Apache Camel into Spring Boot with a managed CamelContext and route discovery. See setup, a first route and configuration.
Learn how to add Apache Camel 4 to a Spring Boot 3 application, define routes, expose HTTP and REST endpoints, and test them.
The @Id annotation in Spring Data Elasticsearch maps a Java field to the document _id, which identifies the document within its index.
Define an Elasticsearch entity in Spring Boot 3, customise its mapping and analyzers, and create the index with IndexOperations.