Created
August 17, 2015 20:52
-
-
Save dalmat36/1733095275fccc2fcd93 to your computer and use it in GitHub Desktop.
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
package springampqtest; | |
import org.springframework.amqp.rabbit.connection.CachingConnectionFactory; | |
import org.springframework.amqp.rabbit.core.RabbitTemplate; | |
public class Main { | |
public static void main(String[] args) throws Exception { | |
CachingConnectionFactory connectionFactory = new CachingConnectionFactory("hostName"); | |
connectionFactory.setUsername("guest"); | |
connectionFactory.setPassword("guest"); | |
RabbitTemplate template = new RabbitTemplate(connectionFactory); | |
template.convertAndSend("mattTestExchange", "mattTestRoutingKey", "test message"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment