Package core.apiCore.interfaces
Class RabbitMqInterface
- java.lang.Object
-
- core.apiCore.interfaces.RabbitMqInterface
-
public class RabbitMqInterface extends Object
- Author:
- ehsan.matean
-
-
Field Summary
Fields Modifier and Type Field Description static com.rabbitmq.client.Channelchannelstatic com.rabbitmq.client.Connectionconnectionstatic StringRABBIT_MQ_DECLARE_QUEUEstatic StringRABBIT_MQ_EXCHANGEstatic StringRABBIT_MQ_EXCHANGE_TYPEstatic StringRABBIT_MQ_HOSTstatic StringRABBIT_MQ_MESSAGE_ID_PREFIXstatic StringRABBIT_MQ_OUTBOUND_EXCHANGEstatic StringRABBIT_MQ_OUTBOUND_QUEUEstatic StringRABBIT_MQ_PASSstatic StringRABBIT_MQ_PORTstatic StringRABBIT_MQ_QUEUEstatic StringRABBIT_MQ_QUEUE_DURABLEstatic StringRABBIT_MQ_USERstatic StringRABBIT_MQ_VIRTUAL_HOST
-
Constructor Summary
Constructors Constructor Description RabbitMqInterface()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidcloseConnection()close connectionstatic voidconnectRabbitMq(ServiceObject serviceObject)static voidevaluateOption(ServiceObject serviceObject)static com.rabbitmq.client.AMQP.BasicPropertiesevaluateRequestHeaders(ServiceObject serviceObject)static voidgetBatchMessages(String queueName, int maxMessages)attempt to get a number of messages from the queuestatic voidgetOutboundMessages()gets message from outbound queue Adds messages to ouboutMessage hashmapstatic voidsendRabbitMqMessage(ServiceObject serviceObject, String messageId)send rabbitMq messagestatic voidtestRabbitMqInterface(ServiceObject serviceObject)interface for database calls
-
-
-
Field Detail
-
RABBIT_MQ_HOST
public static final String RABBIT_MQ_HOST
- See Also:
- Constant Field Values
-
RABBIT_MQ_PORT
public static final String RABBIT_MQ_PORT
- See Also:
- Constant Field Values
-
RABBIT_MQ_VIRTUAL_HOST
public static final String RABBIT_MQ_VIRTUAL_HOST
- See Also:
- Constant Field Values
-
RABBIT_MQ_USER
public static final String RABBIT_MQ_USER
- See Also:
- Constant Field Values
-
RABBIT_MQ_PASS
public static final String RABBIT_MQ_PASS
- See Also:
- Constant Field Values
-
RABBIT_MQ_EXCHANGE
public static final String RABBIT_MQ_EXCHANGE
- See Also:
- Constant Field Values
-
RABBIT_MQ_OUTBOUND_EXCHANGE
public static final String RABBIT_MQ_OUTBOUND_EXCHANGE
- See Also:
- Constant Field Values
-
RABBIT_MQ_EXCHANGE_TYPE
public static final String RABBIT_MQ_EXCHANGE_TYPE
- See Also:
- Constant Field Values
-
RABBIT_MQ_QUEUE
public static final String RABBIT_MQ_QUEUE
- See Also:
- Constant Field Values
-
RABBIT_MQ_OUTBOUND_QUEUE
public static final String RABBIT_MQ_OUTBOUND_QUEUE
- See Also:
- Constant Field Values
-
RABBIT_MQ_QUEUE_DURABLE
public static final String RABBIT_MQ_QUEUE_DURABLE
- See Also:
- Constant Field Values
-
RABBIT_MQ_DECLARE_QUEUE
public static final String RABBIT_MQ_DECLARE_QUEUE
- See Also:
- Constant Field Values
-
RABBIT_MQ_MESSAGE_ID_PREFIX
public static final String RABBIT_MQ_MESSAGE_ID_PREFIX
- See Also:
- Constant Field Values
-
connection
public static com.rabbitmq.client.Connection connection
-
channel
public static com.rabbitmq.client.Channel channel
-
-
Method Detail
-
testRabbitMqInterface
public static void testRabbitMqInterface(ServiceObject serviceObject) throws Exception
interface for database calls- Parameters:
serviceObject-- Throws:
Exception
-
connectRabbitMq
public static void connectRabbitMq(ServiceObject serviceObject)
- Throws:
Exception
-
sendRabbitMqMessage
public static void sendRabbitMqMessage(ServiceObject serviceObject, String messageId)
send rabbitMq message- Parameters:
apiObject-
-
evaluateRequestHeaders
public static com.rabbitmq.client.AMQP.BasicProperties evaluateRequestHeaders(ServiceObject serviceObject)
-
evaluateOption
public static void evaluateOption(ServiceObject serviceObject)
-
closeConnection
public static void closeConnection()
close connection
-
getOutboundMessages
public static void getOutboundMessages() throws Exceptiongets message from outbound queue Adds messages to ouboutMessage hashmap- Parameters:
receiver-- Throws:
Exception
-
-