From 046146636777d927116db6344296a1fd773ea2ed Mon Sep 17 00:00:00 2001 From: James Strachan Date: Fri, 24 Feb 2006 18:44:43 +0000 Subject: [PATCH] Added little snippet to example for wiki git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@380777 13f79535-47bb-0310-9956-ffa450edef68 --- .../tests/OpenWire.Client/TestMain.cs | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/openwire-dotnet/tests/OpenWire.Client/TestMain.cs b/openwire-dotnet/tests/OpenWire.Client/TestMain.cs index c201bf6220..fea2bfaeff 100644 --- a/openwire-dotnet/tests/OpenWire.Client/TestMain.cs +++ b/openwire-dotnet/tests/OpenWire.Client/TestMain.cs @@ -30,17 +30,14 @@ namespace openwire_dotnet try { Console.WriteLine("About to connect to ActiveMQ"); - + + // START SNIPPET: example IConnectionFactory factory = new ConnectionFactory("localhost", 61616); - - Console.WriteLine("Worked!"); - using (IConnection connection = factory.CreateConnection()) { Console.WriteLine("Created a connection!"); ISession session = connection.CreateSession(); - Console.WriteLine("Created a session: " + session); IDestination destination = session.GetQueue("FOO.BAR"); Console.WriteLine("Using destination: " + destination); @@ -50,25 +47,22 @@ namespace openwire_dotnet IMessageProducer producer = session.CreateProducer(destination); string expected = "Hello World!"; - ITextMessage request = session.CreateTextMessage(expected); producer.Send(request); - Console.WriteLine("### About to receive message..."); ActiveMQTextMessage message = (ActiveMQTextMessage) consumer.Receive(); if (message == null) { - Console.WriteLine("### No message!!"); + Console.WriteLine("No message received!"); } else { - Console.WriteLine("### Received message: " + message + " of type: " + message.GetType()); String actual = message.Text; - - Console.WriteLine("### Message text is: " + actual); + Console.WriteLine("Received message with text: " + actual); } } + // END SNIPPET: example } catch (Exception e) {