In addition to the standard course contents, we might use some extra reference materials below whenever needed:
- SpringOne 2019 sessions on Event-driven
- SpringOne 2018 sessions on Event-driven Click "Event-Driven, Reactive" button
-
Domain-driven disign with relational database using Spring Data JDBC
- Talks about ORM complexities and they can be addressed by Spring Data JDBC
-
[The new kid on the block: Spring Data JDBC] (https://www.youtube.com/watch?v=AnIouYdwxo0&ab_channel=SpringDeveloper)
-
Example of a Spring Cloud Load Balanced Rest Template customized with timeout:
/** * RestTemplate Builder * * Following example sets connect timeout of 500ms, * where if client cannot acquire open connection on a socket, * it will time out. * * Operations that timeout on connect events may be retried without * regard to Idempotence. * * The example also shows how to configure the read timeout to 2 * seconds. * This protects the calling client from long running calls in a * downstream server/producer. * * Retries may only be executed across read timeouts if the down * stream operation is idempotent, * use with care. * * @return RestTemplate */ @LoadBalanced @Bean public RestTemplate restTemplate() { return new RestTemplateBuilder() .setConnectTimeout(Duration.ofMillis(500L)) .setReadTimeout(Duration.ofMillis(2000L)) .build(); }
- Add the following configuration class
import org.hsqldb.util.DatabaseManagerSwing;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.jdbc.core.JdbcTemplate;
import javax.annotation.PostConstruct;
import javax.sql.DataSource;
@Configuration
public class HsqldbConfig {
@Autowired
DataSource dataSource;
@Bean
public JdbcTemplate getJdbcTemplate(){
return new JdbcTemplate(dataSource);
}
//default username : sa, password : ''
@PostConstruct
public void getDbManager(){
DatabaseManagerSwing.main(
new String[] { "--url", "jdbc:hsqldb:mem:testdb", "--user", "sa", "--password", ""});
}
}
- Turn off the "java.awt.headless"
System.setProperty("java.awt.headless", "false");
- Follow the lab instruction
-
Spring Boot TDD-driven testing
- Create a new Spring Boot project and follow lab instruction
- Solution project is also included in the above GitHub location
-
OAuth2 presentations
-
OAuth2 lab
- Clone Maven project and follow TODO's startting from TODO-10
- Presentation - only slides 18 to 27
- Lab : Follow instruction under "How to complete this guide/To skip the basics, do the following:" section
-
Spring Lifecycle changes with Spring 5.+ and Java 11
-
Java 11 Drops JSR 250 Annotations, including
@PostConstruct
&@PreDestroy
. See Java 11 Migration Guide and Spring Framework docs -
If using Java 11, you may explicitly import annotations:
implementation 'javax.annotation:javax.annotation-api:1.3.2'
<dependency> <groupId>javax.annotation</groupId> <artifactId>javax.annotation-api</artifactId> <version>1.3.2</version> </dependency>
-
Or, you may use
@Bean
parameters to specific init and cleanup callbacks, see Spring Lifecycle Callbacks for more examples. -
You may also implement the
InitializingBean
orDisposableBean
on the class you want to provide the lifecycle callbacks, but this ties your class to Spring.
-
- How Fast is Spring - Blog
- How Fast is Spring - Short Deck with Flame graphs
- How Fast is Spring - Spring One 2018
-
If you are running Spring Boot apps accessing Pivotal Cloud Foundry Spring Cloud Services, you will need to consider Springboot, Spring Cloud, and Pivotal Spring Cloud Services version dependencies. See Spring Cloud Services Client Dependencies.