[PATCH 4/7] Update to example file MamaListenCS.cs to fix a few


Gary Molloy <GMolloy@...>
 

Testing

No Middleware dependencies.

Applies to C# Only.

 

Run the C# example application MamaListenCS.cs:

First in quiet mode (-q), you should expect to see no data other than the message info, Symbol, Type, Status.

Second with a low water mark set (-lw x) to get the low water mark text to be printed out.

 

 

 

From 44f29927d0235701cea25bd19d3fea7f9f14c7c5 Mon Sep 17 00:00:00 2001

From: Gary Molloy <gmolloy@...>

Date: Mon, 23 Jun 2014 15:34:30 +0100

Subject: [PATCH 4/7] Update to example file MamaListenCS.cs to fix a few issues.

 

[OMAMA-268]

 

Description - The low water mark callback was printing the same string as high water mark.

When running with "quiet" no context was being printed out.

 

Signed-off-by: Gary Molloy <gmolloy@...>

---

.../dotnet/src/examples/MamaListen/MamaListenCS.cs | 41 ++++++++++++----------

1 file changed, 22 insertions(+), 19 deletions(-)

 

diff --git a/mama/dotnet/src/examples/MamaListen/MamaListenCS.cs b/mama/dotnet/src/examples/MamaListen/MamaListenCS.cs

index 1dd8f4a..b8ea29a 100644

--- a/mama/dotnet/src/examples/MamaListen/MamaListenCS.cs

+++ b/mama/dotnet/src/examples/MamaListen/MamaListenCS.cs

@@ -553,30 +553,33 @@ namespace MamaListen

                              msg.getStatus());

                 }

-                if (m_iterator)

+                if (m_quietness < 1)

                 {

-                    // Set the iterator to the beginning of the message

-                    msg.begin(ref m_messageIterator);

-

-                    // Keep going until there are no more fields

-                    MamaMsgField field = m_messageIterator.getField();

-                    while (field != null)

+                    if (m_iterator)

                     {

-                        // Display the field

-                        fieldCallback.displayField(field, 0);

+                        // Set the iterator to the beginning of the message

+                        msg.begin(ref m_messageIterator);

+

+                        // Keep going until there are no more fields

+                        MamaMsgField field = m_messageIterator.getField();

+                        while (field != null)

+                        {

+                            // Display the field

+                            fieldCallback.displayField(field, 0);

-                        m_messageIterator++;

+                            m_messageIterator++;

-                        // Get the next field

-                        field = m_messageIterator.getField();

+                            // Get the next field

+                            field = m_messageIterator.getField();

+                        }

                     }

-                }

-                else

-                {

-                    // Otherwise use the iteration function on the message itself

-                    int indentlevel = 0;

-                    msg.iterateFields(fieldCallback, m_dictionary, indentlevel);

+                    else

+                    {

+                        // Otherwise use the iteration function on the message itself

+                        int indentlevel = 0;

+                        msg.iterateFields(fieldCallback, m_dictionary, indentlevel);

+                    }

                 }

             }

         }

@@ -598,7 +601,7 @@ namespace MamaListen

             public void LowWatermark(MamaQueue mamaQueue, int size, object closure)

             {

-                Console.WriteLine("Default queue high water mark exceeded. Size " + size);

+                Console.WriteLine("Default queue low water mark exceeded. Size " + size);

             }

         }

--

1.8.3.1

 


This message may contain confidential information and is intended for specific recipients unless explicitly noted otherwise. If you have reason to believe you are not an intended recipient of this message, please delete it and notify the sender. This message may not represent the opinion of IntercontinentalExchange Group, Inc. (ICE), NYSE Euronext or any of their subsidiaries or affiliates, and does not constitute a contract or guarantee. Unencrypted electronic mail is not secure and the recipient of this message is expected to provide safeguards from viruses and pursue alternate means of communication where privacy or a binding message is desired.


Damian Maguire <DMaguire@...>
 

Cheers Gary, raised in Bugzilla as BZ134

D

From: Gary Molloy <GMolloy@...>
Date: Tuesday, June 24, 2014 10:53 AM
To: "openmama-dev@..." <openmama-dev@...>
Subject: [Openmama-dev] [PATCH 4/7] Update to example file MamaListenCS.cs to fix a few

