[ 
https://issues.apache.org/jira/browse/SCB-926?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16625691#comment-16625691
 ] 

ASF GitHub Bot commented on SCB-926:
------------------------------------

yhs0092 commented on a change in pull request #915: [SCB-926] support invoking 
3rd party service
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/915#discussion_r219804658
 
 

 ##########
 File path: 
service-registry/src/main/java/org/apache/servicecomb/serviceregistry/registry/AbstractServiceRegistry.java
 ##########
 @@ -303,4 +307,30 @@ public void destroy() {
     eventBus.post(new ShutdownEvent());
     unregisterInstance();
   }
+
+  @Override
+  public void registryMicroserviceMapping(String microserviceName, String 
version, Class<?> schemaIntfCls,
+      List<MicroserviceInstance> instances) {
+    String app = RegistryUtils.getAppId();
+    MicroserviceManager microserviceManager = 
appManager.getOrCreateMicroserviceManager(app);
+    StaticMicroserviceVersions microserviceVersions =
+        (StaticMicroserviceVersions) microserviceManager.getVersionsByName()
+            .computeIfAbsent(microserviceName,
+                svcName -> new StaticMicroserviceVersions(this.appManager, 
app, microserviceName, schemaIntfCls));
+
+    microserviceVersions.addInstances(version, instances);
 
 Review comment:
   `addInstances` is put inside `computeIfAbsent`. Currently only initial 
instance method is provided. Users cannot re-set instance info of a 3rd party 
service.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Invoke 3rd party service
> ------------------------
>
>                 Key: SCB-926
>                 URL: https://issues.apache.org/jira/browse/SCB-926
>             Project: Apache ServiceComb
>          Issue Type: New Feature
>    Affects Versions: java-chassis-1.1.0
>            Reporter: YaoHaishi
>            Assignee: YaoHaishi
>            Priority: Major
>
> Provide a interface to let users specify 3rd party services' endpoints and 
> let users can invoke 3rd party service like invoking the ServiceComb 
> microservice.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to