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

io.latent.storm.rabbitmq.config.ConsumerConfigBuilder Maven / Gradle / Ivy

There is a newer version: 1.0.0
Show newest version
package io.latent.storm.rabbitmq.config;

public final class ConsumerConfigBuilder
{
  private ConnectionConfig connectionConfig;
  private int prefetchCount;
  private String queueName;
  private boolean requeueOnFail;

  public ConsumerConfigBuilder()
  {
  }

  public ConsumerConfigBuilder connection(ConnectionConfig connection) {
    this.connectionConfig = connection;
    return this;
  }

  public ConsumerConfigBuilder prefetch(int prefetch) {
    this.prefetchCount = prefetch;
    return this;
  }

  public ConsumerConfigBuilder queue(String queue) {
    this.queueName = queue;
    return this;
  }

  public ConsumerConfigBuilder requeueOnFail() {
    this.requeueOnFail = true;
    return this;
  }

  public ConsumerConfig build() {
    return new ConsumerConfig(connectionConfig, prefetchCount, queueName, requeueOnFail);
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy