delphimvcframework/tutorial/10_HelloWorld/producer.dpr
2016-07-12 17:17:10 +02:00

42 lines
642 B
ObjectPascal

program producer;
{$APPTYPE CONSOLE}
{$R *.res}
{
https://www.rabbitmq.com/tutorials/tutorial-one-python.html
}
uses
System.SysUtils,
StompClient;
procedure Main;
var
lClient: TStompClient;
begin
lClient := TStompClient.Create;
lClient.Connect();
WriteLn('Sending messages to queue "myqueue"');
lClient.Send('myqueue', 'Message 1');
lClient.Send('myqueue', 'Message 2');
WriteLn('Messages sent');
lClient.Disconnect;
end;
begin
try
Main;
Write('Press return to quit');
ReadLn;
except
on E: Exception do
begin
WriteLn(E.ClassName, ': ', E.Message);
ReadLn;
end;
end;
end.