问题
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