activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstrac...@apache.org
Subject svn commit: r380777 - /incubator/activemq/trunk/openwire-dotnet/tests/OpenWire.Client/TestMain.cs
Date Fri, 24 Feb 2006 18:44:45 GMT
Author: jstrachan
Date: Fri Feb 24 10:44:43 2006
New Revision: 380777

URL: http://svn.apache.org/viewcvs?rev=380777&view=rev
Log:
Added little snippet to example for wiki

Modified:
    incubator/activemq/trunk/openwire-dotnet/tests/OpenWire.Client/TestMain.cs

Modified: incubator/activemq/trunk/openwire-dotnet/tests/OpenWire.Client/TestMain.cs
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/openwire-dotnet/tests/OpenWire.Client/TestMain.cs?rev=380777&r1=380776&r2=380777&view=diff
==============================================================================
--- incubator/activemq/trunk/openwire-dotnet/tests/OpenWire.Client/TestMain.cs (original)
+++ incubator/activemq/trunk/openwire-dotnet/tests/OpenWire.Client/TestMain.cs Fri Feb 24
10:44:43 2006
@@ -30,17 +30,14 @@
             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 @@
                     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)
             {



Mime
View raw message