More Related Content
Similar to Lineにおけるspring frameworkの活用
Similar to Lineにおけるspring frameworkの活用 (20)
More from Tokuhiro Matsuno
More from Tokuhiro Matsuno (20)
Lineにおけるspring frameworkの活用
- 9. ⾔言語/フレームワークを
締め付けすぎない
• ⼀一つの技術にのみコミットしすぎると変化に弱
くなる
• spring, guice, Vert.x, Dagger2, avans,etc.
• groovy, scala, …
• golang, perl, python, …
- 12. なぜ spring-boot か?
• uber jar でお⼿手軽に deploy できる
• アプリケーションの開発がわりと簡単に開始で
きる
• XML 書かなくていい
• Java のわりに 起動が速い
- 15. curl -X POST
-H 'Authorization: Bearer <ACCESS_TOKEN>'
-F 'message=Hello'
https://notify-api.line.me/api/notify
- 21. LINE ♥ Fluentd
• アクセスログの集計
• http status コードの統計監視
• イベントログ
• Fluency が最近は優勢
• 社内のおっきなストレージに保存
- 28. MyBatis + Kotlin
• XML ⾟辛い
• Java アノテーションでも書けるけど⾟辛い
• 複数⾏行行⽂文字列列書けない → 複雑なクエリが⾟辛い
• そこで Kotlin ですよ!
- 45. LINE Messaging API
• LINE のボットを簡単に作れる
• 最⼤大優勝賞⾦金金1000万円の LINE BOT AWARDS も
やってる
• Java + spring-boot なら簡単につくれる
- 46. LINE Messaging SDK for
Java
• JSON をマッピングするためのクラス
• HTTP Client library based on Retrofit
• Servlet support
• spring-boot support
- 52. @LineMessageHandler
public class EchoHandler {
@Autowired
private LineMessagingService lineMessagingService;
@EventMapping
public void handle(MessageEvent<TextMessageContent> event) throws
Exception {
lineMessagingService.replyMessage(new ReplyMessage(
event.getReplyToken(), singletonList(
new TextMessage(event.getMessage().getText()))))
.execute();
}
}