简体   繁体   English

Spring Boot-与微服务有什么关系?

[英]Spring Boot - What's it got to do with microservices?

Pardon my ignorance, but SpringBoot as far as I understand is an aid to set up a spring project.It simplifies dependency management by its opinionated view and takes away the pain associated with gathering all the dependencies on our own. 请原谅我的无知,但据我了解,SpringBoot有助于建立Spring项目,它以其自以为是的观点简化了依赖项管理,并消除了独自收集所有依赖项所带来的痛苦。 This apart it has a twist in the way it packages things up ie it packages the container itself with my app(uber jar) and makes war deployment etc a thing of the past.This kind of blurs the line between a web-app and a non web-app in my opinion. 除此以外,它在打包内容方面有一个变化,即它将容器本身与我的应用程序(超级jar)打包在一起,并使战争部署等成为过去。这种模糊了Web应用程序与我认为非网络应用。

From my understanding none of this is remotely related to micro-services but often I come across articles sounding like "microservices with SpringBoot". 据我了解,这些都不是与微服务远程相关的,但是我经常碰到听起来像“带有SpringBoot的微服务”的文章。 SpringBoot and microservices are used in the same breath giving one the notion that it is Spring's way of building in a microservices way?Isn't this wrong or am I missing something here? SpringBoot和微服务被同时使用,给人一种观念,那就是它是Spring以微服务方式构建的方式?这不是错误的,还是我在这里遗漏了一些东西?

First of all, spring boot is a great project. 首先,spring boot是一个很棒的项目。 Spring boot use default config but no longer mass of config files. Spring Boot使用默认配置,但不再包含大量配置文件。 This feature is support by auto-config project. auto-config项目支持此功能。 And, spring boot use embedded containers, so that you can just start up a service single. 而且,spring boot使用嵌入式容器,因此您只需启动一个服务即可。 That is your self config container such tomcat\\jetty is no longer needed. 那就是您的自我配置容器,不再需要tomcat \\ jetty。 Finally, microservices is just a concept of a service, you can split you service in any way. 最后,微服务只是服务的概念,您可以通过任何方式拆分服务。 ie every controller class as a microservices is fine, every module as a microservice is fine. 即,作为微服务的每个控制器类都可以,而作为微服务的每个模块都可以。 For me, use spring boot to build a microservice is a way to quick deploy a service at any service enveriment, I can start a service just copy a jar to a new service, and, run it just use java -jar 对我来说,使用spring boot来构建微服务是一种在任何服务环境下快速部署服务的方法,我可以启动服务,只需将jar复制到新服务,然后运行它就可以使用java -jar

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM