BAEL-3353: Asynchronous HTTP Programming with Play Framework (#8349)

* project creation and added ws library

* BAEL-3353: pushing code for article

* BAEL-3353: changing test names

* BAEL-3353: removed unused imports

* BAEL-3353: applied review changes and fixed unit test bug

* BAEL-3353: added more examples to PR

* BAEL-3353: updated test following feedback

* BAEL-3353: add new unit test for large data download

* BAEL-3353: fixed PR following feedback
This commit is contained in:
gmconte
2020-02-24 19:12:40 +00:00
committed by GitHub
parent 53b58ab36b
commit 59623b094e
20 changed files with 529 additions and 0 deletions
@@ -0,0 +1,11 @@
# This is the main configuration file for the application.
# https://www.playframework.com/documentation/latest/ConfigFile
play.ws.followRedirects=false
play.ws.useragent=MyPlayApplication
play.ws.compressionEnabled=true
# time to wait for the connection to be established
play.ws.timeout.connection=30.seconds
# time to wait for data after the connection is open
play.ws.timeout.idle=30.seconds
# max time available to complete the request
play.ws.timeout.request=300.seconds
@@ -0,0 +1,36 @@
<!-- https://www.playframework.com/documentation/latest/SettingsLogger -->
<configuration>
<conversionRule conversionWord="coloredLevel" converterClass="play.api.libs.logback.ColoredLevel" />
<appender name="FILE" class="ch.qos.logback.core.FileAppender">
<file>${application.home:-.}/logs/application.log</file>
<encoder>
<pattern>%date [%level] from %logger in %thread - %message%n%xException</pattern>
</encoder>
</appender>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%coloredLevel %logger{15} - %message%n%xException{10}</pattern>
</encoder>
</appender>
<appender name="ASYNCFILE" class="ch.qos.logback.classic.AsyncAppender">
<appender-ref ref="FILE" />
</appender>
<appender name="ASYNCSTDOUT" class="ch.qos.logback.classic.AsyncAppender">
<appender-ref ref="STDOUT" />
</appender>
<logger name="play" level="INFO" />
<logger name="application" level="DEBUG" />
<logger name="controllers" level="DEBUG" />
<root level="WARN">
<appender-ref ref="ASYNCFILE" />
<appender-ref ref="ASYNCSTDOUT" />
</root>
</configuration>
+10
View File
@@ -0,0 +1,10 @@
# Routes
# This file defines all application routes (Higher priority routes first)
# ~~~~
# An example controller showing a sample home page
GET / controllers.HomeController.index(request: Request)
POST / controllers.HomeController.index(request: Request)
# Map static resources from the /public folder to the /assets URL path
GET /assets/*file controllers.Assets.versioned(path="/public", file: Asset)