Replace Jobs with threads to handle mentions asynchronously
Last modified by Vincent Massol on 2021/04/06
The user mention analysis, to detect new mentions and send notifications to target users, is now done by a pool of threads.
Configuration
A configuration option to define the size of the thread pool is available in xwiki.properties.
#-# [Since 12.6]
#-# The detection and notification for the user mentions in created or edited content is done asynchronously
#-# by a pool of consumers.
#-# This properties controls the size of this pool.
#-#
#-# The default is :
# mentions.poolSize = 1
#-# The detection and notification for the user mentions in created or edited content is done asynchronously
#-# by a pool of consumers.
#-# This properties controls the size of this pool.
#-#
#-# The default is :
# mentions.poolSize = 1
JMX Monitoring
An object named org.xwiki:name=mentions is provided and provides two attributes and one operation:
- QueueSize: Displays the number of elements (created or updated pages) to be analysed.
- ThreadNumber: The number the threads in the thread pool.
- clearQueue(): Removes all the elements in the queue. Warning: By doing so some pages will not be analysed and some mentions will be missed. To be used carefully.