akka-http-marshallers


License

License

Categories

Categories

Akka Container Microservices Reactive libraries
GroupId

GroupId

com.powerspace.openrtb
ArtifactId

ArtifactId

akka-http-marshallers_2.12
Last Version

Last Version

1.3.1
Release Date

Release Date

Type

Type

jar
Description

Description

akka-http-marshallers
akka-http-marshallers
Project URL

Project URL

https://github.com/Powerspace/scala-openrtb
Project Organization

Project Organization

Powerspace
Source Code Management

Source Code Management

https://github.com/Powerspace/scala-openrtb

Download akka-http-marshallers_2.12

How to add to project

<!-- https://jarcasting.com/artifacts/com.powerspace.openrtb/akka-http-marshallers_2.12/ -->
<dependency>
    <groupId>com.powerspace.openrtb</groupId>
    <artifactId>akka-http-marshallers_2.12</artifactId>
    <version>1.3.1</version>
</dependency>
// https://jarcasting.com/artifacts/com.powerspace.openrtb/akka-http-marshallers_2.12/
implementation 'com.powerspace.openrtb:akka-http-marshallers_2.12:1.3.1'
// https://jarcasting.com/artifacts/com.powerspace.openrtb/akka-http-marshallers_2.12/
implementation ("com.powerspace.openrtb:akka-http-marshallers_2.12:1.3.1")
'com.powerspace.openrtb:akka-http-marshallers_2.12:jar:1.3.1'
<dependency org="com.powerspace.openrtb" name="akka-http-marshallers_2.12" rev="1.3.1">
  <artifact name="akka-http-marshallers_2.12" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.powerspace.openrtb', module='akka-http-marshallers_2.12', version='1.3.1')
)
libraryDependencies += "com.powerspace.openrtb" % "akka-http-marshallers_2.12" % "1.3.1"
[com.powerspace.openrtb/akka-http-marshallers_2.12 "1.3.1"]

Dependencies

compile (5)

Group / Artifact Type Version
org.scala-lang : scala-library jar 2.12.10
com.powerspace.openrtb : openrtb-json_2.12 jar 1.3.1
com.typesafe.akka : akka-http-core_2.12 jar 10.1.9
com.typesafe.akka : akka-http_2.12 jar 10.1.9
de.heikoseeberger : akka-http-circe_2.12 jar 1.28.0

Project Modules

There are no modules declared in this project.

Scala OpenRTB is a full Scala library that provides protobuf bindings as well as JSON serialization for OpenRTB-based entities in a functional fashion. This library also provides SerDes for BidSwitch bidding models, and aims to support other DSPs in the near future.

Artifacts

Scala openrtb artifacts are available on Sonatype.

Building

Build it like any other SBT project. Go to the root folder and run:

sbt compile

Usage

If you want to use the core of ScalaOpenRTB, you only need to add libraryDependencies += "com.powerspace.openrtb" %% "openrtb-model" % "version" to your build.sbt

We also provide json encoders through libraryDependencies += "com.powerspace.openrtb" %% "openrtb-json" % "version"

To leverage ScalaOpenRTB we have to define our bid request/response extensions and their decoders:

object CustomSerdeModule extends SerdeModule {

  // Define encoder for custom extension
  implicit val directEncoder: Encoder[CustomExtension] = openRtbEncoder[CustomExtension]
 
  // Register extension for specific proto-kind object
  override def extensionRegistry: ExtensionRegistry = ExtensionRegistry()
    .registerExtension(CustomProto.bidRequest)
  
  override def nativeRegistry: ExtensionRegistry = ExtensionRegistry()

Then in the bidder client we import defined module and use it for bid requests/response encoding/decoding:

import CustomSerdeModule._
import io.circe.syntax._
import io.circe.parser.decode

implicit val bidRequestEncoder: Encoder[BidRequest] = PowerspaceSerdeModule.bidRequestEncoder
implicit val bidResponseDecoder: Decoder[BidRequest] = PowerspaceSerdeModule.bidResponseDecoder

val bidRequest = BidRequest(...).asJson
val bidRequest = decode[BidResponse](bidRequest)

Work in Progress

  • Macro replacement will be included into ScalaOpenRTB

Links

  • OpenRTB specifications:

  • Powerspace: Powerspace is the 1st native advertising platform for e-mail. Powerspace allows brands to broadcast their content at scale across hundreds of media newsletters leveraging cutting-edge technology solutions.

  • BidSwitch: BidSwitch provides immediate and seamless real-time access for Supply and Demand Partners across all media types (display, mobile, video, native, TV, DOOH, VR, etc.).

  • Medium: Open-sourcing the first OpenRTB Scala framework

Contributions

Feel free to:

  • add support for other DSPs
  • raise an issue
  • submit your pull request
com.powerspace.openrtb

Powerspace

Versions

Version
1.3.1
1.2.0