This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package dynamo.ast.write | |
import dynamo.ast.DynamoType | |
trait DynamoWrite[A] { self => | |
def write(a: A): DynamoWriteResult[DynamoType] | |
def map[B](f: (A => B)): DynamoWrite[B] //not yet coded, not sure if necessary | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//storing a correlation id in thread local variables | |
MDC.put("correlationId", Random.alphanumeric.take(8).mkString) | |
//retrieving the correlation id | |
val correlationId = MDC.get("correlationId") | |
trait Logger { | |
def error(msg: String, t: Throwable): Unit | |
def info(msg: String): Unit = { | |
underlyingLogger.info(s"[${MDC.get("correlationId")}] $msg") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INFO [2019-05-29T08:11:16.436Z] - Request OK for client xxx | |
INFO [2019-05-29T08:11:17.964Z] - Request OK for client yyy gf | |
INFO [2019-05-29T08:11:18.256Z] - Request successfully processed for client zzz | |
ERROR [2019-05-29T08:11:20.064Z] - Request failed for client aaa | |
ERROR [2019-05-29T08:11:20.064Z] - java.lang.HttpRequestException: Something went wrong ! 💥😱 | |
at org.lforite.servicea.HttpClient.getB(HttpClient.scala:12) | |
at org.lforite.servicea.UnderlyingHttpClient.get(HttpClient.scala) | |
INFO [2019-05-29T08:11:21.415Z] - Request OK for client bbb | |
INFO [2019-05-29T08:11:21.473Z] - Request OK for client ccc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INFO [2019-05-29T06:10:10.436Z] - Request OK | |
INFO [2019-05-29T07:10:33.576Z] - Request OK | |
INFO [2019-05-29T08:55:17.948Z] - Request OK | |
INFO [2019-05-29T09:56:17.287Z] - Request OK | |
ERROR [2019-05-29T10:11:19.064Z] - Unexpected request response: got 500 | |
ERROR [2019-05-29T10:11:19.064Z] - java.lang.HttpRequestException: Unexpected request response | |
at org.lforite.serviceb.HttpClient.getD(HttpClient.scala:29) | |
at org.lforite.serviceb.UnderlyingHttpClient.get(HttpClient.scala) | |
INFO [2019-05-29T11:11:21.415Z] - Request OK | |
INFO [2019-05-29T12:11:21.473Z] - Request OK |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INFO [2019-05-29T08:10:07.815Z] - Received request to fetch entity D with id xyz | |
ERROR [2019-05-29T08:10:07.816Z] - Request ok | |
INFO [2019-05-29T08:10:07.817Z] - Received request to fetch entity D with id aaa | |
WARN [2019-05-29T08:10:09.673Z] - Maximum txO for client 4 | |
ERROR [2019-05-29T08:11:07.815Z] - java.lang.JDBCConnectionException: JDBC exception: Connection to database lost | |
at org.lforite.serviced.SQLClient.getEntityD(SQLClient.scala:57) | |
at org.lforite.serviced.UnderlyingSQLClient.executeQuery(UnderlyingSQLClient.scala) | |
WARN [2019-05-29T08:10:07.816Z] - Maximum thread pool size reached | |
INFO [2019-05-29T08:10:08.817Z] - Start processing for entity dfe | |
WARN [2019-05-29T08:12:14.328Z] - Maximum thread pool size reached |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait ServiceA { | |
def createA(a: EntityA, cid: CorrelationId): IO[_] | |
} | |
trait ClientB { | |
def getB(bId: EntityBID, cid: CorrelationId): IO[_] | |
} | |
case class ServiceAImpl(clientB: ClientB) extends ServiceA { | |
override def createA(a: EntityA, cid: CorrelationId): IO[_] = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait ServiceA { | |
def createA(a: EntityA)(implicit cid: CorrelationId): IO[_] | |
} | |
trait ClientB { | |
def getB(bId: EntityBID)(implicit cid: CorrelationId): IO[_] | |
} | |
case class ServiceAImpl(clientB: ClientB) extends ServiceA { | |
override def createA(a: EntityA)(implicit cid: CorrelationId): IO[_] = { |
OlderNewer