Skip to content

Commit

Permalink
release new version. Remove cacheManager from SbpDataSrouceConfigurer
Browse files Browse the repository at this point in the history
  • Loading branch information
hank-cp committed Apr 17, 2024
1 parent c6eb6bc commit f09075b
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 19 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Spring Cloud application.
* AOP

* Code and test plugin project as **STANDALONE** Spring Boot project.
* Supports Spring Boot from `2.x` to `3.1.x`
* Supports Spring Boot from `2.x` to `3.2.x`
* **NO** extra knowledge **NEED TO LEARN** as long as you are familiar with Spring Boot.
* **NO XML**

Expand Down Expand Up @@ -70,15 +70,15 @@ application, just like any single service provider node in Spring Cloud network.
<dependency>
<groupId>org.laxture</groupId>
<artifactId>sbp-spring-boot-starter</artifactId>
<version>3.2.23</version>
<version>3.2.24</version>
</dependency>
```
* Gradle
```
dependencies {
implementation "org.springframework.boot:spring-boot-starter-web"
implementation "org.springframework.boot:spring-boot-starter-aop"
implementation 'org.laxture:sbp-spring-boot-starter:3.2.23'
implementation 'org.laxture:sbp-spring-boot-starter:3.2.24'
}
```
* Latest master code is always available with version `-SNAPSHOT`
Expand Down Expand Up @@ -108,13 +108,13 @@ application, just like any single service provider node in Spring Cloud network.
<dependency>
<groupId>org.laxture</groupId>
<artifactId>sbp-core</artifactId>
<version>3.2.23</version>
<version>3.2.24</version>
</dependency>
```
* Gradle
```
dependencies {
implementation 'org.laxture:sbp-core:3.2.23'
implementation 'org.laxture:sbp-core:3.2.24'
}
```
4. Add Plugin class
Expand Down
12 changes: 6 additions & 6 deletions docs/extensible_integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ You could also implement your own `IPluginConfigurer` to integrate other framewo
or raise an [issue](https://github.com/hank-cp/sbp/issues/new) to request a new integration.

### WebMvc/WebFlux
* dependencies: `implementation 'org.laxture:sbp-spring-boot-starter:3.2.23'`
* dependencies: `implementation 'org.laxture:sbp-spring-boot-starter:3.2.24'`
* by `SbpWebConfigurer`
* it's mandatory, and it will always be first one in the processing queue.
* Plugin webmvc/webflux controller and router function will be registered to main `ApplicationContext` when plugin is started.
* Unregister when plugin is stopped.

### DataSource
* Gradle dependencies: `implementation 'org.laxture:sbp-spring-boot-starter:3.2.23'`
* Gradle dependencies: `implementation 'org.laxture:sbp-spring-boot-starter:3.2.24'`
* by `SbpDataSourceConfigurer`
* Share data source from main `ApplicationContext` to plugin.
* It shared below resource from app to plugin
Expand All @@ -45,13 +45,13 @@ or raise an [issue](https://github.com/hank-cp/sbp/issues/new) to request a new
* Jooq DSLContext

### Jpa/Hibernate
* Gradle dependencies: `implementation 'org.laxture:sbp-spring-boot-jpa-tarter:3.2.23'`
* Gradle dependencies: `implementation 'org.laxture:sbp-spring-boot-jpa-tarter:3.2.24'`
* by `SbpJpaConfigurer`
* Plugin JPA entities will be registered to main `EntityManagerFactory` when plugin is started.
* Unregister plugin entiies when plugin is stopped.

### [SpringDoc-OpenApi](https://springdoc.org/v2/)
* Gradle dependencies: `implementation 'org.laxture:sbp-spring-boot-springdoc-tarter:3.2.23'`
* Gradle dependencies: `implementation 'org.laxture:sbp-spring-boot-springdoc-tarter:3.2.24'`
* by `SbpSpringDocConfigurer`
* Register plugin api doc when plugin is started.
* Unregister when plugin is stopped.
Expand Down Expand Up @@ -83,12 +83,12 @@ or raise an [issue](https://github.com/hank-cp/sbp/issues/new) to request a new
* [`@RouterOperation\@RouterOperations`](https://springdoc.org/v2/#spring-cloud-function-web-support) doesn't work for sbp.

### Thymeleaf
* Gradle dependencies: `implementation 'org.laxture:sbp-spring-boot-thymeleaf-starter:3.2.23'`
* Gradle dependencies: `implementation 'org.laxture:sbp-spring-boot-thymeleaf-starter:3.2.24'`
* by `SbpThymeleafConfigurer`
* To customize Thymeleaf configuration via application properties, you need to import <@link ThymeleafProperties> explicitly by `@Import(ThymeleafProperties.class)`

### Misc.
* Gradle dependencies: `implementation 'org.laxture:sbp-spring-boot-starter:3.2.23'`
* Gradle dependencies: `implementation 'org.laxture:sbp-spring-boot-starter:3.2.24'`
* by `SbpSharedServiceConfigurer`
* Services could be shared from main app to plugins

Expand Down
2 changes: 1 addition & 1 deletion docs/multi_spring_boot_versions.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ versions, and use micro part for sbp version.
|---------------------|-------------|-----|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| <= 2.4.x | 2.4.17 | 8+ | implementation "org.springframework.boot:spring-boot-starter-web:2.4.13"<br/>implementation "org.springframework.boot:spring-boot-starter-aop:2.4.13"<br/>implementation 'org.laxture:sbp-spring-boot-starter:2.4.17' |
| >= 2.5.x, < 3.x | 2.7.17 | 8+ | implementation "org.springframework.boot:spring-boot-starter-web:2.7.8"<br/>implementation "org.springframework.boot:spring-boot-starter-aop:2.7.8"<br/>implementation 'org.laxture:sbp-spring-boot-starter:2.7.17' |
| >= 3.x | 3.2.23 | 17+ | implementation "org.springframework.boot:spring-boot-starter-web:3.0.6"<br/>implementation "org.springframework.boot:spring-boot-starter-aop:3.0.6"<br/>implementation 'org.laxture:sbp-spring-boot-starter:3.0.18' |
| >= 3.x | 3.2.24 | 17+ | implementation "org.springframework.boot:spring-boot-starter-web:3.0.6"<br/>implementation "org.springframework.boot:spring-boot-starter-aop:3.0.6"<br/>implementation 'org.laxture:sbp-spring-boot-starter:3.0.18' |
| >= 3.x | -SNAPSHOT | 17+ | 'org.laxture:sbp-spring-boot-starter:-SNAPSHOT' |
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Wed, 10 Apr 2024 20:42:58 +0800
#Wed, 17 Apr 2024 12:29:19 +0800
org.gradle.daemon=true

systemProp.java.io.tmpdir=/tmp/sbp
Expand Down Expand Up @@ -27,4 +27,4 @@ jooqVersion=3.17.7
#springBootVersion_3.2=3.2.4
#jooqVersion=3.14.16

version=3.2.23
version=3.2.24
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ default String[] excludeConfigurations() {
* Hook of creating plugin ApplicationContext. Could import beans from main ApplicationContext
* or register extension to main ApplicationContext.
*
* Note that plugin ApplicationContext is not yet ready in this hook, use <@link #afterBootstrap> instead.
* Note that plugin ApplicationContext is not yet ready in this hook, use {@link #afterBootstrap} instead.
*/
default void onBootstrap(SpringBootstrap bootstrap,
GenericApplicationContext pluginApplicationContext) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,17 @@ public class SbpDataSourceConfigurer implements IPluginConfigurer {
@Override
public String[] excludeConfigurations() {
return new String[] {
// "org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration",
// "org.springframework.boot.autoconfigure.transaction.jta.JtaAutoConfiguration",
// "org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration"

"org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration",
"org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration",
"org.springframework.boot.autoconfigure.jdbc.JdbcTemplateAutoConfiguration",
"org.springframework.boot.autoconfigure.transaction.jta.JtaAutoConfiguration",
"org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration",
"org.springframework.boot.autoconfigure.cache.CacheAutoConfiguration",

// "org.springframework.boot.autoconfigure.cache.CacheAutoConfiguration",
// "org.springframework.boot.autoconfigure.jooq.JooqAutoConfiguration"
};
}
Expand All @@ -47,12 +52,21 @@ public void onBootstrap(SpringBootstrap bootstrap,
bootstrap.importBeanFromMainContext(pluginApplicationContext, "namedParameterJdbcTemplate");
// share MongoDbFactory
bootstrap.importBeanFromMainContext(pluginApplicationContext, "mongoDbFactory");
// share cacheManager
bootstrap.importBeanFromMainContext(pluginApplicationContext, "cacheManager");
// share redis
bootstrap.importBeanFromMainContext(pluginApplicationContext, "redisConnectionFactory");
// share Jooq
bootstrap.importBeanFromMainContext(pluginApplicationContext, "dataSourceConnectionProvider");
bootstrap.importBeanFromMainContext(pluginApplicationContext, "transactionProvider");
bootstrap.importBeanFromMainContext(pluginApplicationContext, "dslContext");
bootstrap.importBeanFromMainContext(pluginApplicationContext, "jooqConfiguration");

// // share dataSource
// bootstrap.importBeanFromMainContext(pluginApplicationContext, "dataSource");
// bootstrap.importBeanFromMainContext(pluginApplicationContext, "transactionManager");
// // share MongoDbFactory
// bootstrap.importBeanFromMainContext(pluginApplicationContext, "mongoDbFactory");
//
// bootstrap.importBeanFromMainContext(pluginApplicationContext, "redisConnectionFactory");
// bootstrap.importBeanFromMainContext(pluginApplicationContext, "dslContext");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
/**
* Plugin configurer for Thymeleaf.
* To customize Thymeleaf configuration via application properties,
* you need to import <@link ThymeleafProperties> explicitly by
* you need to import {@link ThymeleafProperties} explicitly by
* <code>@Import(ThymeleafProperties.class)</code>
*/
public class SbpThymeleafConfigurer implements IPluginConfigurer {
Expand Down

0 comments on commit f09075b

Please sign in to comment.