- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHello.java
More file actions
Latest commit
19 lines (15 loc) · 537 Bytes
/
Copy pathHello.java
File metadata and controls
19 lines (15 loc) · 537 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/**
* Created by sameerraghuram on 4/21/17.
*/
publicclassHello {
publicstaticvoidmain(String[] args) {
// Create a connection
Connectionconn = newConnection("newavalon.cs.rit.edu");
// Create the chat queue
conn.createQueue("sample_queue");
// Subscribe by providing a lambda function as callback !
conn.subscribe("sample_queue", msg -> System.out.println("Received" + msg));
// Publish a message to the queue
conn.publish("Test", "Hello World!");
}
}