Más contenido relacionado La actualidad más candente (6) Similar a Spring I/O 2016 Spring 5について (20) Spring I/O 2016 Spring 5について4. JDK9 & Jigsawモジュール
Jigsaw?
Moduleの概念をJDKに導入すること
• jarの依存関係を明確にする
• パッケージの公開範囲を設定できる
• モジュール単位でアプリに必要な部分だけロード
することができる
module
package
Class & Interface
Field & Method
Purpose
• Java SEおよびJDKをスモールデバイス向けにスケールダウンできるように
• Jar内のライブラリ同士のコンフリクトを防ぎたい
• 内部のAPIを壊すことなく変更したい
6. Servlet4.0 & HTTP/2
We need to embrace HTTP/2
in the Java land as well!
プロトコルの仕様(HTTP/1.1)に起因するパフォーマンスの悪さ
・1ドメインにリクエストする数が制限されている
・リクエストの順番どおりにレスポンスを返す必要がある(HoLブロッキング)
Problem
HTTP/2 (https://http2.github.io/faq/)
バイナリフレーム・ストリームの概念などを採用
リクエストとレスポンスを多重化して高速化を図る
http://webdesignledger.com
1 request ≠ 1 response
18. Controller with Reactive types
repository.findAll()
.filter(user ‐> user.getName().matches("K.*"))
.map(user ‐> "Name: " + user.getName())
.log()
.subscribe(user ‐> {});
public interface UserRepository {
Mono<User> findById(Long id);
Flux<User> findAll();
Mono<User> save(User user);
}
データフローを発生させる
Defaultはすべてのデータを取得する(データ取得制限なし)
@RequestMapping("/users")
public Flux<User> getUsers() {
return this.userRepository.findAll();
}
20. Thymeleaf 3.0 Reactive Friendliness
Engine throttling
シングルスレッド・back-pressure管理・Cold observable
1process
https://github.com/thymeleaf/thymeleafsandbox-springreactive