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

poussecafe.pulsar.PulsarClientFactory Maven / Gradle / Ivy

There is a newer version: 0.13.0
Show newest version
package poussecafe.pulsar;

import java.util.Objects;
import java.util.concurrent.TimeUnit;
import org.apache.pulsar.client.api.PulsarClient;
import org.apache.pulsar.client.api.PulsarClientException;

public class PulsarClientFactory {

    public PulsarClientFactory(PulsarMessagingConfiguration configuration) {
        Objects.requireNonNull(configuration);
        this.configuration = configuration;
    }

    private PulsarMessagingConfiguration configuration;

    public PulsarClient build() throws PulsarClientException {
        return PulsarClient.builder()
                .serviceUrl(configuration.brokerUrl())
                .statsInterval(configuration.statsInterval().toSeconds(), TimeUnit.SECONDS)
                .build();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy