Search in sources :

Example 1 with ConsumerMicroserviceVersionsMeta

use of org.apache.servicecomb.core.definition.ConsumerMicroserviceVersionsMeta in project java-chassis by ServiceComb.

the class SCBEngine method createMicroserviceReferenceConfig.

/**
 * for edge, versionRule maybe controlled by url rule
 * @param microserviceName hortName, or appId:shortName when invoke cross app
 * @param versionRule if is empty, then use configuration value
 * @return
 */
public MicroserviceReferenceConfig createMicroserviceReferenceConfig(String microserviceName, String versionRule) {
    ensureStatusUp();
    MicroserviceVersions microserviceVersions = DiscoveryManager.INSTANCE.getOrCreateMicroserviceVersions(parseAppId(microserviceName), microserviceName);
    ConsumerMicroserviceVersionsMeta microserviceVersionsMeta = CoreMetaUtils.getMicroserviceVersionsMeta(microserviceVersions);
    return new MicroserviceReferenceConfig(microserviceVersionsMeta, versionRule);
}
Also used : ConsumerMicroserviceVersionsMeta(org.apache.servicecomb.core.definition.ConsumerMicroserviceVersionsMeta) MicroserviceReferenceConfig(org.apache.servicecomb.core.provider.consumer.MicroserviceReferenceConfig) MicroserviceVersions(org.apache.servicecomb.registry.consumer.MicroserviceVersions)

Aggregations

ConsumerMicroserviceVersionsMeta (org.apache.servicecomb.core.definition.ConsumerMicroserviceVersionsMeta)1 MicroserviceReferenceConfig (org.apache.servicecomb.core.provider.consumer.MicroserviceReferenceConfig)1 MicroserviceVersions (org.apache.servicecomb.registry.consumer.MicroserviceVersions)1