chickenlj commented on code in PR #9645:
URL: https://github.com/apache/dubbo/pull/9645#discussion_r965434746


##########
dubbo-rpc/dubbo-rpc-injvm/src/main/java/org/apache/dubbo/rpc/protocol/injvm/InjvmProtocol.java:
##########
@@ -88,7 +98,15 @@ public int getDefaultPort() {
 
     @Override
     public <T> Invoker<T> protocolBindingRefer(Class<T> serviceType, URL url) 
throws RpcException {
-        return new InjvmInvoker<T>(serviceType, url, url.getServiceKey(), 
exporterMap);
+        // group="a,b" or group="*"
+        String group = url.getParameter(GROUP_KEY);
+        if (StringUtils.isNotEmpty(group)) {
+            if ((COMMA_SPLIT_PATTERN.split(group)).length > 1 || 
"*".equals(group)) {
+                return doCreateInvoker(url, 
Cluster.getCluster(url.getScopeModel(), MergeableCluster.NAME), serviceType);
+            }
+        }
+        Cluster cluster = Cluster.getCluster(url.getScopeModel(), 
url.getParameter(CLUSTER_KEY));

Review Comment:
   ```java
       @SuppressWarnings({"unchecked", "rawtypes"})
       private void createInvokerForLocal(Map<String, String> 
referenceParameters) {
           URL url = new ServiceConfigURL(LOCAL_PROTOCOL, LOCALHOST_VALUE, 0, 
interfaceClass.getName(), referenceParameters);
           url = url.setScopeModel(getScopeModel());
           url = url.setServiceModel(consumerModel);
           Invoker<?> withFilter = protocolSPI.refer(interfaceClass, url);
           // Local Invoke ( Support Cluster Filter / Filter )
           List<Invoker<?>> invokers = new ArrayList<>();
           invokers.add(withFilter);
           invoker = Cluster.getCluster(url.getScopeModel(), 
Cluster.DEFAULT).join(new StaticDirectory(url, invokers), true);
   
           if (logger.isInfoEnabled()) {
               logger.info("Using in jvm service " + interfaceClass.getName());
           }
       }
   
   ```
   
   But I think that the invoker returned from here will be wrapped with a 
cluster in ReferenceConfig.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to