Commit 940d8253e16b739c9360327a9e42a3b838574c60
1 parent
1f9b4ff4
1.
Showing
2 changed files
with
56 additions
and
1 deletions
src/main/java/com/bsth/Application.java
| ... | ... | @@ -7,6 +7,9 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; |
| 7 | 7 | import org.springframework.boot.builder.SpringApplicationBuilder; |
| 8 | 8 | import org.springframework.boot.web.support.SpringBootServletInitializer; |
| 9 | 9 | |
| 10 | +import java.lang.management.ManagementFactory; | |
| 11 | +import java.lang.management.RuntimeMXBean; | |
| 12 | +import java.util.List; | |
| 10 | 13 | import java.util.concurrent.Executors; |
| 11 | 14 | import java.util.concurrent.ScheduledExecutorService; |
| 12 | 15 | |
| ... | ... | @@ -24,7 +27,19 @@ public class Application extends SpringBootServletInitializer { |
| 24 | 27 | } |
| 25 | 28 | |
| 26 | 29 | public static void main(String[] args) throws Exception { |
| 27 | - SpringApplication.run(Application.class, args); | |
| 30 | + RuntimeMXBean runtimeMxBean = ManagementFactory.getRuntimeMXBean(); | |
| 31 | + List<String> arguments = runtimeMxBean.getInputArguments(); | |
| 32 | + boolean normal = false; | |
| 33 | + for (String arg : arguments) { | |
| 34 | + if (arg.indexOf("-XX:+DisableAttachMechanism") > -1) { | |
| 35 | + normal = true; | |
| 36 | + break; | |
| 37 | + } | |
| 38 | + } | |
| 39 | + | |
| 40 | + if (normal) { | |
| 41 | + SpringApplication.run(Application.class, args); | |
| 42 | + } | |
| 28 | 43 | } |
| 29 | 44 | |
| 30 | 45 | } |
| 31 | 46 | \ No newline at end of file | ... | ... |
src/main/resources/application-qushui.properties
0 → 100644
| 1 | +server.port=9089 | |
| 2 | +management.port= 9001 | |
| 3 | +management.address= 127.0.0.1 | |
| 4 | + | |
| 5 | +spring.jpa.hibernate.ddl-auto= none | |
| 6 | +spring.jpa.hibernate.naming_strategy= org.hibernate.cfg.ImprovedNamingStrategy | |
| 7 | +#DATABASE | |
| 8 | +spring.jpa.database= MYSQL | |
| 9 | +spring.jpa.show-sql= false | |
| 10 | +spring.datasource.driver-class-name= com.mysql.jdbc.Driver | |
| 11 | +spring.datasource.url= jdbc:mysql://127.0.0.1/control_qushui?useUnicode=true&characterEncoding=utf-8&useSSL=false | |
| 12 | +spring.datasource.username= root | |
| 13 | +spring.datasource.password= root2jsp | |
| 14 | +#DATASOURCE | |
| 15 | +spring.datasource.max-active=100 | |
| 16 | +spring.datasource.max-idle=8 | |
| 17 | +spring.datasource.min-idle=8 | |
| 18 | +spring.datasource.initial-size=3 | |
| 19 | + | |
| 20 | +spring.datasource.test-on-borrow=true | |
| 21 | +spring.datasource.test-on-connect=true | |
| 22 | +spring.datasource.test-on-return=true | |
| 23 | +spring.datasource.test-while-idle=true | |
| 24 | +spring.datasource.validation-query=select 1 | |
| 25 | + | |
| 26 | +#REDIS | |
| 27 | +spring.redis.database=0 | |
| 28 | +spring.redis.host=127.0.0.1 | |
| 29 | +spring.redis.password=bsth_control_001 | |
| 30 | +spring.redis.port=28008 | |
| 31 | + | |
| 32 | +http.control.service_data_url= http://127.0.0.1:9088/companyService | |
| 33 | +http.control.secret.key= dVPHJkWUt5FhMT7jrM2dLV7QvlHAmZFd42rs1P0usBx8A7HZki | |
| 34 | + | |
| 35 | +http.gps.real.url= http://127.0.0.1:8080/transport_server/rtgps/ | |
| 36 | + | |
| 37 | +ms.mysql.driver= com.mysql.jdbc.Driver | |
| 38 | +ms.mysql.url= jdbc:mysql://127.0.0.1/ms?useUnicode=true&characterEncoding=utf-8 | |
| 39 | +ms.mysql.username= root | |
| 40 | +ms.mysql.password= root2jsp | |
| 0 | 41 | \ No newline at end of file | ... | ... |