Issue Details (XML | Word | Printable)

Key: MULE-2987
Type: Patch submission Patch submission
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Andrew Calafato
Reporter: Stirling Chow
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Mule

SEDA components with persisted queue do not receive asynchronous events.

Created: 12/Feb/08 06:33 PM   Updated: 14/Mar/08 07:47 AM
Component/s: Core: Queues (SEDA) / Persistence
Affects Version/s: 1.4.4
Fix Version/s: 1.4.4

Time Tracking:
Not Specified

File Attachments: 1. Zip Archive APE-11865.zip (13 kB)

Environment: mule-1.4.4-SNAPSHOT
Issue Links:
Duplicate
 

Includes test case?: yes
Labels:
User impact: High


 Description  « Hide
If a SEDA component's event queue is persisted, then it does not properly receive asynchronous events.

The problem is two-fold:
1) When a MuleEvent is persisted/serialized, its endpoint URI is written. When the MuleEvent is deserialized, the event's endpoint is always recreated as a SENDER. When such an event is dispatched to the Mule proxy, the proxy redispatches the event endlessly (see DefaultMuleProxy.java: line 453)
2) If MuleEvent is patched to properly store the event's endpoint type, the event now gets dispatched but results in an NPE because the session is left null and an attempt is made to get the event's component.

I've attached a test case that demonstrates the problem. Unzip the file into a directory. Modify build.xml to point to your Mule installation/binaries.

Run "ant test-broken"; this will run the test on the existing Mule libraries and should generate 1 error related to a method not being called (because the event is endlessly dispatched).

Run "ant test"; this will run the test on the patched code and should generate no errors.



 All   Comments   Work Log   Change History   Transitions   FishEye      Sort Order: Ascending order - Click to sort in descending order
Stirling Chow added a comment - 12/Feb/08 06:35 PM
Patched MuleEvent.java to write/restore the endpoint's type and to attach a session.

Stirling Chow added a comment - 12/Feb/08 06:37 PM
This patch should also fix MULE-2961.

Holger Hoffstaette added a comment - 13/Feb/08 07:27 AM
Thanks a lot for the patch & excellent test, but this fixes only half the problem. Many scenarios do not involve components and therefore those cases (which are covered by our test suite) will then fail even with your patch.

Stirling Chow added a comment - 18/Feb/08 02:01 PM
Yes, I see what you mean. There appears to be a considerable amount of UMOEvent information lost during serialization (e.g., session properties, credentials, etc.). Given the existing non-serializable interfaces (e.g., UMOCredentials, UMOSecurityContext), that are enclosed in an event, as well as the fact that arbitrary non-serializable properties may be stored in the UMOMessage, it seems unlikely that one could serialize a UMOEvent without some consequences. This is a shame since it means that there can be significant non-transparent consequences to turning on persistent queues, to the point that one might argue that queues should only be persisted for specific components and not system-wide.

So it seems like the only viable solution is to ensure that the classes that dequeue UMOEvents recreate, if necessary, a default UMOSession and/or UMOComponent. This looks feasible as I believe only SedaComponent and VMMessageReceiver/Dispatcher dequeue events using QueueManager (there might also be additional classes in different models, but I'm mainly interested in the SEDA model). However, this comes with the caveat that the recreated session will likely not contain the complete information from the event's original session.


Andrew Calafato added a comment - 14/Mar/08 07:47 AM