【Spring Cloud】Redis & RabbitMQ & WebHook 在Windows环境下安装配置

Redis安装

下载地址:https://github.com/MicrosoftArchive/redis/releases

启动Redis服务:redis-server.exe redis.windows.conf

(硬盘不足启动失败解决方法:redis-server.exe redis.windows.conf –-maxheap 20m

启动Redis客户端: redis-cli.exe -h 127.0.0.1 -p 6379 。

RabbitMQ安装

1. 安装Erlang(windows,rabbitMQ依赖)

下载地址:http://www.erlang.org/downloads

OTP 20.3 Windows 64-bit Binary File,运行exe安装,环境变量会有ERLANG_HOME项。

2. 安装RabbitMQ(windows)

下载地址:https://github.com/rabbitmq/rabbitmq-server/releases/tag/v3.7.5

将rabbitmq_server-3.7.5.zip解压

3. 安装RabbitMQ-Plugin(windows)

sbin下执行rabbitmq-plugins.bat enable rabbitmq_management

(如果Web前端通过Stomp连接RMQ,则需要启动插件:rabbitmq_web_stomp) 

4. 启动RabbitMQ服务

执行rabbitmq-server.bat,浏览器打开http://localhost:15672,用户名密码guest,可登录。

WebHook配置

1. 安装ngrok

ngrok是一个反向代理,通过在公共的端点和本地运行的 Web 服务器之间建立一个安全的通道),直接解压即可。

下载地址:https://ngrok.com/download

启动代理:cmd,进入ngrok安装目录,执行:ngrok.exe http 8888

(8888是本地部署服务端口)

2. 配置webhook

其中payload url是上一步中的“Forwarding”地址。

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Spring Cloud可以使用Spring Boot快速搭建分布式应用程序。要配置Spring Cloud中的Redis,请按以下步骤操作: 1. 添加Redis依赖关系 在pom.xml文件中添加以下Redis依赖项: ```xml <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</artifactId> </dependency> ``` 这将添加Spring Data Redis依赖项和Jedis客户端库。 2. 配置Redis连接 在application.properties或application.yml文件中添加以下属性来配置Redis连接: ```properties spring.redis.host=localhost spring.redis.port=6379 spring.redis.password= ``` 这将设置Redis服务器主机和端口以及可选的密码。如果您的Redis服务器不需要密码,则无需设置密码属性。 3. 确认RedisTemplate配置 如果您需要使用RedisTemplate访问Redis服务器,则需要添加以下配置: ```java @Bean public RedisTemplate<String, Object> redisTemplate() { RedisTemplate<String, Object> template = new RedisTemplate<>(); template.setConnectionFactory(jedisConnectionFactory()); return template; } @Bean public JedisConnectionFactory jedisConnectionFactory() { JedisConnectionFactory jedisConnectionFactory = new JedisConnectionFactory(); jedisConnectionFactory.setHostName(redisHost); jedisConnectionFactory.setPort(redisPort); jedisConnectionFactory.setPassword(redisPassword); jedisConnectionFactory.setUsePool(true); return jedisConnectionFactory; } ``` 这将设置RedisTemplate和JedisConnectionFactory的bean。 以上就是Spring Cloud配置Redis的步骤。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值