Dubbo Trial Whole process

Source: Internet
Author: User

1.

https://github.com/alibaba/dubbo/

2. Import the IDE

~/DUBBOMVN Eclipse:eclipse (performed two mvn downloads, first execution failed with some jars not downloaded, re-executed successfully)

Exsiting Projects to Workspace, Import-A, Menu, File, Eclipse

3. If you modify the Dubbo source code, you need to rebuild Dubbo
~/DUBBOMVN clean Install-dmaven. test.skipCD Dubbo/target

4.Install The Zookeeper registry:
Cd~wget Http://www.apache.org/dist//zookeeper/zookeeper-3.3.3/zookeeper-3.3.3.tar.gztar ZXVF Zookeeper-3.3.3.tar.gzCD ZOOKEEPER-3.3.3/CONFCP zoo_sample.cfg Zoo.cfgvi zoo.cfg-edit:datadir= /home/xxx/dataCD. /bin./zkserver.sh startcd ~/dubbo/dubbo-demo-provider/confvi Dubbo.properties-edit:dubbo.registry.adddress=zookeeper://127.0.0.1:2181CD. /bin./restart.shcd ~/dubbo/dubbo-demo-consumer/confvi dubbo.properties- Edit:dubbo.registry.adddress=zookeeper://127.0.0.1:2181CD. /bin./restart.shcd ~/dubbo/dubbo-simple-monitor/confvi dubbo.properties- Edit:dubbo.registry.adddress=zookeeper://127.0.0.1:2181CD. /bin./restart.sh 

5. Startup process
00zkserver.cmd
01start_provider.bat
02start_consumer.bat (optional, basic not available)
03start_monitor.bat (optional, monitor use, will occupy local 8080 port)
04start_admin.bat (Basic No, management controller deployed under Tomcat, Dubbo-admin-2.5.4-snapshot.war)

6. Server-Side development
Developed using Dubbo, MAVEN build, MVN build

7. Client Development
Through Java Engineering development, but at least the following jar must be imported


8. Management Console
http://127.0.0.1:8087(8080-port monitored application occupied, for a long time reason)
Dubbo-admin-2.5.4-snapshot.war (the war must be deployed under Tomcat/webapp/root)
Root/rooot
The consumer access service must be long connected to see the consumer in the admin console because it is connected based on zookeeper, but the client thread ends, and the zookeeper connection is immediately disconnected
9. Client Case Code
1  PackageCom.rigid;2 3 Importjava.io.IOException;4 5 ImportOrg.springframework.context.support.FileSystemXmlApplicationContext;6 7 ImportCom.alibaba.dubbo.demo.VendorService;8 9  Public classMain3 {Ten  One     /** A      * @paramargs -      * @throwsIOException -      */ the      Public Static voidMain (string[] args)throwsIOException { -Filesystemxmlapplicationcontext context =NewFilesystemxmlapplicationcontext ( -"/bin/conf/spring.*"); -          + Context.start (); -  +Vendorservice Vendorservice = (vendorservice) context.getbean ("Vendorservice"); A  atVendorservice.createvendor ("rigid"); -          - System.in.read ();  -  -     } -  in}
View Code
1 <?XML version= "1.0" encoding= "UTF-8"?>2 3 <Beansxmlns= "Http://www.springframework.org/schema/beans"4 Xmlns:xsi= "Http://www.w3.org/2001/XMLSchema-instance"xmlns:p= "http://www.springframework.org/schema/p"5 xsi:schemalocation= "Http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">6     7     <BeanID= "OrderService"class= "Com.rigid.OrderService"></Bean>    8     9 </Beans>
View Code


Dubbo Trial Whole process

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.