Created
October 9, 2013 21:56
-
-
Save JakubOboza/6909175 to your computer and use it in GitHub Desktop.
scala AMQP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| val params = new ConnectionParameters | |
| params.setUsername("guest") | |
| params.setPassword("guest") | |
| params.setVirtualHost("/") | |
| params.setRequestedHeartbeat(0) | |
| val factory = new ConnectionFactory(params) | |
| // Create a new instance of the string sender. | |
| // This sender will send messages to the "mult" exchange with a | |
| // routing key of "routeroute" | |
| val amqp = new StringAMQPSender( | |
| factory, "macbookpro", 5672, "mult", "example.demo" | |
| ) | |
| amqp.start | |
| /** | |
| * Salute the rabbit! | |
| */ | |
| def salute = amqp ! AMQPMessage("hey there!") | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment