drift-transport-apache

Annotation based Thrift implementation

License

License

Categories

Categories

Drift Net Networking
GroupId

GroupId

io.airlift.drift
ArtifactId

ArtifactId

drift-transport-apache
Last Version

Last Version

1.18
Release Date

Release Date

Type

Type

jar
Description

Description

drift-transport-apache
Annotation based Thrift implementation

Download drift-transport-apache

How to add to project

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

Dependencies

compile (14)

Group / Artifact Type Version
io.airlift.drift : drift-api jar 1.18
io.airlift.drift : drift-codec jar 1.18
io.airlift.drift : drift-protocol jar 1.18
io.airlift.drift : drift-transport-spi jar 1.18
com.google.guava : guava jar 24.1-jre
com.google.inject : guice Optional jar 4.2.0
io.airlift : configuration jar 0.173
io.airlift : concurrent jar 0.173
io.airlift : security jar 0.173
io.airlift : units jar 1.3
javax.inject : javax.inject Optional jar 1
javax.validation : validation-api Optional jar 1.1.0.Final
org.apache.thrift : libthrift jar 0.12.0
javax.annotation : javax.annotation-api jar 1.3.1

test (3)

Group / Artifact Type Version
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
1.4
1.3
1.2
1.1
1.0