drift-server

Annotation based Thrift implementation

License

License

Categories

Categories

Drift Net Networking
GroupId

GroupId

io.airlift.drift
ArtifactId

ArtifactId

drift-server
Last Version

Last Version

1.18
Release Date

Release Date

Type

Type

jar
Description

Description

drift-server
Annotation based Thrift implementation

Download drift-server

How to add to project

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

Dependencies

compile (11)

Group / Artifact Type Version
io.airlift.drift : drift-api jar 1.18
io.airlift.drift : drift-codec jar 1.18
io.airlift.drift : drift-transport-spi jar 1.18
com.google.inject : guice Optional jar 4.2.0
com.google.guava : guava jar 24.1-jre
io.airlift : configuration jar 0.173
io.airlift : stats jar 0.173
io.airlift : units jar 1.3
javax.annotation : javax.annotation-api jar 1.3.1
javax.inject : javax.inject Optional jar 1
org.weakref : jmxutils jar 1.19

test (4)

Group / Artifact Type Version
io.airlift : bootstrap jar 0.173
io.airlift : jmx jar 0.173
io.airlift : testing jar 0.173
org.testng : testng jar 6.9.6

Project Modules

There are no modules declared in this project.

Drift

Maven Central Build Status

Drift is an easy-to-use, annotation-based Java library for creating Thrift clients and serializable types. The client library is similar to JAX-RS (HTTP Rest) and the serialization library is similar to JaxB (XML) and Jackson (JSON), but for Thrift.

Example

The following interface defines a client for a Scribe server:

@ThriftService
public interface Scribe
{
    @ThriftMethod
    ResultCode log(List<LogEntry> messages);
}

The log method above uses the LogEntry Thrift struct which is defined as follows:

@ThriftStruct
public class LogEntry
{
    private final String category;
    private final String message;

    @ThriftConstructor
    public LogEntry(String category, String message)
    {
        this.category = category;
        this.message = message;
    }

    @ThriftField(1)
    public String getCategory()
    {
        return category;
    }

    @ThriftField(2)
    public String getMessage()
    {
        return message;
    }
}

An instance of the Scribe client can be created using a DriftClientFactory:

// create a client
Scribe scribe = clientFactory.createDriftClient(Scribe.class);

// use client
scribe.log(Arrays.asList(new LogEntry("category", "message")));

Detailed Documentation

io.airlift.drift

Versions

Version
1.18
1.17
1.16
1.15
1.14
1.13
1.12
1.11
1.10
1.9
1.8
1.7
1.6
1.5