Skip to content

gurkancakir/RabbitMQ

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

RabbitMQTest

Consumer

    QueueConsumer consumer = new QueueConsumer("log-messages");
    Thread consumerThread = new Thread(consumer);
    consumerThread.start();

Producer

    Producer producer = new Producer("log-messages");

    for (int i = 0; i < 100; i++) {
        HashMap message = new HashMap();
        message.put("message number", i);
        // Create new JSON Object
        JsonObject person = new JsonObject();
        person.addProperty("id", i);
        person.addProperty("test", "Gurkan");
        producer.sendMessage(person.toString());
        System.out.println("Message Number "+ i +" sent.");
    }

Releases

No releases published

Packages

No packages published

Languages