cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

how to make an as event as asynchronous

Former Member
0 Likes
784

final ProfilePictureUpdateEvent profilePictureUpdateEvent= new ProfilePictureUpdateEvent(userModel, facebookProfileForm.getPicture(), facebookProfileForm.getId()); eventService.publishEvent(profilePictureUpdateEvent);

In this above line how to make publishEvent as asynch

Accepted Solutions (1)

Accepted Solutions (1)

Former Member

Dear Devi,

According to hybris's official documentation, you can achieve that by implementing ClusterAwareEvent in your class. All Cluster aware events are processed asynchronously.

If you want to ensure that events are published and processed only by the node they come from you can override publish method like this.

 @Override
     public boolean publish(final int sourceNodeId, final int targetNodeId)
 
     {
         return (sourceNodeId == targetNodeId);
     }
 

Kind regards,
Paweł Wrzask

Answers (0)