public class RMQConnector extends java.lang.Object implements Connector
Modifier and Type | Field and Description |
---|---|
protected boolean |
isAuto |
protected boolean |
isDurable |
protected boolean |
isPassive |
protected java.lang.String |
operation |
protected java.lang.String |
password |
static int |
RMQ_DIRECT |
static int |
RMQ_FANOUT |
static int |
RMQ_HEADERS |
static int |
RMQ_TOPIC |
protected java.lang.String |
username |
Constructor and Description |
---|
RMQConnector(java.util.Map props)
Creates new RMQConnector
|
Modifier and Type | Method and Description |
---|---|
void |
ack(long deliveryTag)
acknowledges the RabbitMQ msgs only
|
void |
close() |
java.lang.String |
exchangeBind(java.lang.String target,
java.lang.String name,
java.lang.String key) |
java.lang.String |
exchangeDeclare(java.lang.String name,
java.lang.String type,
boolean duable) |
java.lang.String |
exchangeDelete(java.lang.String name) |
boolean |
exchangeExists(java.lang.String name) |
java.lang.String |
exchangeUnbind(java.lang.String target,
java.lang.String name,
java.lang.String key) |
byte[] |
get(boolean autoAck,
long timeout,
java.util.Map<java.lang.String,java.lang.String> props)
It waits for a message up to timeout in ms.
|
byte[] |
get(long timeout,
java.util.Map<java.lang.String,java.lang.String> props) |
com.rabbitmq.client.QueueingConsumer |
getConsumer(boolean ack) |
java.lang.String |
getDestination() |
java.lang.String |
getExchange() |
int |
getExchangeType() |
java.lang.String |
getURI() |
java.lang.String |
getVirtualHost() |
boolean |
isConnected() |
static void |
main(java.lang.String[] args) |
void |
pub(java.lang.String key,
com.rabbitmq.client.AMQP.BasicProperties props,
byte[] buff) |
void |
pub(java.lang.String key,
com.rabbitmq.client.AMQP.BasicProperties props,
java.lang.String msgStr) |
java.lang.String |
queueBind(java.lang.String queue,
java.lang.String name,
java.lang.String key) |
java.lang.String |
queueDeclare(java.lang.String name,
boolean durable) |
java.lang.String |
queueDelete(java.lang.String name) |
boolean |
queueExists(java.lang.String name) |
java.lang.String |
queueUnbind(java.lang.String queue,
java.lang.String name,
java.lang.String key) |
java.lang.String |
reconnect()
It reconnects and returns null or error message upon failure
|
protected java.lang.String username
protected java.lang.String password
protected java.lang.String operation
protected boolean isDurable
protected boolean isAuto
protected boolean isPassive
public static final int RMQ_DIRECT
public static final int RMQ_FANOUT
public static final int RMQ_TOPIC
public static final int RMQ_HEADERS
public byte[] get(long timeout, java.util.Map<java.lang.String,java.lang.String> props) throws java.io.IOException
java.io.IOException
public byte[] get(boolean autoAck, long timeout, java.util.Map<java.lang.String,java.lang.String> props) throws java.io.IOException
java.io.IOException
public void pub(java.lang.String key, com.rabbitmq.client.AMQP.BasicProperties props, byte[] buff) throws java.io.IOException
java.io.IOException
public void pub(java.lang.String key, com.rabbitmq.client.AMQP.BasicProperties props, java.lang.String msgStr) throws java.io.IOException
java.io.IOException
public boolean exchangeExists(java.lang.String name)
public boolean queueExists(java.lang.String name)
public java.lang.String exchangeDeclare(java.lang.String name, java.lang.String type, boolean duable)
public java.lang.String exchangeDelete(java.lang.String name)
public java.lang.String exchangeBind(java.lang.String target, java.lang.String name, java.lang.String key)
public java.lang.String exchangeUnbind(java.lang.String target, java.lang.String name, java.lang.String key)
public java.lang.String queueBind(java.lang.String queue, java.lang.String name, java.lang.String key)
public java.lang.String queueUnbind(java.lang.String queue, java.lang.String name, java.lang.String key)
public java.lang.String queueDeclare(java.lang.String name, boolean durable)
public java.lang.String queueDelete(java.lang.String name)
public com.rabbitmq.client.QueueingConsumer getConsumer(boolean ack) throws java.io.IOException
java.io.IOException
public boolean isConnected()
isConnected
in interface Connector
public java.lang.String reconnect()
public void ack(long deliveryTag) throws java.io.IOException
java.io.IOException
public java.lang.String getVirtualHost()
public java.lang.String getExchange()
public java.lang.String getDestination()
public int getExchangeType()
public static void main(java.lang.String[] args)