[JAVA] Introduction to Ratpack (1) --What is Ratpack?

Ratpack introductory series

  1. Introduction to Ratpack (1) --What is Ratpack
  2. Introduction to Ratpack (2) --Architecture
  3. Introduction to Ratpack (3) --Hello world detailed explanation
  4. Introduction to Ratpack (4) --Routing & Static Content
  5. Introduction to Ratpack (5) --Json & Registry
  6. Introduction to Ratpack (6) --Promise
  7. Introduction to Ratpack (7) --Guice & Spring
  8. Introduction to Ratpack (8) --Session
  9. Introduction to Ratpack (9) --Thymeleaf

What is Ratpack

Ratpack is a web application library for Java / Groovy published in Apache License v2.

Official GitHub Javadoc

Feature

Event driven

Since Ratpack uses Netty for communication, it operates event-driven like node.js. Therefore, it is possible to realize scalable and high-performance HTTP communication.

asynchronous

Non-blocking communication requires support for asynchronous programming, which Java is not good at. Ratpack supports this with the Promise class and also has extensions for RxJava.

Non-opinionated

One of the development goals of Ratpack is to be "flexible and non-opinioned when integrating with other tools and libraries".

Scalability

There are extension modules such as ratpack-groovy, ratpack-guice, ratpack-jackson, ratpack-rxjava, ratpack-session.

What Ratpack is not aiming for

According to the official page, the following are listed as ** not ** goals for Ratpack:

Hello World

build.gradle


dependencies {
    compile 'io.ratpack:ratpack-core:1.5.1'
}

Sample.java


public final class Sample {

    public static void main( String[] args ) throws Exception {
        RatpackServer.start( server -> server
                .handlers( chain -> chain.get( ctx -> ctx.render( "hello, world" ) ) ) );
    }

}

キャプチャ.PNG

As you can see, it is made on the premise that lambda expressions are used a lot, so if you are not familiar with lambda expressions, please learn it.

Why did you decide to write this article

I was sick of Spring and was looking for an alternative library and came across Ratpack. However, there was not much information in Japanese, and even if it was, it was Groovy instead of Java, and the official documentation was sometimes difficult to understand. Therefore, I decided to write this article series, hoping to support those who are going to use Ratpack from now on.

In the next post, I'll look at how to use Ratpack in detail.

Recommended Posts

Introduction to Ratpack (1) --What is Ratpack?
Introduction to Ratpack (8)-Session
Introduction to Ratpack (6) --Promise
Introduction to Recursive Functions: What is a Recursive Function?
Introduction to Ratpack (7) --Guice & Spring
Introduction to Ruby 2
What is Docker?
What is null? ]
What is java
What is Keycloak
What is Jackson?
Introduction to SWING
What is Docker
What is self
What is Jenkins
What is ArgumentMatcher?
What is IM-Juggling?
What is params
What is SLF4J?
Introduction to web3j
What is Facade? ??
What is Java <>?
What is Gradle?
Introduction to Micronaut 1 ~ Introduction ~
[Java] Introduction to Java
What is centOS
Introduction to Ratpack (3) --hello world detailed explanation
What is RubyGem?
What is programming?
What is Docker? I tried to summarize
What is before_action?
What is Docker
Introduction to java
What is Byte?
Introduction to Doma
What is Tomcat
Introduction to Ratpack (Extra Edition) --Ratpack written in Kotlin
Introduction to JAR files
What is `docker-compose up`?
What is a constructor?
Introduction to RSpec 1. Test, RSpec
Introduction to bit operation
What is hard coding?
What is a stream
Introduction to PlayFramework 2.7 ① Overview
What is Java Encapsulation?
What is permission denied?
What is instance control?
Introduction to Android Layout
What is Spring Tools 4
What is an operator?
What is object orientation?
What is Guava's @VisibleForTesting?
Introduction to Practical Programming
Introduction to javadoc command
What is MVC model?
Introduction to jar command
What is an annotation?
What is Java technology?
Introduction to lambda expression
What is @ (instance variable)?