rabbitmq学习
创建rabbitMQ的连接 public class ConnectionUtil { public static Connection getConnection ( ) throws IOException , TimeoutException { ConnectionFactory connectionFactory = new ConnectionFactory ( ) ; //设置服务器地址 connectionFactory . setHost ( "127.0.0.1" ) ; //设置端口 connectionFactory . setPort ( 5672 ) ; //设置vHost 就相当于mysql的数据库名 connectionFactory . setVirtualHost ( "/vhost_admin" ) ; //设置用户名 connectionFactory . setUsername ( "admin" ) ; connectionFactory . setPassword ( "admin" ) ; return connectionFactory . newConnection ( ) ; } } 简单队列 生产者 public class Send { public static final String QUEUE_NAME =