MicroServices Learning Three: the use of springboot and Springcloud integration Eurake (server side, client side)

Source: Internet
Author: User
Tags zookeeper

This is thanks to the blog of a great God on the website:

http://blog.csdn.net/forezp/article/details/70148833

Highly Recommended study:

1, Springcloud is what, this everyone Baidu bar, I will also say do not understand, but more powerful than Dubbo, contains the Dubbo content, also contains more than Dubbo content.

2. What is Eurake? About this I think if you know zookeeper understand the advantages of eurake.

Springcloud integrates the Eurake, so the governance registration of the service is more convenient and concise, and does not need to install, so it is better than zookeeper.

3. Integration of Springboot and Springcloud:

Springcloud is based on the development of springboot, so we must be springboot;

How to integrate I just said that I made a wrong step, other people learn from the great God can be;

The first step: wrong, hey, because of INTELLJ idea is not familiar with, so the first step is wrong.

Create an empty MAVEN project: project in idea is equivalent to a workspace,modle equivalent to a project project.

So let's start by creating a Father Maven Project: Note that the modle in the back is in the workspace of the parent project.

Such an empty MAVEN project is created so that SRC can be deleted. anyone. I deleted it by looking at the trouble.

Step Two: Create the server side:

The configuration of the server side is added:

@EnableEurekaServer @springbootapplicationpublic class Eurekaserverapplication {public    static void Main (string[] args) {        springapplication.run (eurekaserverapplication.class, args);}    }

  

As for why use APPLICATION.YML, everyone own Baidu Bar, I think is for convenience. Written in a more hierarchical sense.

Such a server side is complete:

Start:

The following is the creation of the client, I would like to register the service to the server side, this people imitate the creation of the server can be, but the configuration is not the same.

Note: Also created under the MAVEN parent project:

Qid

After startup, this will register the service in Eurake, and we'll look at:

Later, we call the service to find this:

So this has achieved the role of zookeeper, use it.

MicroServices Learning Three: the use of springboot and Springcloud integration Eurake (server side, client side)

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.