# Microserver
[![Build Status](https://travis-ci.org/aol/micro-server.svg)](https://travis-ci.org/aol/micro-server)
[![Join the chat at https://gitter.im/aol/micro-server](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/aol/micro-server?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
A convenient modular engine for Microservices. Microserver plugins offer seamless integration with Spring (core), Jersey, Guava, Tomcat, Grizzly, reactive programming, Hibernate (& Spring Data), Spring Boot, Codahale Metrics, Swagger and more to come!
* [Microserver screencast : getting started with plugins](https://www.youtube.com/watch?v=sYn2cVTkfcM)
![screen shot 2016-05-06 at 12 30 26 pm](https://cloud.githubusercontent.com/assets/9964792/15588807/8da91440-2387-11e6-979b-f24d456541f5.png)
### Microserver plugins video
[![Getting started video](https://cloud.githubusercontent.com/assets/9964792/6361863/9991c50c-bc7e-11e4-8d28-746b0b87b1da.png)](https://youtu.be/sYn2cVTkfcM)
## Quick start
Install Microserver with Grizzly, Jackson and Jersey (Gradle config below)
```groovy
compile group: 'com.oath.microservices', name:'micro-grizzly-with-jersey', version:'x.yz'
```
Install Microserver with Tomcat, Jackson and Jersey (Gradle config below)
```groovy
compile group: 'com.oath.microservices', name:'micro-tomcat-with-jersey', version:'x.yz'
```
Create and run a simple app
```java
@Rest
@Path("/test")
public class SimpleApp {
public static void main(String[] args){
new MicroserverApp(()->"test-app").run();
}
@GET
public String myEndPoint(){
return "hello world!";
}
}
```
Browse to *http://localhost:8080/test-app/test*
See the response *hello world!*
Add plugins by adding them to your build file - rerun the app to get new end points, Spring beans and more!
## Easy to use async NIO based REST
Return any reactive-streams Publisher from your REST end point to make them execute asynchronously automatically.
E.g. Using Future from [cyclops-react](cyclops-react.io)
```java
@GET
public Future<String> myEndPoint(){
return Future.of(()->{
sleep();
return "hello world!";
}, Executors.newFixedThreadPool(1));
}
```
Would be equivalent to the following code
```java
@GET
public void myEndPoint(@Suspended AsyncResponse asyncResponse){
Future.of(()->{
sleep();
asyncResponse.resume("hello world!");
return 1;
}, Executors.newFixedThreadPool(1));
}
```
# Why Microserver?
Microserver is a plugin engine for building Spring and Spring Boot based microservices. Microserver supports pure microservice and micro-monolith development styles. The micro-monolith style involves packaging multiple services into a single deployment - offering developers the productivity of microservice development without the operational risk. This can help teams adopt a Microservices architecture on projects that are currently monoliths.
Microserver plugins are orthogonal to Microservices. They solve a common problem in Microservice development whereby services are broken up and deployed separately but the code remains entangled in a monolithic common library. By making use of a plugin system that follows the same modular architectural principals as microservice development, teams can keep cross-service concerns and infrastructure in properly size, coherent and cohesive plugin modules.
# Tutorial and overview
[Tutorial](https://github.com/aol/micro-server/wiki/Getting-started-:-Tutorial)
[Tutorial code](https://github.com/aol/micro-server/tree/master/micro-tutorial)
## Note on Fat Jars
Microserver (& Cyclops) have a plugin architecture and make use of the Java Service Loader mechanism. Make sure your Fat Jar implementation is configured to aggregate services. With the Gradle Shadow Jar you do this with
```groovy
shadowJar {
mergeServiceFiles()
}
```
### Quick start youtube video
[![Getting started video](https://cloud.githubusercontent.com/assets/9964792/6361863/9991c50c-bc7e-11e4-8d28-746b0b87b1da.png)](https://www.youtube.com/watch?v=McXy9oGRpfA&feature=youtu.be)
Note the main launch class has been changed from MicroServerStartup to MicroserverApp
## Blurb
Microserver is a zero configuration, standards based, battle hardened library to run Java Rest Microservices via a standard Java main class. It has been used in production in AOL since July 2014.
## Get Microserver
![Build health](https://travis-ci.org/aol/micro-server.svg)
* micro-grizzly-with-jersey
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.oath.microservices/micro-grizzly-with-jersey/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.oath.microservices/micro-grizzly-with-jersey)
* micro-tomcat-with-jersey
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.oath.microservices/micro-tomcat-with-jersey/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.oath.microservices/micro-tomcat-with-jersey)
* micro-core
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.oath.microservices/micro-core/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.oath.microservices/micro-core)
* micro-boot : Microserver driving Spring Boot
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.oath.microservices/micro-boot/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.oath.microservices/micro-boot)
* micro-spring-boot : Spring Boot driving Microserver
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.oath.microservices/micro-spring-boot/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.oath.microservices/micro-spring-boot)
## Info
[wiki](https://github.com/aol/micro-server/wiki)
[Google Group](https://groups.google.com/forum/#!forum/micro-server)
[Example Apps : Microserver Core with Grizzly and Jersey](https://github.com/aol/micro-server/tree/master/micro-grizzly/src/test/java/app)
[Example Apps : Microserver Boot](https://github.com/aol/micro-server/tree/master/micro-boot/src/test/java/app)
[Java Doc : Microserver Core](http://www.javadoc.io/doc/com.oath.microservices/micro-core/0.62)
[Java Doc : Microserver Boot](http://www.javadoc.io/doc/com.oath.microservices/micro-core/0.62)
### Maven dependency
Microserver Grizzly with Jersey
```xml
<dependency>
<groupId>com.oath.microservices</groupId>
<artifactId>micro-grizzly-with-jersey</artifactId>
<version>x.yz</version>
</dependency>
```
Microserver Spring Boot
```xml
<dependency>
<groupId>com.oath.microservices</groupId>
<artifactId>micro-spring-boot</artifactId>
<version>x.yz</version>
</dependency>
```
### Gradle dependency
Microserver core
```groovy
compile group: 'com.oath.microservices', name:'micro-core', version:'x.yz'
```
Microserver Spring Boot
```groovy
compile group: 'com.oath.microservices', name:'micro-spring-boot', version:'x.yz'
```
## Tech Stack
Microserver core is a lightweight server configuration engine built using Spring, Cyclops and Jackson.
## Zero Configuration
No directory structure is imposed by the server and no XML is required. There is no framework config. Just a jar file and your application. You can, of course, configure your application without limit.
Example working application :-
### The main class :-
```java
public class AppRunnerTest {
public static void main(String[] args) throws InterruptedException {
new MicroserverApp(() -> "test-app").run();
}
}
```
This will deploy a REST server on port 8080 (configurable by test-app.port in application.properties), it will also automagically capture any Rest
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
Microserver微服务框架 v1.2.6.zip (1057个子文件)
gradlew.bat 2KB
.editorconfig 266B
.gitignore 2KB
build.gradle 3KB
build.gradle 3KB
build.gradle 3KB
build.gradle 2KB
build.gradle 2KB
build.gradle 2KB
build.gradle 2KB
build.gradle 2KB
build.gradle 2KB
build.gradle 2KB
build.gradle 2KB
build.gradle 2KB
build.gradle 2KB
build.gradle 2KB
build.gradle 2KB
build.gradle 2KB
build.gradle 2KB
build.gradle 2KB
build.gradle 2KB
build.gradle 2KB
build.gradle 2KB
build.gradle 1KB
build.gradle 1KB
build.gradle 1KB
build.gradle 1KB
build.gradle 1KB
build.gradle 1KB
build.gradle 1KB
build.gradle 1KB
build.gradle 1KB
build.gradle 1KB
build.gradle 1KB
build.gradle 1KB
build.gradle 1KB
build.gradle 1KB
build.gradle 1KB
build.gradle 1KB
build.gradle 1KB
build.gradle 1KB
build.gradle 1KB
build.gradle 1KB
build.gradle 1KB
settings.gradle 1KB
settings.gradle 662B
build.gradle 439B
.gradletasknamecache 48KB
gradlew 5KB
ScheduleAndAsyncConfigTest.groovy 1KB
SimpleCouchbaseClientConnectionTest.groovy 932B
ManifestComparatorTest.groovy 46B
SimpleCouchbaseClientTest.groovy 41B
说明.htm 4KB
gradle-wrapper.jar 53KB
ConfigurableModuleTest.java 12KB
S3ManifestComparator.java 11KB
NIORestClient.java 9KB
CouchbaseManifestComparator.java 9KB
MetricsCatcher.java 8KB
S3Utils.java 8KB
MetricsCatcherTest.java 8KB
ConfigurableModule.java 8KB
MicroserverApp.java 7KB
Module.java 7KB
ReactiveRequest.java 6KB
RegistryAppRunner.java 6KB
RestClientTest.java 6KB
GrizzlyApplication.java 6KB
TomcatApplication.java 6KB
QueryIPRetrieverTest.java 6KB
MetricsCatcherConfigOffTest.java 6KB
RestClientTest.java 6KB
PropertyFileConfig.java 5KB
JmxMetricsAcquirer.java 5KB
S3UploadSystemTest.java 5KB
AsyncRestClient.java 5KB
S3DownloadSystemTest.java 5KB
JobsBeingExecuted.java 5KB
TestReporter.java 5KB
TestReporter.java 5KB
S3UtilsTest.java 5KB
AsyncDataWriter.java 5KB
RequestEvents.java 5KB
BootFrontEndApplicationConfigurator.java 5KB
S3ClientProviderTest.java 5KB
BootFrontEndApplicationConfigurator.java 4KB
SingleClassTest.java 4KB
RestClient.java 4KB
LabelledEvents.java 4KB
S3ObjectWriter.java 4KB
SpringContextFactory.java 4KB
RegisterEntry.java 4KB
ActiveResourceTest.java 4KB
MemcachedCacheImplTest.java 4KB
JobsBeingExecutedTest.java 4KB
TransactionFlow.java 4KB
LogStreamer.java 4KB
DatadogMetricsConfigurer.java 4KB
共 1057 条
- 1
- 2
- 3
- 4
- 5
- 6
- 11
资源评论
芝麻粒儿
- 粉丝: 6w+
- 资源: 2万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- n.cpp
- jdk-8u411-windows-x64下载安装可用
- vgg模型-图像分类算法对水果识别-不含数据集图片-含逐行注释和说明文档.zip
- KMP算法(Knuth-Morris-Pratt算法
- vgg模型-python语言pytorch框架训练识别化妆品分类-不含数据集图片-含逐行注释和说明文档.zip
- KMP算法(Knuth-Morris-Pratt算法
- shufflenet模型-基于人工智能的卷积网络训练识别狗的表情-不含数据集图片-含逐行注释和说明文档.zip
- shufflenet模型-python语言pytorch框架训练识别张嘴闭嘴-不含数据集图片-含逐行注释和说明文档.zip
- resnet模型-基于人工智能的卷积网络训练识别面部表情识别-不含数据集图片-含逐行注释和说明文档
- resnet模型-python语言pytorch框架训练识别香蕉品质-不含数据集图片-含逐行注释和说明文档.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功