Class MQConnection
java.lang.Object
com.axis.jenkins.plugins.eiffel.eiffelbroadcaster.MQConnection
- All Implemented Interfaces:
com.rabbitmq.client.ShutdownListener
,EventListener
Creates an MQ connection.
- Author:
- Isac Holm <isac.holm@axis..com>
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addMessageToQueue
(String exchange, String routingKey, com.rabbitmq.client.AMQP.BasicProperties props, byte[] body) Puts a message in the message queue.void
Clear the outstanding confirms list, useful when testing.void
Clears the queue of outbound events by discarding all events in it.com.rabbitmq.client.Connection
Gets the connection.static MQConnection
Gets the instance.Gets a snapshot of the current contents of the queue of outbound events.int
Get the number of currently outstanding confirms.void
initialize
(String name, Secret password, String uri, String vh) Initializes this instance with supplied values.void
shutdownCompleted
(com.rabbitmq.client.ShutdownSignalException cause)
-
Method Details
-
getQueueSnapshot
Gets a snapshot of the current contents of the queue of outbound events. -
clearQueue
public void clearQueue()Clears the queue of outbound events by discarding all events in it. -
getInstance
Gets the instance.- Returns:
- the instance
-
getSizeOutstandingConfirms
public int getSizeOutstandingConfirms()Get the number of currently outstanding confirms.- Returns:
- the number of currently outstanding confirms
-
clearOutstandingConfirms
public void clearOutstandingConfirms()Clear the outstanding confirms list, useful when testing. -
addMessageToQueue
public void addMessageToQueue(String exchange, String routingKey, com.rabbitmq.client.AMQP.BasicProperties props, byte[] body) Puts a message in the message queue.- Parameters:
exchange
- the exchange to publish the message toroutingKey
- the routing keyprops
- other properties for the message - routing headers etcbody
- the message body
-
getConnection
public com.rabbitmq.client.Connection getConnection()Gets the connection.- Returns:
- the connection.
-
initialize
Initializes this instance with supplied values.- Parameters:
name
- the user namepassword
- the user passworduri
- the server urivh
- the virtual host
-
shutdownCompleted
public void shutdownCompleted(com.rabbitmq.client.ShutdownSignalException cause) - Specified by:
shutdownCompleted
in interfacecom.rabbitmq.client.ShutdownListener
-