简体   繁体   English

有什么办法可以按顺序触发计划任务?

[英]Is there any way to trigger scheduled task in a sequence?

I have a scheduled task which performs an operation in 40min periods. 我有一个计划的任务,可以在40分钟内执行一次操作。 But, I want to trigger this task in a Sequence when the HTTP response code is 401 for example. 但是,例如,当HTTP响应代码为401时,我想在序列中触发此任务。 Is there any way to do this? 有什么办法吗?

WSO2 version 6.4.0 WSO2版本6.4.0

Thanks for any idea! 感谢您的任何想法!

There is no way to do that, a scheduled task is just that. 没有办法做到这一点,计划任务就是这样。 A task that runs on a schedule. 按计划运行的任务。 However, generally the task will be used to send a message to a sequence/proxy/api to start that. 但是,通常该任务将用于将消息发送到sequence / proxy / api以启动该消息。

So possibly you can do just that when your other sequence receives the 401 response, call whatever it is that is normally triggered by your scheduled task. 因此,当其他序列收到401响应时,您可以执行此操作,调用通常由计划任务触发的任何响应。

which performs an operation 执行操作

What kind of operation? 什么样的手术?

You may put this operation in a special sequence. 您可以按特殊顺序进行此操作。 And call this sequence from scheduled task and from your second sequence in case of HTTP error 401. 如果发生HTTP错误401,请从计划任务和第二个序列中调用此序列。

<filter source="$axis2:HTTP_SC" regex="401">
<then>
    <sequence key="my_first_sequence"/>
<then>
</filter>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM