Skip to content

Commit

Permalink
fix ci check error
Browse files Browse the repository at this point in the history
  • Loading branch information
xwm1992 committed Aug 29, 2023
1 parent c53272e commit 4388abe
Show file tree
Hide file tree
Showing 15 changed files with 40 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,17 +78,17 @@ public class CommonConfiguration {
@ConfigFiled(field = "security.validation.type.token", notEmpty = true)
private boolean eventMeshSecurityValidateTypeToken = false;

@ConfigFiled(field = "registry.plugin.username")
private String eventMeshRegistryPluginUsername = "";
@ConfigFiled(field = "metaStorage.plugin.username")
private String eventMeshMetaStoragePluginUsername = "";

@ConfigFiled(field = "registry.plugin.password")
private String eventMeshRegistryPluginPassword = "";
@ConfigFiled(field = "metaStorage.plugin.password")
private String eventMeshMetaStoragePluginPassword = "";

@ConfigFiled(field = "server.registry.registerIntervalInMills")
private Integer eventMeshRegisterIntervalInMills = 10 * 1000;
@ConfigFiled(field = "server.metaStorage.metaStorageIntervalInMills")
private Integer eventMeshMetaStorageIntervalInMills = 10 * 1000;

@ConfigFiled(field = "server.registry.fetchRegistryAddrIntervalInMills")
private Integer eventMeshFetchRegistryAddrInterval = 10 * 1000;
@ConfigFiled(field = "server.metaStorage.fetchMetaStorageAddrIntervalInMills")
private Integer eventMeshFetchMetaStorageAddrInterval = 10 * 1000;


@ConfigFiled(field = "server.trace.enabled")
Expand All @@ -97,8 +97,8 @@ public class CommonConfiguration {
@ConfigFiled(field = "server.security.enabled")
private boolean eventMeshServerSecurityEnable = false;

@ConfigFiled(field = "server.registry.enabled")
private boolean eventMeshServerRegistryEnable = false;
@ConfigFiled(field = "server.metaStorage.enabled")
private boolean eventMeshServerMetaStorageEnable = false;

@ConfigFiled(field = "security.publickey")
private String eventMeshSecurityPublickey = "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ public void testGetCommonConfiguration() {
Assert.assertEquals("storage-succeed!!!", config.getEventMeshStoragePluginType());
Assert.assertEquals("storage-succeed!!!", config.getEventMeshStoragePluginType());
Assert.assertEquals("security-succeed!!!", config.getEventMeshSecurityPluginType());
Assert.assertEquals("registry-succeed!!!", config.getEventMeshMetaStoragePluginType());
Assert.assertEquals("metaStorage-succeed!!!", config.getEventMeshMetaStoragePluginType());
Assert.assertEquals("trace-succeed!!!", config.getEventMeshTracePluginType());
Assert.assertEquals("hostIp-succeed!!!", config.getEventMeshServerIp());
Assert.assertEquals("username-succeed!!!", config.getEventMeshRegistryPluginUsername());
Assert.assertEquals("password-succeed!!!", config.getEventMeshRegistryPluginPassword());
Assert.assertEquals("username-succeed!!!", config.getEventMeshMetaStoragePluginUsername());
Assert.assertEquals("password-succeed!!!", config.getEventMeshMetaStoragePluginPassword());

Assert.assertEquals(Integer.valueOf(816), config.getEventMeshRegisterIntervalInMills());
Assert.assertEquals(Integer.valueOf(1816), config.getEventMeshFetchRegistryAddrInterval());
Assert.assertEquals(Integer.valueOf(816), config.getEventMeshMetaStorageIntervalInMills());
Assert.assertEquals(Integer.valueOf(1816), config.getEventMeshFetchMetaStorageAddrInterval());

List<String> list = new ArrayList<>();
list.add("metrics-succeed1!!!");
Expand All @@ -71,7 +71,7 @@ public void testGetCommonConfiguration() {
Assert.assertEquals(list1, config.getEventMeshProvideServerProtocols());

Assert.assertTrue(config.isEventMeshServerSecurityEnable());
Assert.assertTrue(config.isEventMeshServerRegistryEnable());
Assert.assertTrue(config.isEventMeshServerMetaStorageEnable());
Assert.assertTrue(config.isEventMeshServerTraceEnable());

Assert.assertEquals("eventmesh.idc-succeed!!!", config.getEventMeshWebhookOrigin());
Expand Down
4 changes: 2 additions & 2 deletions eventmesh-common/src/test/resources/configuration.properties
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ eventMesh.storage.plugin.type=storage-succeed!!!
eventMesh.security.plugin.type=security-succeed!!!
eventMesh.metaStorage.plugin.type=metaStorage-succeed!!!
eventMesh.trace.plugin=trace-succeed!!!
eventMesh.server.metaStorage.registerIntervalInMills=816
eventMesh.server.metaStorage.fetchRegistryAddrIntervalInMills=1816
eventMesh.server.metaStorage.metaStorageIntervalInMills=816
eventMesh.server.metaStorage.fetchMetaStorageAddrIntervalInMills=1816
eventMesh.metrics.plugin=metrics-succeed1!!!,metrics-succeed2!!!,metrics-succeed3!!!
eventMesh.metaStorage.plugin.server-addr=server-addr-succeed1!!!

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ public void init() throws MetaException {
throw new MetaException("namesrvAddr cannot be null");
}
this.serverAddr = commonConfiguration.getNamesrvAddr();
this.username = commonConfiguration.getEventMeshRegistryPluginUsername();
this.password = commonConfiguration.getEventMeshRegistryPluginPassword();
this.username = commonConfiguration.getEventMeshMetaStoragePluginUsername();
this.password = commonConfiguration.getEventMeshMetaStoragePluginPassword();
break;
}
etcdRegistryMonitorExecutorService = ThreadPoolFactory.createSingleScheduledExecutor(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ public void init() throws MetaException {
}

this.serverAddr = commonConfiguration.getNamesrvAddr();
this.username = commonConfiguration.getEventMeshRegistryPluginUsername();
this.password = commonConfiguration.getEventMeshRegistryPluginPassword();
this.username = commonConfiguration.getEventMeshMetaStoragePluginUsername();
this.password = commonConfiguration.getEventMeshMetaStoragePluginPassword();
break;
}
ConfigService configService = ConfigService.getInstance();
Expand Down
4 changes: 2 additions & 2 deletions eventmesh-runtime/conf/eventmesh.properties
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ eventMesh.server.retry.pushRetryQueueSize=10000
#admin
eventMesh.server.admin.http.port=10106
#metaStorage
eventMesh.server.metaStorage.registerIntervalInMills=10000
eventMesh.server.metaStorage.fetchRegistryAddrIntervalInMills=20000
eventMesh.server.metaStorage.metaStorageIntervalInMills=10000
eventMesh.server.metaStorage.fetchMetaStorageAddrIntervalInMills=20000
#auto-ack
#eventMesh.server.defibus.client.comsumeTimeoutInMin=5

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ void get(HttpExchange httpExchange) throws IOException {
eventMeshTCPConfiguration.getEventMeshName(),
eventMeshTCPConfiguration.getEventMeshWebhookOrigin(),
eventMeshTCPConfiguration.isEventMeshServerSecurityEnable(),
eventMeshTCPConfiguration.isEventMeshServerRegistryEnable(),
eventMeshTCPConfiguration.isEventMeshServerMetaStorageEnable(),
// TCP Configuration
eventMeshTCPConfiguration.getEventMeshTcpServerPort(),
// HTTP Configuration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public QueryRecommendEventMeshHandler(EventMeshTCPServer eventMeshTCPServer, Htt
public void handle(HttpExchange httpExchange) throws IOException {
String result = "";
try (OutputStream out = httpExchange.getResponseBody()) {
if (!eventMeshTCPServer.getEventMeshTCPConfiguration().isEventMeshServerRegistryEnable()) {
if (!eventMeshTCPServer.getEventMeshTCPConfiguration().isEventMeshServerMetaStorageEnable()) {
throw new Exception("registry enable config is false, not support");
}
String queryString = httpExchange.getRequestURI().getQuery();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public void start() throws Exception {
grpcRetryer.start();
server.start();

if (eventMeshGrpcConfiguration.isEventMeshServerRegistryEnable()) {
if (eventMeshGrpcConfiguration.isEventMeshServerMetaStorageEnable()) {
this.register();
}

Expand All @@ -162,7 +162,7 @@ public void shutdown() throws Exception {

server.shutdown();

if (eventMeshGrpcConfiguration.isEventMeshServerRegistryEnable()) {
if (eventMeshGrpcConfiguration.isEventMeshServerMetaStorageEnable()) {
this.unRegister();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public void start() throws Exception {
producerManager.start();
httpRetryer.start();

if (eventMeshHttpConfiguration.isEventMeshServerRegistryEnable()) {
if (eventMeshHttpConfiguration.isEventMeshServerMetaStorageEnable()) {
this.register();
}
if (log.isInfoEnabled()) {
Expand All @@ -185,7 +185,7 @@ public void shutdown() throws Exception {

httpRetryer.shutdown();

if (eventMeshHttpConfiguration.isEventMeshServerRegistryEnable()) {
if (eventMeshHttpConfiguration.isEventMeshServerMetaStorageEnable()) {
this.unRegister();
}
if (log.isInfoEnabled()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public void init() throws Exception {
if (configuration.isEventMeshServerSecurityEnable()) {
acl.init();
}
if (configuration.isEventMeshServerRegistryEnable()) {
if (configuration.isEventMeshServerMetaStorageEnable()) {
metaStorage.init();
}
if (configuration.isEventMeshServerTraceEnable()) {
Expand Down Expand Up @@ -156,7 +156,7 @@ public void start() throws Exception {
acl.start();
}
// registry start
if (configuration.isEventMeshServerRegistryEnable()) {
if (configuration.isEventMeshServerMetaStorageEnable()) {
metaStorage.start();
}
}
Expand Down Expand Up @@ -186,7 +186,7 @@ public void shutdown() throws Exception {
eventMeshBootstrap.shutdown();
}

if (configuration != null && configuration.isEventMeshServerRegistryEnable()) {
if (configuration != null && configuration.isEventMeshServerMetaStorageEnable()) {
metaStorage.shutdown();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public void init() throws Exception {
super.setEventMeshTcpMonitor(new EventMeshTcpMonitor(this, metricsRegistries));
super.getEventMeshTcpMonitor().init();

if (eventMeshTCPConfiguration.isEventMeshServerRegistryEnable()) {
if (eventMeshTCPConfiguration.isEventMeshServerMetaStorageEnable()) {
eventMeshRebalanceService = new EventMeshRebalanceService(this, new EventMeshRebalanceImpl(this));
eventMeshRebalanceService.init();
}
Expand All @@ -138,7 +138,7 @@ public void start() throws Exception {
clientSessionGroupMapping.start();
tcpRetryer.start();

if (eventMeshTCPConfiguration.isEventMeshServerRegistryEnable()) {
if (eventMeshTCPConfiguration.isEventMeshServerMetaStorageEnable()) {
this.register();
eventMeshRebalanceService.start();
}
Expand All @@ -159,7 +159,7 @@ public void shutdown() throws Exception {

tcpRetryer.shutdown();

if (eventMeshTCPConfiguration.isEventMeshServerRegistryEnable()) {
if (eventMeshTCPConfiguration.isEventMeshServerMetaStorageEnable()) {
eventMeshRebalanceService.shutdown();
this.unRegister();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public AbstractEventProcessor(EventMeshHTTPServer eventMeshHTTPServer) {
* Add a topic with subscribers to the service's metadata.
*/
protected void updateMetadata() {
if (!eventMeshHTTPServer.getEventMeshHttpConfiguration().isEventMeshServerRegistryEnable()) {
if (!eventMeshHTTPServer.getEventMeshHttpConfiguration().isEventMeshServerMetaStorageEnable()) {
return;
}

Expand Down Expand Up @@ -122,7 +122,7 @@ protected String getTargetMesh(String consumerGroup, List<SubscriptionItem> subs
throws Exception {
// Currently only supports http
CommonConfiguration httpConfiguration = eventMeshHTTPServer.getEventMeshHttpConfiguration();
if (!httpConfiguration.isEventMeshServerRegistryEnable()) {
if (!httpConfiguration.isEventMeshServerMetaStorageEnable()) {
return "";
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public void start() {
synchronized (ProducerTopicManager.class) {
scheduledTask = scheduler.scheduleAtFixedRate(() -> {
try {
if (!eventMeshServer.getConfiguration().isEventMeshServerRegistryEnable()) {
if (!eventMeshServer.getConfiguration().isEventMeshServerMetaStorageEnable()) {
return;
}
List<EventMeshServicePubTopicInfo> pubTopicInfoList = eventMeshServer.getMetaStorage().findEventMeshServicePubTopicInfos();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public void process(final Package pkg, final ChannelHandlerContext ctx, long sta
long taskExecuteTime = System.currentTimeMillis();
Package res = new Package();
try {
if (!eventMeshTCPServer.getEventMeshTCPConfiguration().isEventMeshServerRegistryEnable()) {
if (!eventMeshTCPServer.getEventMeshTCPConfiguration().isEventMeshServerMetaStorageEnable()) {
throw new Exception("registry enable config is false, not support");
}
UserAgent user = (UserAgent) pkg.getBody();
Expand Down

0 comments on commit 4388abe

Please sign in to comment.