Github repository - https://github.com/joshlong-attic/2024-bootiful-spring-workshop
- IDE choices: IntelliJ, VSCode, Eclipse.
- Java: GraalVM (team working on it as part of Oracle).
- Key Resources:
- start.spring.io: An API, website, and IDE wizard for bootstrapping Spring applications.
- Devtools: For instant changes during development.
- Docker Compose: Automates container setup.
- Testcontainers: Helps with automated testing/dev setup.
- Amazon Corretto: Mentioned as a widely used Java distribution.
- Spring JavaFormat Plugin:
- Ensures consistent formatting across teams.
- GitHub Repository.
- Note: Still not formatted automatically.
- Environment Variables:
- SDKMAN:
sdk env init
.- SDKMAN RC.
- IntelliJ plugin.
- direnv: For managing environment variables.
- SDKMAN:
- Password Management: 1Password/Bitwarden have an API tool for secrets management.
- Desk check: Ensuring consistent experience for all developers.
- Data-Oriented Programming: Examples in Java 21+.
- Dependency Injection & Beans:
- Stereotypes (from UML, describes component function).
- Bean lifecycle.
- BeanPostProcessor (BPP).
- Transaction demarcation.
- AOP (Aspect-Oriented Programming):
- Proxy: method point, adds callback to methods.
- Spring Boot uses BeanPostProcessor to wrap beans.
- GraalVM and AOT (Ahead of Time) Compilation:
- Installing and using GraalVM.
- Building native images with GraalVM for optimized performance.
- Managing AOT lifecycles in Spring.
- Tree-shaking: Optimization by removing unused code (like shaking a tree to remove dead branches). However, it can inadvertently discard necessary code.
- Challenges with serialization/deserialization: GraalVM only preserves types that are passed as parameters or return types, meaning some features (like serialization) may be discarded.
- Manual hints: Need to add hints manually to preserve the necessary code, either through JSON configuration or by referring to Oracle documentation.
- Spring Batch Processing:
- Loading data from CSV files to SQL databases.
- JdbcClient for database interactions.
- SQL initialization.
- Flyway for database migrations.
- Spring Data JDBC for simpler persistence management.
- REST Services:
RestClient
vsRestTemplate
(RestClient is newer and preferred; RestTemplate is older and considered legacy).- Declarative clients.
- Creating REST controllers (including functional style).
- GraphQL: Alternative to REST for querying APIs.
- Event-Driven Architecture:
- Messaging technologies like RabbitMQ and Apache Kafka.
- Spring Integration: Leveraging file-based events to trigger application events.
- Event Sourcing:
- Storing and replaying events to rebuild system state.
- Spring helps with this, and I believe Spring Batch is involved. However, other components like Spring Cloud Stream or Spring Data may also play a role.
- Ensures consistent event handling and fault tolerance.
- Non-blocking IO: Improves scalability by handling requests asynchronously.
- Virtual Threads (Project Loom) vs Carrier Threads:
- Virtual Threads provide lightweight, efficient threading.
- Demos from José Paumard and Cora Iberkleid showed examples of virtual thread scalability.
- "Hey" load testing tool for simulating traffic.
- Spring Modulith: Building modular monolithic applications with Spring.
- Externalized Configuration: Managing configurations separately from the application code.
- Testing:
- ArchUnit for architecture tests.
- Port 0: Random Port in Spring Boot for testing purposes.
- Spring AI:
- Basics of integrating AI models with Spring.
- Using
ChatClient
for AI-driven conversations.
- Retrieval-Augmented Generation (RAG): A technique used in AI for augmenting queries with relevant data.
- LLAMA: Mentioned as a local AI model option.
- Centralized Configuration: Managing configurations across microservices.
- API Gateways: Deciding between reactive and non-reactive API gateways.
- Event Bus: Enables refreshable configuration, service registration, and discovery.
While not covered in detail during the workshop, Josh recommended watching the following video:
- "Passkeys: Goodbye Passwords, Hello Security! (SpringOne)"
Key concepts mentioned in passing:
- Authentication and Authorization.
- OAuth:
- Spring Authorization Server.
- OAuth clients and resource servers.
- Protecting messaging code.
- Language Servers: Many language servers, one editor. Can be used with VSCode, VIM, others...
- "Tuples" in Java: Need to learn more...
- Identity of Record: "The identity of a record is the identity of the component (constructor)" – a principle mentioned.
- Resident Size: Mentioned, but further details were not provided.
Josh's philosophy during the Q&A session:
- "I may not know, but I probably know who does know..."
TODO: Add RSS as a tool to measure memory usage