Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Kotlin + Java EE + MongoDBでサーバ組んで本番で動かしてみた

Kotlin + Java EE + MongoDBでサーバ組んで本番で動かしてみた

Tomohiro Nakamura

November 09, 2017
Tweet

More Decks by Tomohiro Nakamura

Other Decks in Technology

Transcript

  1. CTO Tomohiro Nakamura ( @HAIL ) Kotlin + Java EE

    + MongoDBで サーバ組んで本番で動かしてみた 2017/11/9(Thu)
  2. ⾃紹介 AnyPay株式会社 CTO Tomohiro Nakamura ( @HAIL ) 2010年 早稲⽥⼤学⼤学院情報理⼯学専攻

    2010年 Goldman Sachs 2012年 Electronic Arts (ex. Playfish) 2014年 Wekids Inc. 創業 2016年 AnyPay株式会社 CTOとして⼊社 Java育ち。 paymo招待コード: PNKYFNP CONFIDENTIAL : copyright © by 2017 AnyPay inc. all rights reserved ࣗݾ঺հ
  3. build.gradle dependencies { compile “org.jetbrains.kotlin:kotlin-stdlib-jre8:$kotlin_version” // 1.1.51 testCompile "org.junit.jupiter:junit-jupiter-api:$junit_jupiter_version” //

    5.0.1 testRuntime "org.junit.jupiter:junit-jupiter-engine:$junit_jupiter_version" testCompile 'org.jetbrains.spek:spek-api:1.1.5' testRuntime 'org.jetbrains.spek:spek-junit-platform-engine:1.1.5' providedCompile 'javax:javaee-api:7.0' compile "org.glassfish.jersey.core:jersey-client:$jersey_version” // 2.25.1 compile "org.glassfish.jersey.containers:jersey-container-servlet-core:$jersey_version" compile "org.glassfish.jersey.media:jersey-media-json-jackson:$jersey_version" compile "com.fasterxml.jackson.module:jackson-module-kotlin:$jackson_version” // 2.9.1 compile "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" compile 'io.github.microutils:kotlin-logging:1.4.6' compile "org.slf4j:slf4j-jdk14:$slf4j_version” // 1.7.25 compile 'com.google.inject.extensions:guice-servlet:4.1.0' compile 'org.glassfish.hk2:guice-bridge:2.4.0' compile 'com.google.cloud:google-cloud-logging:1.6.0' compile 'org.litote.kmongo:kmongo:3.5.0' } https://gist.github.com/tomohiro-n/e2c24d9db64ea1fb878ab8caad1aa180 CONFIDENTIAL : copyright © by 2017 AnyPay inc. all rights reserved CONFIDENTIAL : copyright © by 2017 AnyPay inc. all rights reserved
  4. リリース時の構成 • Kotlin 1.1 (JVM target 1.8) • Java EE

    7 • Jersey 2.25 • Google Guice 4.1 • Jackson 2.9 • Kotlin Logging 1.4 • Gradle 3.5 CONFIDENTIAL : copyright © by 2017 AnyPay inc. all rights reserved
  5. テストも美しく - Spek object DateTimeServiceSpec: Spek({ describe("DateTimeService") { val dateTimeService

    = DateTimeService() on("isDateTimeFresh") { it("should be able to judge if the specified time is less than 10 second old") { val oldTime = OffsetDateTime.now().minusSeconds(11) assertFalse(dateTimeService.isDateTimeFresh(oldTime)) val freshTime = OffsetDateTime.now().minusSeconds(9) assertTrue(dateTimeService.isDateTimeFresh(freshTime)) } } } }) https://gist.github.com/tomohiro-n/c2a86ba8f1286513387ec35a4199e8a7 CONFIDENTIAL : copyright © by 2017 AnyPay inc. all rights reserved