ServiceStack.Server: Redis server integrated withing ServiceStack lib?

本小妞迷上赌 提交于 2020-05-16 22:00:53

问题


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

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

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

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?

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

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

This line

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

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);

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


回答1:


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

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.

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:

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

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.



来源:https://stackoverflow.com/questions/61556415/servicestack-server-redis-server-integrated-withing-servicestack-lib

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!