public class NSQProducer extends Object
| Constructor and Description |
|---|
NSQProducer() |
| Modifier and Type | Method and Description |
|---|---|
NSQProducer |
addAddress(String host,
int port) |
protected Connection |
getConnection() |
protected ExecutorService |
getExecutor() |
org.apache.commons.pool2.impl.GenericKeyedObjectPool<ServerAddress,Connection> |
getPool() |
void |
produce(String topic,
byte[] message) |
void |
produceMulti(String topic,
List<byte[]> messages)
produce multiple messages.
|
NSQProducer |
removeAddress(String host,
int port) |
NSQProducer |
setConfig(NSQConfig config) |
NSQProducer |
setExecutor(ExecutorService executor)
This is the executor where the callbacks happen.
|
NSQProducer |
setPoolConfig(org.apache.commons.pool2.impl.GenericKeyedObjectPoolConfig poolConfig) |
void |
shutdown() |
NSQProducer |
start() |
public NSQProducer start()
protected Connection getConnection() throws NoConnectionsException
NoConnectionsExceptionpublic void produceMulti(String topic, List<byte[]> messages) throws TimeoutException, NSQException
TimeoutExceptionNSQExceptionpublic void produce(String topic, byte[] message) throws NSQException, TimeoutException
NSQExceptionTimeoutExceptionpublic NSQProducer addAddress(String host, int port)
public NSQProducer removeAddress(String host, int port)
public NSQProducer setPoolConfig(org.apache.commons.pool2.impl.GenericKeyedObjectPoolConfig poolConfig)
public NSQProducer setExecutor(ExecutorService executor)
executor - public NSQProducer setConfig(NSQConfig config)
protected ExecutorService getExecutor()
public org.apache.commons.pool2.impl.GenericKeyedObjectPool<ServerAddress,Connection> getPool()
public void shutdown()
Copyright © 2017. All rights reserved.