Commit 354ac400742e68c50db4c3f64ad0d3b6e8b93980
1 parent
f4dcb57c
1.本地如果没有kafka环境,将kafka.use设置为false
Showing
5 changed files
with
33 additions
and
66 deletions
src/main/java/com/bsth/message/handler/MessageHandler.java
| ... | ... | @@ -6,6 +6,7 @@ import com.bsth.message.entity.CarErrorStop; |
| 6 | 6 | import com.bsth.websocket.handler.SendUtils; |
| 7 | 7 | import com.fasterxml.jackson.databind.ObjectMapper; |
| 8 | 8 | import org.springframework.beans.factory.annotation.Autowired; |
| 9 | +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; | |
| 9 | 10 | import org.springframework.kafka.annotation.KafkaListener; |
| 10 | 11 | import org.springframework.messaging.Message; |
| 11 | 12 | import org.springframework.stereotype.Component; |
| ... | ... | @@ -17,6 +18,7 @@ import java.util.List; |
| 17 | 18 | * @author Hill |
| 18 | 19 | */ |
| 19 | 20 | @Component |
| 21 | +@ConditionalOnProperty("kafka.use") | |
| 20 | 22 | public class MessageHandler { |
| 21 | 23 | |
| 22 | 24 | @Autowired | ... | ... |
src/main/resources/application-cloud.properties
| ... | ... | @@ -13,7 +13,7 @@ spring.jpa.show-sql= false |
| 13 | 13 | |
| 14 | 14 | #DATABASE |
| 15 | 15 | spring.datasource.driver-class-name= com.mysql.jdbc.Driver |
| 16 | -spring.datasource.url= jdbc:mysql://192.170.100.132/control?useUnicode=true&characterEncoding=utf-8&useSSL=false | |
| 16 | +spring.datasource.url= jdbc:mysql://192.168.168.241/pd_control?useUnicode=true&characterEncoding=utf-8&useSSL=false | |
| 17 | 17 | spring.datasource.username= root |
| 18 | 18 | spring.datasource.password= root2jsp |
| 19 | 19 | spring.datasource.type= com.zaxxer.hikari.HikariDataSource |
| ... | ... | @@ -30,7 +30,8 @@ spring.datasource.hikari.connection-test-query= SELECT 1 |
| 30 | 30 | spring.datasource.hikari.validation-timeout= 3000 |
| 31 | 31 | spring.datasource.hikari.register-mbeans=true |
| 32 | 32 | |
| 33 | -spring.kafka.consumer.bootstrap-servers= localhost:9092 | |
| 33 | +kafka.use= true | |
| 34 | +spring.kafka.consumer.bootstrap-servers= 192.170.100.114:9092,192.170.100.114:9093,192.170.100.114:9094 | |
| 34 | 35 | spring.kafka.consumer.group-id= schedule-system |
| 35 | 36 | spring.kafka.consumer.auto-offset-reset= latest |
| 36 | 37 | spring.kafka.consumer.key-deserializer= org.apache.kafka.common.serialization.StringDeserializer | ... | ... |
src/main/resources/application-dev.properties
| ... | ... | @@ -37,6 +37,13 @@ spring.datasource.hikari.connection-test-query= SELECT 1 |
| 37 | 37 | spring.datasource.hikari.validation-timeout= 3000 |
| 38 | 38 | spring.datasource.hikari.register-mbeans=true |
| 39 | 39 | |
| 40 | +kafka.use= false | |
| 41 | +spring.kafka.consumer.bootstrap-servers= localhost:9092 | |
| 42 | +spring.kafka.consumer.group-id= schedule-system | |
| 43 | +spring.kafka.consumer.auto-offset-reset= latest | |
| 44 | +spring.kafka.consumer.key-deserializer= org.apache.kafka.common.serialization.StringDeserializer | |
| 45 | +spring.kafka.consumer.value-deserializer= org.apache.kafka.common.serialization.StringDeserializer | |
| 46 | + | |
| 40 | 47 | ## gps client data |
| 41 | 48 | http.gps.real.cache.url= http://10.10.150.24:12580/realGps/all |
| 42 | 49 | ## gateway real data |
| ... | ... | @@ -57,4 +64,10 @@ cp.ack.url= http://114.80.178.12:8778/prod-api/serverApi/instructionsIssue/confi |
| 57 | 64 | ## admin mail |
| 58 | 65 | admin.mail= 3090342880@qq.com |
| 59 | 66 | ## enabled |
| 60 | -enabled.whiteip= true | |
| 61 | 67 | \ No newline at end of file |
| 68 | +enabled.whiteip= true | |
| 69 | + | |
| 70 | +sso.enabled= false | |
| 71 | +sso.systemcode = SYS0019 | |
| 72 | +sso.http.url.login= http://180.169.154.251:28090/portal/index.html#/login | |
| 73 | +sso.http.url.logout= http://180.169.154.251:18080/information/api/v1/logout | |
| 74 | +sso.http.url.auth= http://180.169.154.251:18080/information/authenticate/authorityAuthentication | |
| 62 | 75 | \ No newline at end of file | ... | ... |
src/main/resources/application-prod.properties deleted
100644 → 0
| 1 | -server.port=9088 | |
| 2 | - | |
| 3 | -# dubbo����ʹ�ÿ���flag | |
| 4 | -dubbo.use=false | |
| 5 | - | |
| 6 | -#JPA | |
| 7 | -spring.jpa.hibernate.ddl-auto= none | |
| 8 | -spring.jpa.hibernate.naming.implicit-strategy=org.hibernate.boot.model.naming.ImplicitNamingStrategyLegacyHbmImpl | |
| 9 | -spring.jpa.hibernate.naming.physical-strategy=org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy | |
| 10 | -spring.jpa.database= MYSQL | |
| 11 | -spring.jpa.properties.hibernate.enable_lazy_load_no_trans=true | |
| 12 | -spring.jpa.show-sql= false | |
| 13 | - | |
| 14 | -#DATABASE | |
| 15 | -spring.datasource.driver-class-name= com.mysql.jdbc.Driver | |
| 16 | -spring.datasource.url= jdbc:mysql://10.10.200.121:3306/control?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai | |
| 17 | -spring.datasource.username= root | |
| 18 | -spring.datasource.password= root2jsp | |
| 19 | -spring.datasource.type= com.zaxxer.hikari.HikariDataSource | |
| 20 | - | |
| 21 | -#DATASOURCE SETTING | |
| 22 | -spring.datasource.hikari.minimum-idle= 8 | |
| 23 | -spring.datasource.hikari.maximum-pool-size= 100 | |
| 24 | -#spring.datasource.hikari.auto-commit= true | |
| 25 | -spring.datasource.hikari.idle-timeout= 60000 | |
| 26 | -#spring.datasource.hikari.pool-name= HikariPool | |
| 27 | -spring.datasource.hikari.max-lifetime= 1800000 | |
| 28 | -spring.datasource.hikari.connection-timeout= 3000 | |
| 29 | -spring.datasource.hikari.connection-test-query= SELECT 1 | |
| 30 | -spring.datasource.hikari.validation-timeout= 3000 | |
| 31 | -spring.datasource.hikari.register-mbeans=true | |
| 32 | - | |
| 33 | -## gps client data | |
| 34 | -http.gps.real.cache.url= http://10.10.150.24:12580/realGps/all | |
| 35 | -## gateway real data | |
| 36 | -http.gps.real.url= http://10.10.200.79:8080/transport_server/rtgps/ | |
| 37 | -## gateway send directive | |
| 38 | -http.send.directive= http://10.10.200.79:8080/transport_server/message/ | |
| 39 | -## rfid data | |
| 40 | -http.rfid.url= http://10.10.200.82:9000/rfid | |
| 41 | -## wxsb | |
| 42 | -#http.report.url.05= http://192.168.168.154:8088/ygjwsystem_j2ee/clbx/clbx_dd.do | |
| 43 | -#http.report.url.22= http://192.168.168.154:8088/jgjwsystem_j2ee/clbx/clbx_dd.do | |
| 44 | -#http.report.url.26= http://192.168.168.154:8088/nhjwsystem_j2ee/clbx/clbx_dd.do | |
| 45 | -#http.report.url.55= http://192.168.168.154:8088/snjwsystem_j2ee/clbx/clbx_dd.do | |
| 46 | -http.report.url.05= http://116.228.197.222:8081/ygjwsystem_j2ee/clbx/clbx_dd.do | |
| 47 | -http.report.url.22= http://116.247.73.122:9098/jgjwsystem_j2ee/clbx/clbx_dd.do | |
| 48 | -http.report.url.26= http://116.236.141.34:8088/nhjwsystem_j2ee/clbx/clbx_dd.do | |
| 49 | -http.report.url.55= http://180.168.216.248:8088/snjwsystem_j2ee/clbx/clbx_dd.do | |
| 50 | -## http ticketing interface | |
| 51 | -http.ticketing.interface= http://112.64.187.3:1080/gjService/request | |
| 52 | -http.mtplan.interface= https://112.64.45.51/wxk-prod-api/service-api/pdgj/schedule/byinfo | |
| 53 | -## first last generate | |
| 54 | -ms.fl.generate=true | |
| 55 | -## dsm ack interface | |
| 56 | -dsm.ack.url= http://211.95.61.66:9008/modules/dsmCheckTheRecord/addDsm? | |
| 57 | -## cp ack interface | |
| 58 | -cp.ack.url= http://114.80.178.12:8778/prod-api/serverApi/instructionsIssue/confirm/ | |
| 59 | -## admin mail | |
| 60 | -admin.mail= 3090342880@qq.com | |
| 61 | -## enabled | |
| 62 | -enabled.whiteip= true | |
| 63 | 0 | \ No newline at end of file |
src/main/resources/application-test.properties
| ... | ... | @@ -30,6 +30,13 @@ spring.datasource.hikari.connection-test-query= SELECT 1 |
| 30 | 30 | spring.datasource.hikari.validation-timeout= 3000 |
| 31 | 31 | spring.datasource.hikari.register-mbeans=true |
| 32 | 32 | |
| 33 | +kafka.use= true | |
| 34 | +spring.kafka.consumer.bootstrap-servers= 192.170.100.114:9092,192.170.100.114:9093,192.170.100.114:9094 | |
| 35 | +spring.kafka.consumer.group-id= schedule-system | |
| 36 | +spring.kafka.consumer.auto-offset-reset= latest | |
| 37 | +spring.kafka.consumer.key-deserializer= org.apache.kafka.common.serialization.StringDeserializer | |
| 38 | +spring.kafka.consumer.value-deserializer= org.apache.kafka.common.serialization.StringDeserializer | |
| 39 | + | |
| 33 | 40 | ## gps client data |
| 34 | 41 | http.gps.real.cache.url= http://10.10.150.24:12580/realGps/all |
| 35 | 42 | ## gateway real data |
| ... | ... | @@ -55,4 +62,10 @@ cp.ack.url= http://114.80.178.12:8778/prod-api/serverApi/instructionsIssue/confi |
| 55 | 62 | ## admin mail |
| 56 | 63 | admin.mail= 3090342880@qq.com |
| 57 | 64 | ## enabled |
| 58 | -enabled.whiteip= false | |
| 59 | 65 | \ No newline at end of file |
| 66 | +enabled.whiteip= false | |
| 67 | + | |
| 68 | +sso.enabled= false | |
| 69 | +sso.systemcode = SYS0019 | |
| 70 | +sso.http.url.login= http://180.169.154.251:28090/portal/index.html#/login | |
| 71 | +sso.http.url.logout= http://180.169.154.251:18080/information/api/v1/logout | |
| 72 | +sso.http.url.auth= http://180.169.154.251:18080/information/authenticate/authorityAuthentication | |
| 60 | 73 | \ No newline at end of file | ... | ... |