ServiceStack.Server:Redis 服务器与 ServiceStack 库集成? [英] ServiceStack.Server: Redis server integrated withing ServiceStack lib?

查看:57
本文介绍了ServiceStack.Server:Redis 服务器与 ServiceStack 库集成?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想澄清一下我是否正确理解了 ServiceStack.Server 功能.

I want to clarify if I understood the ServiceStack.Server functionality correctly.

这个页面上描述了ServiceStack.Server API,并且它指出

On this page, ServiceStack.Server API is described, and it states that

创建一个 Redis MQ 服务器,在自己的后台线程上处理每条消息

Creates a Redis MQ Server that processes each message on its own background thread

当我假设这是一个独立的 Redis 服务器时,我是否正确,所以如果我用下面的代码开始它,我正在运行一个完全成熟的 Redis 服务器,这意味着,不需要安装 Redis 软件,或Memurai还是喜欢?

Am I correct when I then assumed that this is a standalone Redis server, so if I start this with the code below, I am running a fully fledged Redis server, meaning, no need to install the Redis software, or Memurai or the likes?

因为,如果我遵循 这个例子,并且没有其他正在运行的 Redis 服务器,我明白了

Because, if I follow this example, and have no other running Redis server, I get

'无法建立连接,因为目标机器主动拒绝了它.127.0.0.1:6379'

'No connection could be made because the target machine actively refused it. 127.0.0.1:6379'

这一行

var redisFactory = new PooledRedisClientManager("localhost:6379");

启动一个客户端,尝试连接6379,自然失败.然后在创建 MqServer 的行中使用 redisFactory,这对我来说很奇怪:

starts a client and tries to connect to 6379 and naturally fails. The redisFactory is then used in the line creating the MqServer, which is odd to me:

var mqHost = new RedisMqServer(redisFactory, retryCount: 2);

如果这是一个独立的MQ服务器,那么在创建和启动服务器之前创建一个客户端是行不通的,这让我觉得这不是一个Redis MQ服务器?

If this is a standalone MQ server, then creating a client before creating and starting the server isn't going to work, which makes me think this is not an Redis MQ server?

推荐答案

当我假设这是一个独立的 Redis 服务器时,我是否正确

Am I correct when I then assumed that this is a standalone Redis server

这是一个错误的结论,Redis Server 是一个分布式内存数据结构服务器,就像其他分布式RDBMS 或 MQ Broker 等服务器在其自己的隔离网络进程中运行.

That's an incorrect conclusion, the Redis Server is a distributed in-memory data structure server which just like other distributed servers like an RDBMS or MQ Broker runs in its own isolated networked process.

所有 ServiceStack Redis 库都连接到一个 Redis 服务器,Redis MQ 就像所有其他分布式ServiceStack MQ 提供者处理发送到代理的消息,在这种情况下,Redis MQ 使用 Redis 服务器作为其经纪人.声明:

All ServiceStack Redis Libraries connect to a Redis Server, Redis MQ is like all other distributed ServiceStack MQ providers which process messages sent to a broker, in this case Redis MQ uses the Redis Server as its broker. The statement:

创建一个 Redis MQ 服务器,在自己的后台线程上处理每条消息

Creates a Redis MQ Server that processes each message on its own background thread

解释 Redis MQ 如何处理它收到的消息,其中每种不同的消息类型(即请求 DTO 类型)在自己的后台线程中处理消息.

Explains how Redis MQ processes the messages that it receives, where each different Message Type (i.e. Request DTO Type) processes messages in its own background thread.

这篇关于ServiceStack.Server:Redis 服务器与 ServiceStack 库集成?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