简体   繁体   English

Wicket组件使用JMS侦听器自动刷新

[英]Wicket component auto refresh using JMS listener

I am trying to create a notification panel using Wicket 7 and Spring boot 1.5.3 as backend. 我正在尝试使用Wicket 7和Spring Boot 1.5.3作为后端创建一个通知面板。 For notifications I am using JMS and ActiveMQ with Spring boot JMS with Spring Boot . 对于通知,我在Spring Boot中使用JMS和ActiveMQ在Spring Boot中使用JMS。

My question is how can I auto refresh (re-render/update) a wicket component as soon as a message comes in from my JMS Listener. 我的问题是,一旦从JMS侦听器收到消息,如何自动刷新(重新渲染/更新)检票口组件。

You have two options: 您有两种选择:

  1. Use AbstractAjaxTimerBehavior and poll for updates every N seconds 使用AbstractAjaxTimerBehavior并每N秒轮询一次更新
  2. Use WebSocketBehavior and push the updates whenever they come. 使用WebSocketBehavior并在更新出现时推送更新。 See https://ci.apache.org/projects/wicket/guide/7.x/single.html#_native_websockets 参见https://ci.apache.org/projects/wicket/guide/7.x/single.html#_native_websockets

Using WebSockets is recommended but depends whether your application is used by old browsers (IE9 and older). 建议使用WebSockets,但要取决于您的应用程序是否被旧的浏览器(IE9和更早的版本)使用。

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

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