Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Enrico Oliosi
Portlet Events: synchronous or asynchronous?
September 17, 2012 6:19 AM
Answer

Enrico Oliosi

Rank: Junior Member

Posts: 40

Join Date: July 6, 2010

Recent Posts

I read that Portlet Spec 2.0 allow you to send event between portlets so they send each other a payload (a serializable object).
I would like to know if this comunication is synchronous or asynchronous.
For example if i have this snippet
 1
 2@ProcessAction
 3public void myAction(ActionResponse res, ... ) throws ...
 4{
 5  [...]
 6  response.setEvent(...); // event 1
 7  [...]
 8  response.setEvent(...); // event 2
 9}

when I send event 1, does sender portlet wait a response from portlet(s) that manage event 1 or portlet container
sends event 2 without waiting response of receiver portlet(s) on event 1?

Thx a lot to all-
Harish Kumar
RE: Portlet Events: synchronous or asynchronous?
September 17, 2012 8:42 AM
Answer

Harish Kumar

Rank: Expert

Posts: 473

Join Date: July 31, 2010

Recent Posts

Hi,

No, sender portlet won't wait for response and events will generate in the order specified. Portlet events are like broadcast and they are not even guaranteed to be delivered because no queue is maintained for them.

HTH