Parallel Rendering of Portlet Sample

Attaching sample potlet application that you can use for playing with Parallel Rendering of portlet. First Install PrallelRenderingTest.war file as portlet application. It has 4 portlets. Add all of them on one page say Parallel rendering Test Page.
In the sample portlet i am printing name of the current thread and for parallel rendering 1 and 2 portlet i have Thread.sleep() statement to put current render() request in sleep.
When you try to access the Parallel rendering test page you should see output like this[9/26/08 6:15:33:549 EDT] 000000ab SystemOut O Entering ParallelRenderingPortlet1 WebContainer : 6 Fri Sep 26 06:15:33 EDT 2008[9/26/08 6:15:35:164 EDT] 000000ab SystemOut O Exiting ParallelRenderingPortlet1 Fri Sep 26 06:15:35 EDT 2008[9/26/08 6:15:35:170 EDT] 000000a9 SystemOut O Entering ParallelRenderingPortlet 2 WebContainer : 6 Fri Sep 26 06:15:35 EDT 2008[9/26/08 6:15:38:673 EDT] 000000a9 SystemOut O Exiting ParallelRenderingPortlet 2 Fri Sep 26 06:15:38 EDT 2008[9/26/08 6:15:38:677 EDT] 000000a9 SystemOut O Entering Sequential rendering portlet 2 WebContainer : 6 Fri Sep 26 06:15:38 EDT 2008[9/26/08 6:15:38:677 EDT] 000000a9 SystemOut O Exiting Sequential rendering portlet 2 Fri Sep 26 06:15:38 EDT 2008[9/26/08 6:15:38:681 EDT] 000000a9 SystemOut O Entering Sequential rendering portlet 1 WebContainer : 6 Fri Sep 26 06:15:38 EDT 2008[9/26/08 6:15:38:681 EDT] 000000a9 SystemOut O Exiting Sequential rendering portlet 1 Fri Sep 26 06:15:38 EDT 2008As you can see the Thread Name for all 4 portlets is WebContainer : 6.
Now enable the parallel rendering at portla server level and at the portlet container level and try to access the page again[9/26/08 6:26:10:246 EDT] 000000ab SystemOut O Entering ParallelRenderingPortlet 2 WorkManager.wpsWorkManager : 0 Fri Sep 26 06:26:10 EDT 2008[9/26/08 6:26:10:295 EDT] 000000a7 SystemOut O Entering ParallelRenderingPortlet1 WebContainer : 4 Fri Sep 26 06:26:10 EDT 2008[9/26/08 6:26:25:296 EDT] 000000a7 SystemOut O Exiting ParallelRenderingPortlet1 Fri Sep 26 06:26:25 EDT 2008[9/26/08 6:26:27:306 EDT] 000000a7 AbstractRende E com.ibm.wps.pe.ext.render.AbstractRenderManager performService EJPPG1110E: A timeout occurred when reading the output for portlet window Control (ParallelRenderingPortlet2, [ObjectIDImpl '7_32DSUKG100GBC027P3ULPA00G0', NAVIGATION_NODE, VP: 0, [Domain: rel], DB: 0000-4334EE290C00C0C5803879F89A150010], [ObjectIDImpl '6_32DSUKG100GBC027P3ULPA0000', CONTENT_NODE, VP: 0, [Domain: rel], DB: 0000-4334EE290C00C0C5803879F89A150000], 200 that is rendered in a parallel thread. The portlet output will not be displayed. [9/26/08 6:26:45:244 EDT] 000000ab SystemOut O Exiting ParallelRenderingPortlet 2 Fri Sep 26 06:26:45 EDT 2008[9/26/08 6:51:27:264 EDT] 000000a7 SystemOut O Entering Sequential rendering portlet 2 WebContainer : 4 Fri Sep 26 06:51:27 EDT 2008[9/26/08 6:51:27:265 EDT] 000000a7 SystemOut O Exiting Sequential rendering portlet 2 Fri Sep 26 06:51:27 EDT 2008[9/26/08 6:51:27:334 EDT] 000000a7 SystemOut O Entering Sequential rendering portlet 1 WebContainer : 4 Fri Sep 26 06:51:27 EDT 2008[9/26/08 6:51:27:334 EDT] 000000a7 SystemOut O Exiting Sequential rendering portlet 1 Fri Sep 26 06:51:27 EDT 2008
As you can see Parallel Rendering Portlet 2 was called in WorkManager.wpsWorkManager : 0 where Parallel rendeing portlet 2 was called in WebContainer :4 thread, sequential portlet 1 and 2 were also called in WebContainer :4 thread.
You can also see "A timeout occurred when reading the output for portlet window Control" message in the SystemOut.log that message is because Parallel rendering portlet 2 is sleeping for 35000 milliseconds which is more than the parallel rendering timeout value. So the WPS server will abort rendering of Parallel Rendering 2 portlet and write this message in log. On the user output side it will render output of all 3 portlets except Parallel rendering portlet 2 and for that portlet it will display error message to the user.
The PortletContainer Service Link has further information about parallel rendering

No comments:

Post a Comment