Skip to content

Instantly share code, notes, and snippets.

@dalmat36
Created August 17, 2015 20:52
Show Gist options
  • Save dalmat36/1733095275fccc2fcd93 to your computer and use it in GitHub Desktop.
Save dalmat36/1733095275fccc2fcd93 to your computer and use it in GitHub Desktop.
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