Created
July 12, 2013 12:45
-
-
Save mwacc/5984183 to your computer and use it in GitHub Desktop.
rabbitmq sample
This file contains 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
/* | |
<dependencies> | |
<dependency> | |
<groupId>com.rabbitmq</groupId> | |
<artifactId>amqp-client</artifactId> | |
<version>3.1.1</version> | |
</dependency> | |
</dependencies> | |
*/ | |
ConnectionFactory factory = new ConnectionFactory(); | |
factory.setUri("amqp://test:test@my.test"); | |
Connection connection = factory.newConnection(); | |
final Channel ngnixChannel = connection.createChannel(); | |
final Channel visaChannel = connection.createChannel(); | |
// queue, durable, exclusive, autoDelete, arguments | |
ngnixChannel.queueDeclare(MY_QUEUE_NAME, true, false, false, null); | |
ngnixChannel.basicPublish("", NGNIX_QUEUE_NAME, null, logProducer.getLog().getBytes()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment