Requested by Isaac Wilson via LRSUPPORT-38325:
The purpose of this ticket is to request official documentation (or a full knowledge base article, longer than a KCS article) that discusses PERSISTED scheduled jobs. Generally speaking, we have a handful of very brief articles that reference scheduled jobs and note specific actions that need to be taken for them, (see article 1, article 2, article 3, article 4, etc.), but we do not have consolidated documentation describing scheduled jobs (and their requisites/limitations when used in Liferay) that would assist clients in being able to design ones themselves.
Though designing custom scheduled jobs would be outside the realm of Support, Liferay has scheduled jobs built-in that could be described within the documentation, which customers could then use as an example for designing their own. Some additional comments were added to the 7.2 and 7.1 Quartz properties, see
LPS-99378 (which roughly provide some examples of the types of information this documentation would be created for), but ideally the published version of this documentation could also be applied to 7.0 as well, where those portal property comments have not been added to my knowledge.
Specifically, the use case not covered by our existing documentation (reported on a Help Center ticket) that led to this request is for a client who was trying to create a custom (Quartz) scheduled job that used the STORAGE_TYPE=PERSISTED instead of STORAGE_TYPE=MEMORY_CLUSTERED storage type, but have it still work in a clustered environment.
There are a handful of blog posts out there that discuss scheduled jobs in more details, though none of them quite include all the requirements that a client would need to just know about (or be able to pore through our code to learn) in order to use the STORAGE_TYPE=PERSISTED storage type for a job in a clustered environment. The primary posts I've found are:
- This blog post by Minhchau, which is the closest in my opinion to what I'd be envisioning for a Knowledge Base article (though much more detailed than what we'll likely want to publish)
- This blog post by Surekha Technologies (which theoretically contains how to make a PERSISTED job, but does not meet all of Liferay's requirements, see the "resolution" portion below), and
- This blog post (that includes info on specifying the storage type)
The following examples of STORAGE_TYPE.PERSISTED can be seen in OOTB functionality:
However, for this particular client's use case/issue, reaching a resolution was twofold:
- The way the properties for scheduled jobs are handled was changed between 6.0 and 6.1, but it is difficult to find information about these changes, so the properties the client needed to use were different than those from their previous 6.0 environment; and
- Based on the
LPS-115394investigation and conclusions, it was determined that it would also be required that they have a method to define and schedule it (such as a UI menu), which means that the job would be invoked manually (using schedule/unschedule/delete/pause/resume), instead of automatically using the message listener service API that would be used for a MEMORY_CLUSTERED job (I cannot find this documented anywhere).
As such, I'd request that the created documentation would include:
- Basic information about quartz scheduled jobs in Liferay and the properties used to control them (including in a cluster), and
- Information about examples in core code of both a MEMORY_CLUSTERED and a PERSISTED job.
- Alternately, there are various POCs for scheduled jobs that have been created in the past (such as this Blade Sample). If it would be simpler than creating documentation, I am wondering whether we could instead explore the possibility of creating another sample that uses the PERSISTED storage type (in a cluster), and we could just make a KCS-style article that points to the sample in place of a full article.