Testing

No Middleware dependencies.

Applies to C# Only.

 

Run the C# example application MamaListenCS.cs:

First in quiet mode (-q), you should expect to see no data other than the message info, Symbol, Type, Status.

Second with a low water mark set (-lw x) to get the low water mark text to be printed out.

 

 

 

From 44f29927d0235701cea25bd19d3fea7f9f14c7c5 Mon Sep 17 00:00:00 2001

From: Gary Molloy <gmolloy@...>

Date: Mon, 23 Jun 2014 15:34:30 +0100

Subject: [PATCH 4/7] Update to example file MamaListenCS.cs to fix a few issues.

 

[OMAMA-268]

 

Description - The low water mark callback was printing the same string as high water mark.

When running with "quiet" no context was being printed out.

 

Signed-off-by: Gary Molloy <gmolloy@...>

---

.../dotnet/src/examples/MamaListen/MamaListenCS.cs | 41 ++++++++++++----------

1 file changed, 22 insertions(+), 19 deletions(-)

 

diff --git a/mama/dotnet/src/examples/MamaListen/MamaListenCS.cs b/mama/dotnet/src/examples/MamaListen/MamaListenCS.cs

index 1dd8f4a..b8ea29a 100644

--- a/mama/dotnet/src/examples/MamaListen/MamaListenCS.cs

+++ b/mama/dotnet/src/examples/MamaListen/MamaListenCS.cs

@@ -553,30 +553,33 @@ namespace MamaListen

                              msg.getStatus());

                 }

-                if (m_iterator)

+                if (m_quietness < 1)

                 {

-                    // Set the iterator to the beginning of the message

-                    msg.begin(ref m_messageIterator);

-

-                    // Keep going until there are no more fields

-                    MamaMsgField field = m_messageIterator.getField();

-                    while (field != null)

+                    if (m_iterator)

                     {

-                        // Display the field

-                        fieldCallback.displayField(field, 0);

+                        // Set the iterator to the beginning of the message

+                        msg.begin(ref m_messageIterator);

+

+                        // Keep going until there are no more fields

+                        MamaMsgField field = m_messageIterator.getField();

+                        while (field != null)

+                        {

+                            // Display the field

+                            fieldCallback.displayField(field, 0);

-                        m_messageIterator++;

+                            m_messageIterator++;

-                        // Get the next field

-                        field = m_messageIterator.getField();

+                            // Get the next field

+                            field = m_messageIterator.getField();

+                        }

                     }

-                }

-                else

-                {

-                    // Otherwise use the iteration function on the message itself

-                    int indentlevel = 0;

-                    msg.iterateFields(fieldCallback, m_dictionary, indentlevel);

+                    else

+                    {

+                        // Otherwise use the iteration function on the message itself

+                        int indentlevel = 0;

+                        msg.iterateFields(fieldCallback, m_dictionary, indentlevel);

+                    }

                 }

             }

         }

@@ -598,7 +601,7 @@ namespace MamaListen

             public void LowWatermark(MamaQueue mamaQueue, int size, object closure)

             {

-                Console.WriteLine("Default queue high water mark exceeded. Size " + size);

+                Console.WriteLine("Default queue low water mark exceeded. Size " + size);

             }

         }

--

1.8.3.1

 


This message may contain confidential information and is intended for specific recipients unless explicitly noted otherwise. If you have reason to believe you are not an intended recipient of this message, please delete it and notify the sender. This message may not represent the opinion of IntercontinentalExchange Group, Inc. (ICE), NYSE Euronext or any of their subsidiaries or affiliates, and does not constitute a contract or guarantee. Unencrypted electronic mail is not secure and the recipient of this message is expected to provide safeguards from viruses and pursue alternate means of communication where privacy or a binding message is desired.

This message may contain confidential information and is intended for specific recipients unless explicitly noted otherwise. If you have reason to believe you are not an intended recipient of this message, please delete it and notify the sender. This message may not represent the opinion of Intercontinental Exchange, Inc. (ICE), Euronext or any of their subsidiaries or affiliates, and does not constitute a contract or guarantee. Unencrypted electronic mail is not secure and the recipient of this message is expected to provide safeguards from viruses and pursue alternate means of communication where privacy or a binding message is desired.