All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.quarkus.grpc.runtime.supports.CompressionInterceptor Maven / Gradle / Ivy

There is a newer version: 3.15.1
Show newest version
package io.quarkus.grpc.runtime.supports;

import io.grpc.Metadata;
import io.grpc.ServerCall;
import io.grpc.ServerCallHandler;
import io.grpc.ServerInterceptor;

public class CompressionInterceptor implements ServerInterceptor {

    private final String compression;

    public CompressionInterceptor(String compression) {
        if (compression == null) {
            throw new NullPointerException("Compression cannot be null");
        }
        this.compression = compression;
    }

    @Override
    public  ServerCall.Listener interceptCall(
            ServerCall call,
            Metadata headers,
            ServerCallHandler next) {
        call.setCompression(compression);
        return next.startCall(call, headers);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy