简体   繁体   English

Liferay Portlet可以侦听数据库事件吗?

[英]Can liferay portlets listen to Database events?

My current setup : 我当前的设置:

  • Multiple nodes share the same database updating the values. 多个节点共享同一数据库,以更新值。
  • The cache is NOT shared among them 它们之间不共享缓存

Requirement : 要求:

  • The liferay cache needs to be updated when any one node does a DB update. 任何一个节点进行数据库更新时,都需要更新liferay缓存。

Question

  • Is there a way portlets can listen to my database and update its cache . Portlet有什么方法可以侦听我的数据库并更新其缓存。
  • Is cache independency a correct approach ? 缓存独立性是正确的方法吗? (I dont have control over this decision) (我对此决定没有控制权)
  • If we do proper clustering, can we shut down a node independent of the other. 如果我们进行适当的集群,是否可以关闭一个独立于另一个节点的节点。 Will liferay handle this automatically ? Liferay会自动处理吗?

Thanks in advance 提前致谢

I would cluster Liferay and enable propagation of cache invalidation. 我将群集Liferay并启用高速缓存无效性的传播。 Then when something changes the data would be automatically updated. 然后,当发生更改时,数据将自动更新。

If you by cache independency mean that the cache is not replicated then I would say yes. 如果您通过缓存独立性意味着不复制缓存,那么我会说是。 Replication is costly and propagation of cache invalidation should suffice. 复制是昂贵的,并且高速缓存失效的传播就足够了。

If you have clustering you have to have node balancing in front of Liferay (apache ...). 如果您有群集,则必须在Liferay(Apache ...)前面进行节点平衡。 Then when you kill one Liferay the balancer should detect it and ignore the killed node until it goes up again. 然后,当您杀死一个Liferay时,平衡器应检测到它并忽略被杀死的节点,直到它再次上升为止。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM