git項目地址react
##windows下安裝rabbitmqgit
2 接着下載rabbitmq的安裝包,安裝以後,添加rabbitmq的環境變量,rabbitmq_home和path,如%RABBITMQ_SERVER%\sbin; 安裝包在resources/install裏,版本3.6.9.web
3 接着啓動rabbitmq,以管理員的身份運行cmd,進入到 %RABBITMQ_SERVER%\sbin目錄下;接着運行rabbitmq-plugins.bat,具體命令爲:rabbitmq-plugins.bat enable rabbitmq_management ;無誤後,接着啓動 rabbitmq-service.bat .spring
命令以下:啓動:rabbitmq-service.bat start;關閉:rabbitmq-service.bat stop 從新添加:rabbitmq-service.bat installwindows
windows安裝完成以後會自動註冊爲服務,開機自啓,無需手動啓動,以下圖:跨域
rabbitmq-plugins enable rabbitmq_stomp
具體參考博客:http://blog.csdn.net/madun/article/details/20837925 ##添加spring的依賴 這三個jar不知道幹啥用的,別人提到要加上websocket
該博客連接 http://blog.csdn.net/q_an1314/article/details/52869051socket
<dependency> <groupId>io.projectreactor</groupId> <artifactId>reactor-core</artifactId> <version>2.0.8.RELEASE</version> </dependency> <dependency> <groupId>io.projectreactor</groupId> <artifactId>reactor-net</artifactId> <version>2.0.8.RELEASE</version> </dependency> <dependency> <groupId>io.netty</groupId> <artifactId>netty-all</artifactId> <version>4.1.6.Final</version> </dependency>
##設置webSocket配置 將WebSocketConfig裏的config.enableSimpleBroker("/topic");改成config.enableStompBrokerRelay("/topic","/queue");這樣就能使用rabbitmq做爲代理器了..net
另外,須要設置regist.setAllowedOrigins("*"),容許跨域請求.插件