掲示板
Store job details in liferay quartz-* tables
13年前 に Michal Radziwonowicz によって更新されました。
Store job details in liferay quartz-* tables
New Member 投稿: 7 参加年月日: 10/10/28 最新の投稿
Hi all,
I'm working on the scheduler in portlet. This portlet should store details for scheduled jobs in liferay quartz-* tables. Now job details are stored in RAMJobStore, which is not the best solution: when tomcat will be shut down, the job details will be delated. Did anybody have experience with storing job details in quartz-* liferay tables?
What I alredy did, is adding following lines in portal-ext.properties but it did'nt help:
(I changed jobStore.class from PortalJobStore into JobStoreTX)
Cheers,
Michal
I'm working on the scheduler in portlet. This portlet should store details for scheduled jobs in liferay quartz-* tables. Now job details are stored in RAMJobStore, which is not the best solution: when tomcat will be shut down, the job details will be delated. Did anybody have experience with storing job details in quartz-* liferay tables?
What I alredy did, is adding following lines in portal-ext.properties but it did'nt help:
(I changed jobStore.class from PortalJobStore into JobStoreTX)
## Scheduler
scheduler.enabled=true
scheduler.classes=com.liferay.sampleservicebuilder.util.job.JobSchedulerInterface
## Quartz
org.quartz.dataSource.ds.connectionProvider.class=com.liferay.portal.scheduler.quartz.QuartzConnectionProviderImpl
org.quartz.jobStore.class=org.quartz.impl.jdbcjobstore.JobStoreTX
org.quartz.jobStore.dataSource=ds
org.quartz.jobStore.driverDelegateClass=com.liferay.portal.scheduler.quartz.DynamicDriverDelegate
org.quartz.jobStore.isClustered=false
org.quartz.jobStore.misfireThreshold=60000
org.quartz.jobStore.tablePrefix=QUARTZ_
org.quartz.jobStore.useProperties=true
org.quartz.scheduler.instanceId=AUTO
org.quartz.threadPool.class=org.quartz.simpl.SimpleThreadPool
org.quartz.threadPool.threadCount=5
org.quartz.threadPool.threadPriority=5
Cheers,
Michal
7年前 に Naresh Reddy Kallamadi によって更新されました。
RE: Store job details in liferay quartz-* tables
Regular Member 投稿: 120 参加年月日: 14/07/09 最新の投稿
Hi Michal,
I too got same issue, Did you find any solution ?
Thanks,
Naresh Kallamadi.
I too got same issue, Did you find any solution ?
Thanks,
Naresh Kallamadi.
7年前 に David H Nebinger によって更新されました。
RE: Store job details in liferay quartz-* tables
Liferay Legend 投稿: 14919 参加年月日: 06/09/02 最新の投稿
Guys you should never be modifying Liferay tables directly.
Instead use the Liferay scheduler API to add jobs, just use the correct storage type value and it will persist across restarts.
https://web.liferay.com/web/user.26526/blog/-/blogs/liferay-7-ce-liferay-dxp-scheduled-tasks
Instead use the Liferay scheduler API to add jobs, just use the correct storage type value and it will persist across restarts.
https://web.liferay.com/web/user.26526/blog/-/blogs/liferay-7-ce-liferay-dxp-scheduled-tasks
7年前 に Naresh Reddy Kallamadi によって更新されました。
RE: Store job details in liferay quartz-* tables
Regular Member 投稿: 120 参加年月日: 14/07/09 最新の投稿
Thanks for your help David,
I have written below code in my controller to create job, Scheduler will invoke but when we restarts server scheduler wont call.
Message message = new Message();
message.put(SchedulerEngine.MESSAGE_LISTENER_CLASS_NAME,className);
message.put(SchedulerEngine.PORTLET_ID, portletId);
message.put("portletId", portletId);
Trigger trigger = new CronTrigger(jobName,jobName, cronText);
try {
SchedulerEngineHelperUtil.schedule(
trigger,StorageType.MEMORY_CLUSTERED,
"Message Scheduler Description",
DestinationNames.SCHEDULER_DISPATCH,
message,
0);
} catch (SchedulerException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Can you provide me some guidance to come out of this problem?
Thanks,
Naresh Kallamadi.
I have written below code in my controller to create job, Scheduler will invoke but when we restarts server scheduler wont call.
Message message = new Message();
message.put(SchedulerEngine.MESSAGE_LISTENER_CLASS_NAME,className);
message.put(SchedulerEngine.PORTLET_ID, portletId);
message.put("portletId", portletId);
Trigger trigger = new CronTrigger(jobName,jobName, cronText);
try {
SchedulerEngineHelperUtil.schedule(
trigger,StorageType.MEMORY_CLUSTERED,
"Message Scheduler Description",
DestinationNames.SCHEDULER_DISPATCH,
message,
0);
} catch (SchedulerException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Can you provide me some guidance to come out of this problem?
Thanks,
Naresh Kallamadi.
7年前 に David H Nebinger によって更新されました。
RE: Store job details in liferay quartz-* tables
Liferay Legend 投稿: 14919 参加年月日: 06/09/02 最新の投稿Naresh Reddy Kallamadi:
Can you provide me some guidance to come out of this problem?
Seriously? I gave you a blog link where right on the first page there are 3 bullets talking about storage type and it highlights that MEMORY_CLUSTERED is not persisted. And it also talks about PERSISTED.
Makes me wonder why I even bother.
7年前 に Jack Bakker によって更新されました。
RE: Store job details in liferay quartz-* tables
Liferay Master 投稿: 978 参加年月日: 10/01/03 最新の投稿
Thanks for continuing to bother David.
7年前 に Naresh Reddy Kallamadi によって更新されました。
RE: Store job details in liferay quartz-* tables
Regular Member 投稿: 120 参加年月日: 14/07/09 最新の投稿
Thanks David for your reply,
I red all 3 types of memory types in blog which you mentioned, I changed memory type StorageType.MEMORY_CLUSTERED to StorageType..PERSISTED still no luck.
But same thing which I configured scheduler through liferay-portlet.xml is working where memory type is StorageType.MEMORY_CLUSTERED on server restarts as well not working when we set scheduler through coding on server restarts.
Thanks,
Naresh.
I red all 3 types of memory types in blog which you mentioned, I changed memory type StorageType.MEMORY_CLUSTERED to StorageType..PERSISTED still no luck.
But same thing which I configured scheduler through liferay-portlet.xml is working where memory type is StorageType.MEMORY_CLUSTERED on server restarts as well not working when we set scheduler through coding on server restarts.
Thanks,
Naresh.