(* Collection of code snippets by Arne Vajhøj *)
(* (from articles on eksperten.dk / vajhoej.dk written sometime between 2004 and now) *)
program Pub;

uses
  StompClient, StompTypes, delphistomp, laz_synapse;

const
  HOST = 'localhost';
  PORT = 61613;
  UN = 'arne';
  PW = 'topsecret';
  QNAME = '/topic/TestT';
  PAYLOAD = '<data>' + #13#10 + '    <id>123</id>' + #13#10 + '    <name>ABC</name>' + #13#10 + '</data>';

var
  cli : IStompClient;
  i : integer;

begin
  cli := TStompClient.Create.SetUserName(UN).SetPassword(PW);
  cli.Connect(HOST, PORT);
  for i := 1 to 3 do begin
    cli.Send(QNAME, PAYLOAD);
  end;
  cli.Disconnect;
end.
