Package adams.core.net.rabbitmq
Class RabbitMQHelper
- java.lang.Object
-
- adams.core.net.rabbitmq.RabbitMQHelper
-
public class RabbitMQHelper extends Object
Helper class for RabbitMQ operations.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
-
-
Constructor Summary
Constructors Constructor Description RabbitMQHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
closeQuietly(com.rabbitmq.client.Channel channel)
Closes the channel.static void
closeQuietly(com.rabbitmq.client.Connection connection)
Closes the connection.static void
closeQuietly(com.rabbitmq.client.Connection connection, List<String> queues)
Closes the connection and deletes any auto-created queues.static com.rabbitmq.client.Channel
createChannel(adams.core.logging.LoggingSupporter logging, com.rabbitmq.client.Connection connection, int prefetchCount)
Creates a new channel and returns it.static com.rabbitmq.client.Channel
createChannel(com.rabbitmq.client.Connection connection, int prefetchCount)
Creates a new channel and returns it.
-
-
-
Method Detail
-
createChannel
public static com.rabbitmq.client.Channel createChannel(com.rabbitmq.client.Connection connection, int prefetchCount)
Creates a new channel and returns it.- Parameters:
connection
- the connection to useprefetchCount
- how many jobs a client can pull off queue before having to ack them, 0 is unlimited- Returns:
- the channel, null if failed to create or no connection available
-
createChannel
public static com.rabbitmq.client.Channel createChannel(adams.core.logging.LoggingSupporter logging, com.rabbitmq.client.Connection connection, int prefetchCount)
Creates a new channel and returns it.- Parameters:
logging
- for logging errorsconnection
- the connection to useprefetchCount
- how many jobs a client can pull off queue before having to ack them, 0 is unlimited- Returns:
- the channel, null if failed to create or no connection available
-
closeQuietly
public static void closeQuietly(com.rabbitmq.client.Channel channel)
Closes the channel.- Parameters:
channel
- the channel to close, can be null
-
closeQuietly
public static void closeQuietly(com.rabbitmq.client.Connection connection)
Closes the connection.- Parameters:
connection
- the connection to close
-
-