Foxtrot Client Library

Foxtrot client library for ingesting events into foxtrot

License

License

Categories

Categories

CLI User Interface ORM Data
GroupId

GroupId

io.appform.foxtrot
ArtifactId

ArtifactId

foxtrot-client
Last Version

Last Version

3.1
Release Date

Release Date

Type

Type

jar
Description

Description

Foxtrot Client Library
Foxtrot client library for ingesting events into foxtrot
Project URL

Project URL

https://github.com/appform-io/foxtrot-client
Source Code Management

Source Code Management

https://github.com/appform-io/foxtrot-client

Download foxtrot-client

How to add to project

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

Dependencies

compile (10)

Group / Artifact Type Version
com.google.guava : guava jar 19.0
com.netflix.feign : feign-okhttp jar 8.15.1
com.netflix.feign : feign-slf4j jar 8.15.1
com.netflix.feign : feign-jackson jar 8.15.1
org.hibernate : hibernate-validator jar 5.1.3.Final
com.bluejeans : bigqueue jar 1.7.0.6
org.apache.commons : commons-lang3 jar 3.4
org.slf4j : slf4j-api jar 1.7.6
com.netflix.feign : feign-core jar 8.15.1
com.squareup.okhttp : okhttp jar 2.7.0

provided (1)

Group / Artifact Type Version
com.fasterxml.jackson.core : jackson-databind jar 2.6.3

test (3)

Group / Artifact Type Version
ch.qos.logback : logback-classic jar 1.1.2
junit : junit jar 4.12
com.github.tomakehurst : wiremock jar 1.58

Project Modules

There are no modules declared in this project.

Foxtrot Client Travis build status

This libary is a smart client to the Foxtrot event storage and analytics framework.

  • Uses service discovery to find foxtrot nodes
  • Maintains connection pool to individual nodes
  • Maintains local cache of nodes
  • Provides configurable node selectors to send a message
  • Provides multiple types of event senders:
    • Synchronous event sender. It sends one or more events directly to Foxtrot.
    • Queued event sender.
      • Uses a persistent disk based queue.
      • Uses a syncronous sender on a separate thread to batch and send events to Foxtrot.

Usage

Use the following repository in your pom.xml:

<repository>
    <id>clojars</id>
    <name>Clojars repository</name>
    <url>https://clojars.org/repo</url>
</repository>

Use the following maven dependency:

<dependency>
  <groupId>com.flipkart.foxtrot</groupId>
  <artifactId>foxtrot-client</artifactId>
  <version>0.2.2</version>
</dependency>

Show me the code

Initialize the Client like this:

FoxtrotClientConfig config = new FoxtrotClientConfig();
config.setTable("test");                           //Your foxtrot table name
config.setLocalQueuePath("/tmp/foxtrot-messages"); //Giving this path means it will use the queued sender
config.setHost("foxtrot.yourdomain.com");          //Load balancer hostname/ip
config.setPort(80);                                //Load balancer port

FoxtrotClient foxtrotClient = new FoxtrotClient(config);

Send events:

foxtrotClient.send(
                    new Document(
                                UUID.randomUUID().toString(),             //ID
                                System.currentTimeMillis(),               //Timestamp
                                new ObjectNode(nodeFactory)               //Data
                                        .put("testField", "Santanu Sinha") 
                    )
);

Close when done (program stop):

foxtrotClient.close();

Versions

Version
3.1
3.0