September 2017
Beginner to intermediate
360 pages
8h 13m
English
Once the RabbitMQ service is installed and it's up and running as can be verified from the RMQ, the management console's next obvious step is to write a quick publisher and consumer application. Following is the code snippet of the producer that publishes a message under an exchange called MYExchange on a queue called MyQueue.
package com.book.rmq; ... public class RMQProducer { private static String myRecord; private static final String EXCHANGE_NAME = "MYExchange"; private final static String QUEUE_NAME = "MYQueue"; private final static String ROUTING_KEY = "MYQueue"; public static void main(String[] argv) throws Exception { ConnectionFactory factory = new ConnectionFactory(); Address[] addressArr = { new ...Read now
Unlock full access