Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ private RegistryUtils() {
}

public static void init() {
if (serviceRegistry != null) {
return;
}

MicroserviceConfigLoader loader = ConfigUtil.getMicroserviceConfigLoader();
MicroserviceDefinition microserviceDefinition = new MicroserviceDefinition(loader.getConfigModels());
serviceRegistry =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
import org.apache.servicecomb.serviceregistry.api.response.FindInstancesResponse;
import org.apache.servicecomb.serviceregistry.client.http.MicroserviceInstances;
import org.apache.servicecomb.serviceregistry.version.Version;
import org.apache.servicecomb.swagger.SwaggerUtils;

import io.swagger.models.Swagger;

public class StaticMicroserviceVersions extends MicroserviceVersions {
private Class<?> schemaIntfCls;
Expand All @@ -40,7 +43,9 @@ public StaticMicroserviceVersions(AppManager appManager, String appId, String mi
public StaticMicroserviceVersions init(Class<?> schemaIntfCls, String version,
List<MicroserviceInstance> addedInstances) {
this.schemaIntfCls = schemaIntfCls;
this.appManager.getServiceRegistry().getSwaggerLoader().registerSwagger(appId, shortName, shortName, schemaIntfCls);
Swagger swagger = this.appManager.getServiceRegistry().getSwaggerLoader()
.registerSwagger(appId, shortName, shortName, schemaIntfCls);
microservice.addSchema(shortName, SwaggerUtils.swaggerToString(swagger));

createMicroservice(version);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package org.apache.servicecomb.serviceregistry.registry;

import org.apache.servicecomb.config.archaius.sources.MicroserviceConfigLoader;
import org.apache.servicecomb.foundation.common.event.SimpleEventBus;
import org.apache.servicecomb.serviceregistry.ServiceRegistry;
import org.apache.servicecomb.serviceregistry.client.LocalServiceRegistryClientImpl;
import org.apache.servicecomb.serviceregistry.config.ServiceRegistryConfig;
Expand Down Expand Up @@ -62,7 +63,7 @@ public static ServiceRegistry createLocal() {
}

public static ServiceRegistry createLocal(String localFile) {
EventBus eventBus = new EventBus();
EventBus eventBus = new SimpleEventBus();
ServiceRegistryConfig serviceRegistryConfig = ServiceRegistryConfig.INSTANCE;
MicroserviceConfigLoader loader = new MicroserviceConfigLoader();
loader.loadAndSort();
Expand Down
Loading