// Collection of code snippets by Arne Vajhøj // (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) using System; using NMS; using ActiveMQ; namespace E { public class MainClass { public static void Main(string[] args) { IConnectionFactory cf = new ConnectionFactory(new Uri("tcp://localhost:61616")); IConnection con = cf.CreateConnection(); con.Start(); ISession ses = con.CreateSession(AcknowledgementMode.AutoAcknowledge); IMessageConsumer r = ses.CreateConsumer(ses.GetQueue("ArneQueue")); ITextMessage msg = (ITextMessage)r.Receive(); Console.WriteLine(msg.Text); con.Close(); } } }