public static void Main(string[] args) { ArgumentHelper helper = new ArgumentHelperBuilder("Push Subscribe Basic Async", args, Usage) .DefaultStream("example-stream") .DefaultSubject("example-subject") .Build(); try { using (IConnection c = new ConnectionFactory().CreateConnection(helper.MakeOptions())) { JsUtils.CreateStreamWhenDoesNotExist(c, helper.Stream, helper.Subject); IJetStream js = c.CreateJetStreamContext(); new Thread(() => { js.PushSubscribeAsync(helper.Subject, (sender, a) => { a.Message.Ack(); Console.WriteLine(Encoding.UTF8.GetString(a.Message.Data)); }, false); }).Start(); Thread.Sleep(3000); } } catch (Exception ex) { helper.ReportException(ex); } }