first commit
This commit is contained in:
19
include/IMessageQueue.h
Normal file
19
include/IMessageQueue.h
Normal file
@@ -0,0 +1,19 @@
|
||||
#pragma once
|
||||
#include <string>
|
||||
#include "XRabbitMQClient_export.h"
|
||||
|
||||
// 纯虚接口:隔离具体的消息队列实现
|
||||
class XRABBITMQCLIENT_EXPORT IMessageQueue
|
||||
{
|
||||
public:
|
||||
virtual ~IMessageQueue() = default;
|
||||
|
||||
// 连接到消息队列服务器
|
||||
virtual bool Connect() = 0;
|
||||
|
||||
// 发送消息
|
||||
virtual bool Publish(const std::string &routing_key, const std::string &message) = 0;
|
||||
|
||||
// 接收消息 (简单阻塞式示例)
|
||||
virtual std::string Consume(const std::string &queue_name) = 0;
|
||||
};
|
||||
Reference in New Issue
Block a user