java redis 库_用于 Java 的 Redis 缓存库

您现在访问的是微软AZURE全球版技术文档网站,若需要访问由世纪互联运营的MICROSOFT AZURE中国区技术文档网站,请访问 https://docs.azure.cn.

用于 Java 的 Redis 缓存库Redis Cache libraries for Java

07/11/2017

本文内容

概述Overview

Azure Redis 缓存是基于流行开源 Redis 缓存的安全分布式键值存储。Azure Redis Cache is a secure, distributed key-value store based on the popular open source Redis cache.

To get started with Azure Redis Cache, see How to use Azure Redis Cache with Java.

客户端库Client library

使用开源 Jedis 客户端连接到 Azure Redis 缓存并在缓存中存储和检索值。Connect to Azure Redis Cache and store and retrieve values from the cache using the open-source Jedis client.

向 Maven pom.xml 文件中添加依赖项,以便在项目中使用客户端库。Add a dependency to your Maven pom.xml file to use the client library in your project.

redis.clients

jedis

2.9.0

jar

示例Example

连接到 Azure Redis 并在缓存中插入字符串。Connect to Azure Redis and insert a string into the cache.

JedisShardInfo shardInfo = new JedisShardInfo(".redis.cache.windows.net", 6380, useSsl);

shardInfo.setPassword(""); /* Use your access key. */

Jedis jedis = new Jedis(shardInfo);

jedis.set("foo", "bar");

管理 APIManagement API

使用管理 API 创建和缩放 Azure Redis 资源及管理访问密钥。Create and scale Azure Redis resources and manage access keys to with the management API.

com.microsoft.azure

azure-mgmt-redis

1.3.0

示例Example

在双节点标准层中创建新的 Azure Redis 缓存。Create a new Azure Redis Cache in the two-node standard tier.

RedisCache cache = azure.redisCaches().define(redisCacheName1)

.withRegion(Region.US_CENTRAL)

.withNewResourceGroup(rgName)

.withStandardSku();

示例Samples

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值