pl.allegro.tech.hermes.consumers.consumer.sender.http.DefaultSendingResultHandlers Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hermes-consumers Show documentation
Show all versions of hermes-consumers Show documentation
Fast and reliable message broker built on top of Kafka.
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