STOMP 与 ActiveMQ
通过 WebSocket 上的 STOMP 将您的 Delphi 应用程序连接到 Apache ActiveMQ。从原生代码访问队列、主题和持久订阅。
通过 WebSocket 上的 STOMP 将您的 Delphi 应用程序连接到 Apache ActiveMQ。从原生代码访问队列、主题和持久订阅。
针对 Apache ActiveMQ 优化的 STOMP 1.0 / 1.1 / 1.2 客户端。订阅 /topic/、/queue/ 和代理特定目标地址,支持 ACK/NACK 和事务。
TsgcWSPClient_STOMP_ActiveMQ
STOMP 1.2(适用于 ActiveMQ)
Windows, macOS, Linux, iOS, Android
Professional / Enterprise
与 TsgcWebSocketClient 配对,设置 Authentication,订阅 /topic/ 或 /queue/ 目标地址,发布文本或二进制帧。
uses
sgcWebSocket, sgcWebSocket_Protocol_STOMP_ActiveMQ_Client;
var
WSClient: TsgcWebSocketClient;
STOMP: TsgcWSPClient_STOMP_ActiveMQ;
begin
WSClient := TsgcWebSocketClient.Create(nil);
WSClient.Host := 'broker.example.com';
WSClient.Port := 61614;
STOMP := TsgcWSPClient_STOMP_ActiveMQ.Create(nil);
STOMP.Client := WSClient;
STOMP.Authentication.Enabled := True;
STOMP.Authentication.UserName := 'admin';
STOMP.Authentication.Password := 'admin';
STOMP.OnSTOMPConnected := STOMPConnected;
STOMP.OnSTOMPMessage := STOMPMessage;
WSClient.Active := True;
end;
procedure TForm1.STOMPConnected(Connection: TsgcWSConnection;
const Session, Server: string);
begin
STOMP.SubscribeQueue('orders');
STOMP.PublishQueue('orders', 'hello');
end;
9 个已发布属性、16 个方法、6 个事件 — 摘自组件参考文档。
已发布属性:Client、Broker、Versions。
事件:OnActiveMQMessage、OnActiveMQReceipt。
已发布属性:HeartBeat。
已发布属性:Authentication。
事件:OnActiveMQConnected、OnActiveMQDisconnected、OnActiveMQError。
方法:WriteData。
该组件实现的协议权威来源。