public final class MQConnection extends Object implements com.rabbitmq.client.ShutdownListener
| Modifier and Type | Method and Description |
|---|---|
void |
addMessageToQueue(String exchange,
String routingKey,
com.rabbitmq.client.AMQP.BasicProperties props,
byte[] body)
Puts a message in the message queue.
|
void |
clearOutstandingConfirms()
Clear the outstanding confirms list, useful when testing.
|
com.rabbitmq.client.Connection |
getConnection()
Gets the connection.
|
static MQConnection |
getInstance()
Gets the instance.
|
int |
getSizeOutstandingConfirms()
Get the number of currently outstanding confirms.
|
void |
initialize(String name,
Secret password,
String uri,
String vh)
Initializes this instance with supplied values.
|
void |
publish(net.sf.json.JSONObject json)
Publish json message on configured MQ server.
|
void |
shutdownCompleted(com.rabbitmq.client.ShutdownSignalException cause) |
public static MQConnection getInstance()
public int getSizeOutstandingConfirms()
public void clearOutstandingConfirms()
public void addMessageToQueue(String exchange, String routingKey, com.rabbitmq.client.AMQP.BasicProperties props, byte[] body)
exchange - the exchange to publish the message toroutingKey - the routing keyprops - other properties for the message - routing headers etcbody - the message bodypublic void publish(net.sf.json.JSONObject json)
json - the message in json formatpublic com.rabbitmq.client.Connection getConnection()
public void initialize(String name, Secret password, String uri, String vh)
name - the user namepassword - the user passworduri - the server urivh - the virtual hostpublic void shutdownCompleted(com.rabbitmq.client.ShutdownSignalException cause)
shutdownCompleted in interface com.rabbitmq.client.ShutdownListenerCopyright © 2016–2022. All rights reserved.