drift-transport-spi

Annotation based Thrift implementation

License

License

Categories

Categories

Drift Net Networking
GroupId

GroupId

io.airlift.drift
ArtifactId

ArtifactId

drift-transport-spi
Last Version

Last Version

1.18
Release Date

Release Date

Type

Type

jar
Description

Description

drift-transport-spi
Annotation based Thrift implementation

Download drift-transport-spi

How to add to project

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

Dependencies

compile (7)

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
com.google.guava : guava jar 24.1-jre
io.airlift : configuration Optional jar 0.173
io.airlift : units Optional jar 1.3
javax.validation : validation-api Optional jar 1.1.0.Final

test (2)

Group / Artifact Type Version
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