-
-
Notifications
You must be signed in to change notification settings - Fork 10.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
apollo assembly optimization (#5035)
* table prefix * assembly config v0.1 * assembly config v0.2 * assembly db init * assembly db init fix * assembly sql * WebSecurity * H2Function * assembly profile * assembly session * ddl-auto=none * DataSource * doc * admin assembly profile * copy assembly sql on build * merge sql conflict * sql comment * sql converter * sql converter delta * sql converter clean * fix assembly sql * fix assembly sql temp * fix assembly sql temp v0.2 * fix assembly sql temp v0.3 * fix assembly sql temp v0.4 * fix assembly sql temp v0.5 * assembly doc * autoGeneratedDeclaration * rename sql-converter module * sql-converter h2 * fix database-discovery * mv sql * mv sql v0.2 * mv sql v0.3 * multi datasource * remove table prefix * update doc * fix init * log apollo datasource initialize * fix apollo datasource initialize * mv h2 sql * fix apollo datasource initialize v0.2 * clean import * fix sql check * fix sql check v0.2 * merge sql * merge sql generated * add sql test temp * add sql test temp 2 * add sql test * sql convert * fix sql-convert * CHANGES.md * fix copyright * clean logger * fix order * fix h2 converter * fix h2 converter v0.2 * fix order v0.2 --------- Co-authored-by: Jason Song <[email protected]>
- Loading branch information
Showing
107 changed files
with
7,902 additions
and
442 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
.../main/java/com/ctrip/framework/apollo/adminservice/AdminServiceAssemblyConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* Copyright 2024 Apollo Authors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
*/ | ||
package com.ctrip.framework.apollo.adminservice; | ||
|
||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.context.annotation.Profile; | ||
import org.springframework.core.annotation.Order; | ||
import org.springframework.security.config.annotation.web.builders.HttpSecurity; | ||
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; | ||
|
||
@Profile("assembly") | ||
@Configuration | ||
public class AdminServiceAssemblyConfiguration { | ||
|
||
@Order(101) | ||
@Configuration | ||
static class AdminServiceSecurityConfigurer extends WebSecurityConfigurerAdapter { | ||
|
||
@Override | ||
protected void configure(HttpSecurity http) throws Exception { | ||
http.csrf().disable(); | ||
http.httpBasic(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
apollo-assembly/src/main/resources/application-database-discovery.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# | ||
# Copyright 2024 Apollo Authors | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
apollo.eureka.server.enabled=false | ||
eureka.client.enabled=false | ||
spring.cloud.discovery.enabled=false | ||
|
||
apollo.service.registry.enabled=true | ||
apollo.service.registry.cluster=default | ||
apollo.service.registry.heartbeatIntervalInSecond=10 | ||
|
||
apollo.service.discovery.enabled=true | ||
# health check by heartbeat, heartbeat time before 61s ago will be seemed as unhealthy | ||
apollo.service.discovery.healthCheckIntervalInSecond = 61 |
47 changes: 47 additions & 0 deletions
47
apollo-assembly/src/main/resources/application-github.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# | ||
# Copyright 2024 Apollo Authors | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
# Config DataSource | ||
spring.config-datasource.url=jdbc:h2:mem:~/apollo-config-db;mode=mysql;DB_CLOSE_ON_EXIT=FALSE;DB_CLOSE_DELAY=-1;BUILTIN_ALIAS_OVERRIDE=TRUE;DATABASE_TO_UPPER=FALSE | ||
#spring.config-datasource.username= | ||
#spring.config-datasource.password= | ||
spring.sql.config-init.schema-locations=@@repository@@/profiles/@@platform@@@@suffix@@/apolloconfigdb.sql | ||
spring.sql.config-init.mode=embedded | ||
# Portal DataSource | ||
spring.portal-datasource.url=jdbc:h2:mem:~/apollo-portal-db;mode=mysql;DB_CLOSE_ON_EXIT=FALSE;DB_CLOSE_DELAY=-1;BUILTIN_ALIAS_OVERRIDE=TRUE;DATABASE_TO_UPPER=FALSE | ||
#spring.portal-datasource.username= | ||
#spring.portal-datasource.password= | ||
spring.sql.portal-init.schema-locations=@@repository@@/profiles/@@platform@@@@suffix@@/apolloportaldb.sql | ||
spring.sql.portal-init.mode=embedded | ||
|
||
# Resolve Multi DataSource JMX name conflict | ||
spring.jmx.unique-names=true | ||
|
||
# H2 datasource | ||
spring.jpa.hibernate.ddl-auto=none | ||
spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl | ||
spring.jpa.properties.hibernate.show_sql=false | ||
spring.jpa.properties.hibernate.metadata_builder_contributor=com.ctrip.framework.apollo.common.jpa.SqlFunctionsMetadataBuilderContributor | ||
spring.h2.console.enabled=true | ||
spring.h2.console.settings.web-allow-others=true | ||
|
||
# Sql logging | ||
#logging.level.org.hibernate.SQL=DEBUG | ||
|
||
# Default env | ||
apollo.portal.envs=local | ||
|
||
# Spring session | ||
spring.session.store-type=none |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/ApolloBizAssemblyConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* Copyright 2024 Apollo Authors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
*/ | ||
package com.ctrip.framework.apollo.biz; | ||
|
||
import org.springframework.boot.autoconfigure.jdbc.DataSourceProperties; | ||
import org.springframework.boot.context.properties.ConfigurationProperties; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.context.annotation.Primary; | ||
import org.springframework.context.annotation.Profile; | ||
|
||
@Profile("assembly") | ||
@Configuration | ||
public class ApolloBizAssemblyConfiguration { | ||
|
||
@Primary | ||
@ConfigurationProperties(prefix = "spring.config-datasource") | ||
@Bean | ||
public static DataSourceProperties dataSourceProperties() { | ||
return new DataSourceProperties(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.