Soumitri Pattnaik
Soumitri Pattnaik

Reputation: 3556

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. For notifications I am using JMS and ActiveMQ with Spring boot JMS with Spring Boot.

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.

Upvotes: 0

Views: 230

Answers (1)

martin-g
martin-g

Reputation: 17533

You have two options:

  1. Use AbstractAjaxTimerBehavior and poll for updates every N seconds
  2. Use WebSocketBehavior and push the updates whenever they come. See 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).

Upvotes: 1

Related Questions