http://bit.ly/microservices-groovy
Microservice architectural style is an approach to developing a single application as a suite of small services, each running in its own process and communicating with lightweight mechanisms, often an HTTP resource API.
- Martin Fowler
Because monolithic apps lack:
- Scalability
- Flexibility
- Modularity
- Portability
- Decentralization
MetaProgramming
DSL
Dynamic
Optional Type
@GrabResolver("https://oss.jfrog.org/artifactory/repo")
@Grab("io.ratpack:ratpack-groovy:0.9.4")
import static ratpack.groovy.Groovy.*
ratpack {
handlers {
get {
render "Hello World"
}
}
}
http://localhost:5050
v0.9.11 (released 12/01)
npm install generator-angular-ratpack
dependencies {
compile("org.springframework.boot:spring-boot-starter-web:1.1.9.RELEASE")
}
package hello;
import org.springframework.boot.*;
import org.springframework.boot.autoconfigure.*;
import org.springframework.stereotype.*;
import org.springframework.web.bind.annotation.*;
@Controller
@EnableAutoConfiguration
public class SampleController {
@RequestMapping("/")
@ResponseBody
String home() {
return "Hello World!";
}
public static void main(String[] args) throws Exception {
SpringApplication.run(SampleController.class, args);
}
}
Great.. but not so Groovy!!!
//App.groovy
@RestController
class SampleController {
@RequestMapping("/")
String home() {
return "Hello World!"
}
}
$ spring run App.groovy
$ curl localhost:8080
Hello World!
by Graeme Rocher in S2GX - 2014
A single missing semicolon brought down the entire (monolithic) Netflix website for several hours in 2008. #reInvent — Chris Eng (@chriseng)
NetFlix
( NetFlix OSS)