{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-guides/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Redis Client","description":"Accelerate E&P application development and protect your innovation by consuming our Data and Domain APIs / Platform APIs.","lang":"en-US","meta":[{"name":"robots","content":"noindex"}],"llmstxt":{"hide":true,"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"redis-client","__idx":0},"children":["Redis Client"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://redis.io/"},"children":["Redis"]}," Client is a NoSQL key-value cache that stores information in a hash table format. It provides"," ","the possibilities to store different type of structured data like strings, hashes, lists, sets, sorted sets, bitmaps and"," ","hyperloglogs."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["With Edge SDK 2.0 RedisClient functionality, developers can easily use Redis Server available on the gateway."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"using-redis-client","__idx":1},"children":["Using Redis Client"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Namespace: ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Agora.Edge"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The RedisClient is implemented as a singleton. The purpose of the RedisClient is to store, retrieve values from Redis Server."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"example","__idx":2},"children":["Example"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":5,"id":"aeajson-configuration-file","__idx":3},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["AEA.json"]}," configuration file:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n    \"Name\": \"Sender\",\n    \"AEA2\": {\n       \"LogLevel\": \"Trace\", \n        \"RedisClient\": {\n            \"Server\": \"localhost\",\n            \"Port\": 6379,\n        }\n    }\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":5,"id":"connect-to-the-redis-server","__idx":4},"children":["Connect to the Redis Server"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use the following command to connect to the Redis Server."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"_","__idx":5},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#tab/net"},"children":["NET"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"csharp","header":{"controls":{"copy":{}}},"source":"using System.Text.Json;\nusing static Agora.SDK;\n\ninternal class Program\n{\n   private static void Main(string[] args)\n    {\n        \"Starting\".LogHeading();\n        Redis.Connect(2000);\n    }\n}\n","lang":"csharp"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"_-1","__idx":6},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#tab/python"},"children":["Python"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"python","header":{"controls":{"copy":{}}},"source":"from agoraiot import *\n\nredisclient = redisClientSingleton.connect(2)\n","lang":"python"},"children":[]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"storing-and-retrieving-value-using-redis-client","__idx":7},"children":["Storing and Retrieving Value using Redis Client"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use the following command to store and retrieve value."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"_-2","__idx":8},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#tab/net"},"children":["NET"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"csharp","header":{"controls":{"copy":{}}},"source":"using System.Text.Json;\nusing static Agora.SDK;\n\ninternal class Program\n{\n   private static void Main(string[] args)\n    {\n        \"Starting\".LogHeading();\n        Redis.Connect(2000);\n        if (Redis.IsConnected)\n        {\n            //This one is used to store value\n            Redis.Client.StringSet(\"key\", \"value\");\n            //This one is used to Get value\n            var value = Redis.Client.StringGet(\"key\");\n            $\"Value {value}\".LogInfo();\n        }\n    }\n}\n","lang":"csharp"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"_-3","__idx":9},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#tab/python"},"children":["Python"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"python","header":{"controls":{"copy":{}}},"source":"redisclient = redisClientSingleton.connect(2)\nif redisclient.ping():\n    redisclient.set('my_key', 'my_value')\n    result = redisclient.get('my_key')\n    print(result)\n","lang":"python"},"children":[]}]},"headings":[{"value":"Redis Client","id":"redis-client","depth":2},{"value":"Using Redis Client","id":"using-redis-client","depth":3},{"value":"Example","id":"example","depth":4},{"value":"AEA.json configuration file:","id":"aeajson-configuration-file","depth":5},{"value":"Connect to the Redis Server","id":"connect-to-the-redis-server","depth":5},{"value":"","id":"_","depth":1},{"value":"","id":"_-1","depth":1},{"value":"Storing and Retrieving Value using Redis Client","id":"storing-and-retrieving-value-using-redis-client","depth":4},{"value":"","id":"_-2","depth":1},{"value":"","id":"_-3","depth":1}],"frontmatter":{"seo":{"title":"Redis Client"}},"lastModified":"2025-12-26T11:00:41.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/solutions/agora/referencemanual/redis","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}