activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstrac...@apache.org
Subject svn commit: r381308 - in /incubator/activemq/trunk/openwire-dotnet: ./ tests/OpenWire.Client/TestMain.cs
Date Mon, 27 Feb 2006 10:24:18 GMT
Author: jstrachan
Date: Mon Feb 27 02:24:12 2006
New Revision: 381308

URL: http://svn.apache.org/viewcvs?rev=381308&view=rev
Log:
Updated the example program

Modified:
    incubator/activemq/trunk/openwire-dotnet/   (props changed)
    incubator/activemq/trunk/openwire-dotnet/tests/OpenWire.Client/TestMain.cs

Propchange: incubator/activemq/trunk/openwire-dotnet/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Mon Feb 27 02:24:12 2006
@@ -0,0 +1,3 @@
+
+bin
+openwire-dotnet.csproj

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=381308&r1=381307&r2=381308&view=diff
==============================================================================
--- incubator/activemq/trunk/openwire-dotnet/tests/OpenWire.Client/TestMain.cs (original)
+++ incubator/activemq/trunk/openwire-dotnet/tests/OpenWire.Client/TestMain.cs Mon Feb 27
02:24:12 2006
@@ -42,15 +42,21 @@
                     IDestination destination = session.GetQueue("FOO.BAR");
                     Console.WriteLine("Using destination: " + destination);
                     
+                    // lets create a consumer and producer
                     IMessageConsumer consumer = session.CreateConsumer(destination);
                     
                     IMessageProducer producer = session.CreateProducer(destination);
-                    string expected = "Hello World!";
+                    producer.Persistent = true;
                     
-                    ITextMessage request = session.CreateTextMessage(expected);
+                    // lets send a message
+                    ITextMessage request = session.CreateTextMessage("Hello World!");
+                    request.JMSCorrelationID = "abc";
+                    request.JMSXGroupID = "cheese";
+                    request.Properties["myHeader"] = "James";
                     
                     producer.Send(request);
                     
+                    // lets consume a message
                     ActiveMQTextMessage message = (ActiveMQTextMessage) consumer.Receive();
                     if (message == null)
                     {
@@ -58,8 +64,8 @@
                     }
                     else
                     {
-                        String actual = message.Text;
-                        Console.WriteLine("Received message with text: " + actual);
+                        Console.WriteLine("Received message with ID:   " + message.JMSMessageId);
+                        Console.WriteLine("Received message with text: " + message.Text);
                     }
                 }
                 // END SNIPPET: example



Mime
View raw message