public class RabbitMQUtils extends Object
Constructor and Description |
---|
RabbitMQUtils() |
Modifier and Type | Method and Description |
---|---|
static String |
buildMessage(com.rabbitmq.client.AMQP.BasicProperties properties,
byte[] body,
org.apache.axis2.context.MessageContext msgContext)
Build SOAP envelop from AMQP properties and byte body
|
static com.rabbitmq.client.Connection |
createConnection(com.rabbitmq.client.ConnectionFactory factory,
com.rabbitmq.client.Address[] addresses)
Create a connection from given connection factory and address array
|
static void |
declareExchange(com.rabbitmq.client.Channel channel,
String exchangeName,
Map<String,String> properties)
Helper method to declare exchange when direct channel is given
|
static void |
declareQueue(com.rabbitmq.client.Channel channel,
String queueName,
Map<String,String> properties)
Helper method to declare queue when direct channel is given
|
static Map<String,String> |
getTransportHeaders(com.rabbitmq.client.AMQP.BasicProperties properties)
Get transport headers from the rabbitmq message
|
static boolean |
isAutoDeleteExchange(Map<String,String> properties) |
static boolean |
isAutoDeleteQueue(Map<String,String> properties) |
static boolean |
isDurableExchange(Map<String,String> properties) |
static boolean |
isDurableQueue(Map<String,String> properties) |
static boolean |
isExclusiveQueue(Map<String,String> properties) |
public static com.rabbitmq.client.Connection createConnection(com.rabbitmq.client.ConnectionFactory factory, com.rabbitmq.client.Address[] addresses) throws IOException
factory
- a ConnectionFactory
objectaddresses
- a Address
objectConnection
objectIOException
public static Map<String,String> getTransportHeaders(com.rabbitmq.client.AMQP.BasicProperties properties)
properties
- the AMQP basic propertiespublic static void declareQueue(com.rabbitmq.client.Channel channel, String queueName, Map<String,String> properties) throws IOException
channel
- a rabbitmq channelqueueName
- a name of the queue to declareproperties
- queue declaration propertiesIOException
public static void declareExchange(com.rabbitmq.client.Channel channel, String exchangeName, Map<String,String> properties) throws IOException
channel
- Channel
objectexchangeName
- the exchange exchangeNameproperties
- RabbitMQ propertiesIOException
public static String buildMessage(com.rabbitmq.client.AMQP.BasicProperties properties, byte[] body, org.apache.axis2.context.MessageContext msgContext) throws org.apache.axis2.AxisFault
properties
- the AMQP basic propertiesbody
- the message bodymsgContext
- the message contextorg.apache.axis2.AxisFault
Copyright © 2022 WSO2. All rights reserved.