You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2019/03/28 01:45:36 UTC

[GitHub] [servicecomb-java-chassis] heyile edited a comment on issue #1156: 关于rpc方式调用服务提供者的问题

heyile edited a comment on issue #1156: 关于rpc方式调用服务提供者的问题
URL: https://github.com/apache/servicecomb-java-chassis/issues/1156#issuecomment-477411292
 
 
   你说的根本无法引用什么意思? 你需要在consumer 提供一个类似的 interface
   ```
   public interface Hello {
   
     String sayHi(String name);
   
     String sayHello(Person person);
   }
   ```
   然后才可以调用
   
   ```
     @RpcReference(microserviceName = "springmvc", schemaId = "springmvcHello")
     private static Hello hello;
   public static void main(String[] args) throws Exception {
       BeanUtils.init();
       Person person = new Person();
       person.setName("ServiceComb/Java Chassis");
       // POJO Consumer
       System.out.println("POJO consumer sayhi services: " + hello.sayHi("Java Chassis"));
       System.out.println("POJO consumer sayhello services: " + hello.sayHello(person));
     }
   ```
   
   详情可参考: https://github.com/apache/servicecomb-java-chassis/tree/master/samples/springmvc-sample

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services