calatrava-client-library


License

License

Categories

Categories

CLI User Interface
GroupId

GroupId

com.gilt
ArtifactId

ArtifactId

calatrava-client-library_2.10
Last Version

Last Version

0.0.8
Release Date

Release Date

Type

Type

jar
Description

Description

calatrava-client-library
calatrava-client-library
Project URL

Project URL

https://github.com/gilt/calatrava-client-library
Project Organization

Project Organization

com.gilt
Source Code Management

Source Code Management

https://github.com/gilt/calatrava-client-library.git

Download calatrava-client-library_2.10

How to add to project

<!-- https://jarcasting.com/artifacts/com.gilt/calatrava-client-library_2.10/ -->
<dependency>
    <groupId>com.gilt</groupId>
    <artifactId>calatrava-client-library_2.10</artifactId>
    <version>0.0.8</version>
</dependency>
// https://jarcasting.com/artifacts/com.gilt/calatrava-client-library_2.10/
implementation 'com.gilt:calatrava-client-library_2.10:0.0.8'
// https://jarcasting.com/artifacts/com.gilt/calatrava-client-library_2.10/
implementation ("com.gilt:calatrava-client-library_2.10:0.0.8")
'com.gilt:calatrava-client-library_2.10:jar:0.0.8'
<dependency org="com.gilt" name="calatrava-client-library_2.10" rev="0.0.8">
  <artifact name="calatrava-client-library_2.10" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.gilt', module='calatrava-client-library_2.10', version='0.0.8')
)
libraryDependencies += "com.gilt" % "calatrava-client-library_2.10" % "0.0.8"
[com.gilt/calatrava-client-library_2.10 "0.0.8"]

Dependencies

compile (9)

Group / Artifact Type Version
org.scala-lang : scala-library jar 2.10.5
com.google.inject : guice jar 4.0
com.gilt : gfc-logging_2.10 jar 0.0.3
org.slf4j : slf4j-simple jar 1.7.12
com.gilt : gfc-util_2.10 jar 0.1.1
com.amazonaws : aws-java-sdk jar 1.10.20
com.amazonaws : amazon-kinesis-client jar 1.6.1
com.fasterxml.jackson.datatype : jackson-datatype-joda jar 2.6.1
com.gilt : jerkson_2.10 jar 0.6.8

provided (2)

Group / Artifact Type Version
org.scoverage : scalac-scoverage-runtime_2.10 jar 1.0.4
org.scoverage : scalac-scoverage-plugin_2.10 jar 1.0.4

test (2)

Group / Artifact Type Version
org.scalatest : scalatest_2.10 jar 2.2.4
org.mockito : mockito-core jar 1.8.5

Project Modules

There are no modules declared in this project.

calatrava-client-library

A library that allows consumption of events from a Calatrava stream.

Contents and Example Usage

kinesis.BridgeConfiguration

This class encapsulates configuration needed for the Worker. Some of it regards the Calatrava Bridge that we need to consume events for. The last part, if present, enables KCL metrics reporting into CloudWatch.

The following parameters must be provided:

  • clientAppName: mandatory String parameter to specify the name of this Kinesis client application. Must be unique for this Bridge.

  • streamName: mandatory String parameter, specifies the name of the Kinesis stream associated with the Bridge.

  • bucketName: mandatory String parameter, specifies the name of the S3 bucket associated with the Bridge.

  • iamRoleArnOpt: optional String parameter, specifies an IAM role that this application must assume prior to making calls to Kinesis, or S3. If not specified, the application will use the default credentials provider chain. If specified, this role should have permissions to read from the Bridge (S3, Kinesis), and, if necessary, permissions to create metrics in CloudWatch (see below).

  • metricsConfigOpt: optional MetricsConfiguration parameter, specifies CloudWatch metrics configuration parameters. If not provided, the Kinesis Client library will not send metrics to CloudWatch.

kinesis.CalatravaEventProcessor

An implementation of this interface must be constructed and passed to the Worker factory, so that events are being sent here for processing. Has only one method, processEvent, which takes a parameter of type ChangeEvent, as defined in the Calatrava API. It must return true if the event was successfully processed, false otherwise.

Worker Factory

A singleton instance of this class should be created, and then used to produce KCL workers as needed.

Example:

val factory = new BridgeWorkerFactory(eventProcessor, bridgeConfiguration)
val worker = factory.instance()
val workerThread = new Thread(worker)

def start(): Unit = {
  workerThread.start()
}

def shutdown(): Unit = {
  worker.shutdown()
  workerThread.join(WORKER_THREAD_TIMEOUT_MILLIS)
}

The BridgeWorkerFactory can be instantiated with Guice, and have its configuration and processor injected automatically.

License

Copyright 2015 Gilt Groupe, Inc.

Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0

com.gilt

Gilt Tech

Versions

Version
0.0.8
0.0.7
0.0.6
0.0.5
0.0.4
0.0.3
0.0.2
0.0.1