update Nacos by using the Spring cloud version (#225)

This commit is contained in:
zhong-jie
2021-06-08 14:29:27 +08:00
committed by GitHub
parent edc0df6db3
commit 3282bae017
41 changed files with 654 additions and 326 deletions

View File

@@ -16,7 +16,6 @@
*/
package we;
import com.alibaba.nacos.spring.context.annotation.config.NacosPropertySource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
@@ -180,7 +179,6 @@ import we.log.LogSendAppender;
QuartzAutoConfiguration.class
}
)
@NacosPropertySource(dataId = "${nacos.config.data-id}", groupId = "${nacos.config.group}", autoRefreshed = true)
@EnableDiscoveryClient
public class FizzBootstrapApplication {
private static final Logger LOGGER = LoggerFactory.getLogger(FizzBootstrapApplication.class);

View File

@@ -12,30 +12,6 @@ apollo:
enabled: false #use Apollo?
################################################### Apollo config end ###################################################
# if you do not use Nacos, ignore the follow config
################################################## Nacos config start ###################################################
nacos:
config:
# if use Nacos config set this flag to true
enabled: false #use Nacos Config? (default:false)
# need replace
server-addr: localhost:8848 #please input the nacos config server-addr (default:localhost:8848)
auto-refresh: true
group: fizz-gateway #please input the nacos config group (default:fizz-gateway)
data-id: application #please input the nacos config data-id (default:application)
type: PROPERTIES #please input the nacos config type (default:PROPERTIES)
# need replace
namespace: null #please input the nacos config type (default:null)
discovery:
# if use Nacos discovery set this flag to true
enabled: false #use Nacos Discovery? (default:false)
# need replace
server-addr: localhost:8848 #please input the nacos discovery server-addr (default:localhost:8848)
auto-register: true
register:
group-name: fizz-gateway #please input the nacos discovery register group-name (default:fizz-gateway)
################################################### Nacos config end ####################################################
# if you do not use Eureka, ignore the follow config
################################################## Eureka config start ##################################################
eureka:
@@ -62,6 +38,14 @@ spring:
loadbalancer:
ribbon:
enabled: false
nacos:
discovery:
# if use Nacos discovery set this flag to true
enabled: false #use Nacos Discovery? (default:false)
# need replace
server-addr: localhost:8848 #please input the nacos discovery server-addr (default:localhost:8848)
namespace: null #please input the nacos config type (default:null)
group: fizz-gateway #please input the nacos discovery register group (default:fizz-gateway)
aggregate:
redis:

View File

@@ -0,0 +1,15 @@
spring:
cloud:
nacos:
config:
# if use Nacos config set this flag to true
enabled: false #use Nacos Config? (default:false)
# need replace
server-addr: localhost:8848 #please input the nacos config server-addr (default:localhost:8848)
namespace: null #please input the nacos config type (default:null)
group: fizz-gateway #please input the nacos config group (default:fizz-gateway)
prefix: application #please input the nacos config data-id (default:application)
extension-configs[0]:
refresh: true
data-id: ${spring.cloud.nacos.config.prefix}
group: ${spring.cloud.nacos.config.group}

View File

@@ -17,6 +17,8 @@
<AppenderRef ref="Console" />
<AppenderRef ref="LogSend" />
</Root>
<!-- suppress the warn 'No URLs will be polled as dynamic configuration sources.' -->
<logger name="com.netflix.config.sources.URLConfigurationSource" level="ERROR"/>
<Logger name="we" level="warn" additivity="false" />
</Loggers>
</Configuration>