Skip to content

Instantly share code, notes, and snippets.

@JakubOboza
Created October 9, 2013 21:56
Show Gist options
  • Select an option

  • Save JakubOboza/6909175 to your computer and use it in GitHub Desktop.

Select an option

Save JakubOboza/6909175 to your computer and use it in GitHub Desktop.
scala AMQP
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