redhat 6.4 64位rabbitmq安装
来源:互联网 发布:联通3g拨号软件 编辑:程序博客网 时间:2024/06/02 03:13
参考:http://www.rabbitmq.com/install-rpm.html
1.安装Erlang,参考上面Install monolithic Erlang from VMware,从VMware下载erlang-R15B-02.1.el6.x86_64.rpm,然后直接
rpm -ivh erlang-R15B-02.1.el6.x86_64.rpm
2.安装rabbitmq-server.
a.先下载rabbitmq-server:http://www.rabbitmq.com/releases/rabbitmq-server/v3.4.1/rabbitmq-server-3.4.1-1.noarch.rpm
b.再执行:rpm --import http://www.rabbitmq.com/rabbitmq-signing-key-public.asc
c.最后执行:yum install rabbitmq-server-3.4.1-1.noarch.rpm
3.根据需要配置(配置可默认,即此步可省略)
4.管理
a.开机启动:chkconfig rabbitmq-server on.
b.启动:/sbin/service rabbitmq-server start
使用guest远程连接rabbitmq-server.要开启权限,详细参考https://www.rabbitmq.com/access-control.html.
只需要rabbitmq.config添加[{rabbit, [{loopback_users, []}]}].
1.安装Erlang,参考上面Install monolithic Erlang from VMware,从VMware下载erlang-R15B-02.1.el6.x86_64.rpm,然后直接
rpm -ivh erlang-R15B-02.1.el6.x86_64.rpm
2.安装rabbitmq-server.
a.先下载rabbitmq-server:http://www.rabbitmq.com/releases/rabbitmq-server/v3.4.1/rabbitmq-server-3.4.1-1.noarch.rpm
b.再执行:rpm --import http://www.rabbitmq.com/rabbitmq-signing-key-public.asc
c.最后执行:yum install rabbitmq-server-3.4.1-1.noarch.rpm
3.根据需要配置(配置可默认,即此步可省略)
4.管理
a.开机启动:chkconfig rabbitmq-server on.
b.启动:/sbin/service rabbitmq-server start
c.停止:/sbin/service rabbitmq-server stop
spring AMQP入门测试:
1.pom.xml.主要依赖
<dependencies> <dependency> <groupId>org.springframework.amqp</groupId> <artifactId>spring-rabbit</artifactId> <version>1.4.0.RC1</version> </dependency></dependencies><repositories> <repository> <id>spring-milestones</id> <name>Spring Milestones</name> <url>http://repo.spring.io/milestone</url> <snapshots> <enabled>false</enabled> </snapshots> </repository></repositories>2.RabbitConfiguration.java.CachingConnectionFactory默认host是localhost,port是5672,username是guest,password是guest.
使用guest远程连接rabbitmq-server.要开启权限,详细参考https://www.rabbitmq.com/access-control.html.
只需要rabbitmq.config添加[{rabbit, [{loopback_users, []}]}].
package com.exam.config;import org.springframework.amqp.core.AmqpAdmin;import org.springframework.amqp.core.Queue;import org.springframework.amqp.rabbit.connection.CachingConnectionFactory;import org.springframework.amqp.rabbit.connection.ConnectionFactory;import org.springframework.amqp.rabbit.core.RabbitAdmin;import org.springframework.amqp.rabbit.core.RabbitTemplate;import org.springframework.context.annotation.Bean;import org.springframework.context.annotation.Configuration;/** * Created by xin on 14/11/3. */@Configurationpublic class RabbitConfiguration { @Bean public ConnectionFactory connectionFactory() { CachingConnectionFactory connectionFactory = new CachingConnectionFactory("192.168.1.118"); return connectionFactory; } @Bean public AmqpAdmin amqpAdmin() { return new RabbitAdmin(connectionFactory()); } @Bean public RabbitTemplate rabbitTemplate() { return new RabbitTemplate(connectionFactory()); } @Bean public Queue myQueue() { return new Queue("myqueue"); }}3.RabbitConfigurationTest.java.运行main方法查看测试结果(不要忘了启动rabbitmq-server,也不要让防火墙困扰了).
package com.exam.config;import org.springframework.amqp.core.AmqpTemplate;import org.springframework.context.ApplicationContext;import org.springframework.context.annotation.AnnotationConfigApplicationContext;/** * Created by xin on 14/11/3. */public class RabbitConfigurationTest { public static void main(String[] args) { ApplicationContext context = new AnnotationConfigApplicationContext(RabbitConfiguration.class); AmqpTemplate template = context.getBean(AmqpTemplate.class); template.convertAndSend("myqueue", "foo"); String foo = (String) template.receiveAndConvert("myqueue"); System.out.println(foo); }}
0 0
- redhat 6.4 64位rabbitmq安装
- redhat 7.0 64位安装rabbitmq问题说明
- RedHat 安装RabbitMQ
- mysql redhat 64位 安装
- RedHat 6.4 64位 图文安装Oracle 11g
- redhat enterprise linux 6.4 64位系统安装oracle11g,笔记
- redhat enterprise linux 6.4 64位系统安装sybase
- Windows 64位 RabbitMQ 安装配置
- redhat 6.0 gcc 64位 注意事项安装
- Redhat 64位系统安装Nginx服务器
- 64位redhat编译执行32位c++程序(redhat安装centos源)
- redhat下安装oracle64位
- 64位 CentOS 6.2 安装erlang及rabbitmq Server
- 11.2.0.4安装环境准备for redhat as 6.4 64位
- Redhat En Linux 5.4-64位安装SVN服务器
- 快速安装oracle10g r2在redhat 64位
- VMware安装RedHat 6(64位)报错问题
- redhat 6.3 64位安装中文输入法全过程记录
- java西天取经之路(四)JSP标签库 【EL和JSTL】
- 二叉树的遍历及线索二叉树
- 和大家分享下我的找工作历程。
- 和大家分享下我的找工作历程。续
- Java回调的实现
- redhat 6.4 64位rabbitmq安装
- QTabWidget简例/简介及各种问题
- 百家樂包殺平台
- 百家乐正网合作
- 佰家樂合作平台
- URAL - 1966 - Cycling Roads(并查集 + 判线段相交)
- hdu 2824 Dogs(BFS, 优先队列优化)
- [Leetcode]Path Sum&Path Sum II
- FlaskBB阅读笔记(一)