Skip to content

Instantly share code, notes, and snippets.

@aidapsibr
Created August 26, 2016 19:20
Show Gist options
  • Save aidapsibr/ae7ab64cba31a718ac0ba96c3871e580 to your computer and use it in GitHub Desktop.
Save aidapsibr/ae7ab64cba31a718ac0ba96c3871e580 to your computer and use it in GitHub Desktop.
var endPoint = new IPEndPoint(IPAddress.Parse("127.0.0.1"), 5467);
var parser = new StompParser();
using(var reStompService = new StompService(endPoint, parser))
{
reStompService.Start((middlewareStack) =>
{
middlewareStack.Push(new TerminationMiddleware().Invoke);
middlewareStack.Push(new ProtocolVersionMiddleware().Invoke);
middlewareStack.Push(new SessionMiddleware().Invoke);
middlewareStack.Push(new SendMiddleware().Invoke);
});
Console.WriteLine("Service started.");
var client = new StompClient();
var session = client.Connect("127.0.0.1", 5467).Result;
if(session != null)
{
client.Send(new Dictionary<string,string> { ["receipt-id"] = "111" }, "WOO!").Wait();
}
Console.ReadLine();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment