com.yahoo.bullet.dsl.connector.PulsarConnector Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bullet-dsl Show documentation
Show all versions of bullet-dsl Show documentation
This library provides a code-less way to get your data into Bullet without
The newest version!
/*
* Copyright 2018, Yahoo Inc.
* Licensed under the terms of the Apache License, Version 2.0.
* See the LICENSE file associated with the project for terms.
*/
package com.yahoo.bullet.dsl.connector;
import com.yahoo.bullet.common.BulletConfig;
import com.yahoo.bullet.dsl.BulletDSLConfig;
import com.yahoo.bullet.dsl.BulletDSLException;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import org.apache.pulsar.client.api.ClientBuilder;
import org.apache.pulsar.client.api.Consumer;
import org.apache.pulsar.client.api.Message;
import org.apache.pulsar.client.api.PulsarClient;
import org.apache.pulsar.client.api.PulsarClientException;
import org.apache.pulsar.client.api.Schema;
import java.lang.reflect.Constructor;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.TimeUnit;
/**
* A {@link BulletConnector} that reads and deserializes messages from Pulsar.
*/
@Slf4j
public class PulsarConnector extends BulletConnector {
private static final long serialVersionUID = 2958805692867790602L;
// Exposed for tests
@Getter(AccessLevel.PACKAGE)
private transient PulsarClient client;
@Setter(AccessLevel.PACKAGE)
private transient Consumer