Last active
November 2, 2016 13:05
-
-
Save notyy/32e4aa58471401e55a3a912d75cf433e to your computer and use it in GitHub Desktop.
a dubbo sample
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.springframework.context.support.ClassPathXmlApplicationContext; | |
import com.alibaba.dubbo.demo.UserService; | |
public class Consumer { | |
public static void main(String[] args) throws Exception { | |
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(new String[] {"http://10.20.160.198/wiki/display/dubbo/consumer.xml"}); | |
context.start(); | |
UserService userService = (UserService)context.getBean("userService"); // get remote proxy | |
String userId = UserService.createUser("sam newman"); // call remote method | |
System.out.println( userId ); // show result | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment