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

pl.allegro.tech.hermes.consumers.consumer.sender.http.DefaultSendingResultHandlers Maven / Gradle / Ivy

There is a newer version: 2.8.0
Show newest version
package pl.allegro.tech.hermes.consumers.consumer.sender.http;

import org.eclipse.jetty.client.ContentResponse;
import org.eclipse.jetty.client.Response;
import pl.allegro.tech.hermes.consumers.consumer.sender.MessageSendingResult;
import pl.allegro.tech.hermes.consumers.consumer.sender.SingleMessageSendingResult;

import java.util.concurrent.CompletableFuture;

public class DefaultSendingResultHandlers implements SendingResultHandlers {
    @Override
    public Response.CompleteListener handleSendingResultForSerial(CompletableFuture resultFuture) {
        return new JettyResponseListener(resultFuture);
    }

    @Override
    public Response.CompleteListener handleSendingResultForBroadcast(CompletableFuture resultFuture) {
        return new JettyBroadCastResponseListener(resultFuture);
    }

    @Override
    public MessageSendingResult handleSendingResultForBatch(ContentResponse response) {
        return MessageSendingResult.ofStatusCode(response.getStatus());
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy