[英]ATG scheduler/Queue Manager
ATG scheduler creates the scheduled job and executes it. ATG计划程序会创建并执行计划的作业。 If the job is in scheduler's thread other jobs have to wait.
如果作业在调度程序的线程中,则其他作业必须等待。 What I want to do is use ATG scheduler to create the job, pass to queue manager so that it executes one after other not stopping the scheduler all together.
我想做的是使用ATG调度程序创建作业,传递给队列管理器,以便它一个接一个地执行而不一起停止调度程序。 so I want to put a queue between scheduler creating the job and scheduler executing that same job.
所以我想在创建作业的调度程序和执行同一作业的调度程序之间放置一个队列。 Can this be done?
能做到吗? or there is a way where all my jobs will use same thread that's not scheduler's thread?
还是有一种方法,我的所有作业都将使用同一线程而不是调度程序的线程?
It sounds like you want to use a Dynamo Messaging System (aka PatchBay) queue in combination with a scheduler. 听起来好像您想将Dynamo消息系统(又名PatchBay)队列与调度程序结合使用。
Something along the lines of: 类似于以下内容:
MessageSource
to put a jms messages on a queue for each job This ensures that the scheduler does not have to "wait" as it simply creates jms messages for each job. MessageSource
将jms消息放入每个作业的队列中。 这确保了调度程序不必“等待”,因为它只需为每个作业创建jms消息即可。 JobMessageListener
which implements the onMessage
event and reads the jobs off the queue and delegates the work to another service. JobMessageListener
,该组件实现onMessage
事件并从队列中读取作业,并将工作委托给另一个服务。 This ensures that the job fire up automatically and are processed in order as it is using a jms queue. JobProcessorService
which does the heavy lifting and processes the jobs. JobProcessorService
这样的工作,它负责繁重的工作并处理作业。 You do not mention which version of ATG however for ATG 10.2 the instructions for achieving this can be found here . 您没有提到ATG的哪个版本,但是有关ATG 10.2的说明,请参见此处 。
You can control whether the job executes in its own thread or the schedulers thread if you are scheduling the job with the scheduler yourself via the schedulder.addScheduledJob(...)
method. 如果要通过调度程序自己通过
schedulder.addScheduledJob(...)
方法调度作业,则可以控制该作业是在其自己的线程中执行还是在调度程序线程中执行。 The threadMethod
property of ScheduledJob
has three possible settings which are discussed in the link below. ScheduledJob
的threadMethod
属性具有三个可能的设置,下面的链接中对此进行了讨论。
ScheduledJob Thread Methods - Documentation Link ScheduledJob线程方法-文档链接
Basically, you have: 基本上,您有:
So, it sounds like you would want to use either SEPARATE_THREAD or REUSED_THREAD . 因此,听起来您想使用SEPARATE_THREAD或REUSED_THREAD 。
public void doStartService() throws ServiceException
{
ScheduledJob job = new ScheduledJob("hello",
"Prints Hello",
getAbsoluteName(),
getSchedule(),
this,
ScheduledJob.SEPARATE_THREAD);
jobId = getScheduler().addScheduledJob(job);
}
If you're creating a job that extends from either SchedulableService
or SingletonSchedulableService
then you can configure the threadMethodString
property of your component to have a value of either scheduler
, separate
, or reused
and therefore avoid the custom coding shown above. 如果您正在创建从任一延伸的工作
SchedulableService
或SingletonSchedulableService
那么你就可以在配置threadMethodString
您的组件的属性要么值scheduler
, separate
或reused
,因此避免上面显示的自定义编码。 By default it is set to reused
. 默认情况下,它设置为复
reused
。
For example: 例如:
# /my/custom/MyScheduledJob
$class=my.custom.MyScheduledJob
$scope=global
threadMethodString=separate
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.