[PATCH 1/2] Mama Java: Java subscription setup fix - it loses the closure.


Adrienne Ambrose <a.ambrose@...>
 

Bugzilla Ticket :- Bug-181

 

Testing:-


Not middleware or O/S specific. 

I have attached a modified MamaListen.java application to the Bugzilla ticket, which instead of using the createSubscription() we are now calling 
setupSubscription() followed by an activate. 

You can pass anything in as your closure and then use the getClosure() to return the closure.

 

======================================================================================================

 

From bdbf154c17e1f12778bc2904b2fb68f6daed9418 Mon Sep 17 00:00:00 2001

From: A Ambrose <a.ambrose@...>

Date: Wed, 11 Mar 2015 11:19:40 +0000

Subject: [PATCH 1/2] Mama Java: Java subscription setup fix - it loses the

closure.

 

On setupSubscription() the closure is never stored, this patch will

correct this issue.

 

Signed-off-by: A Ambrose <a.ambrose@...>

---

mama/jni/src/com/wombat/mama/MamaSubscription.java | 5 ++++-

1 file changed, 4 insertions(+), 1 deletion(-)

 

diff --git a/mama/jni/src/com/wombat/mama/MamaSubscription.java b/mama/jni/src/com/wombat/mama/MamaSubscription.java

index 6916434..fc7bbe6 100644

--- a/mama/jni/src/com/wombat/mama/MamaSubscription.java

+++ b/mama/jni/src/com/wombat/mama/MamaSubscription.java

@@ -292,13 +292,16 @@ public class MamaSubscription

         // Save the source in the Java layer to prevent a context switch to C

         mySource = source;

+        // Save the closure

+        myClosure = closure;

+

         // Create the native subscription

         setupNativeSubscription(

             callback,

             queue,

             source,

             symbol,

-            closure);

+            null);

     }

    

     public void setAppDataType (MamaMdDataType type)

--

2.1.0

 

Join Openmama-dev@lists.openmama.org to automatically receive all group messages.