上的作业上的MSGW消息

上的作业上的MSGW消息

本文介绍了通过Java监视和处理IBM i系列(AS/400)上的作业上的MSGW消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道如何自动回复状态为MSGW的消息,从而阻止IBM i系列(AS/400)上的作业?

Does anyone know how one can automatically reply to messages with status MSGW that block a job on an IBM i-series (AS/400)?

我正在使用jt400/jtopen库从Java访问AS/400上的程序.我正在使用com.ibm.as400.access.ProgramCall类,该类可以正常工作,除非程序由于某种原因而失败.与几乎所有程序一样,有时会发生故障,但是不幸的是,在这种情况下,它不会导致状态消息或异常.而是,调用线程只是挂起.更糟糕的是,对AS/400进行的任何获取作业信息的调用(jt400中的另一个类,大多数都可以完成您期望的工作)都将挂起队列.

I'm using the jt400/jtopen library to access a program on an AS/400 from Java. I'm using the com.ibm.as400.access.ProgramCall class, which works fine, unless the program fails for some reason. As with almost any program, failures will happen sometimes, but unfortunately, in this case, it does not result in a status message or an exception. Instead, the calling thread just hangs. What's worse, any call to the AS/400 to get information on the Job (another class in jt400 that mostly does what you would expect) backing the queue will hang as well.

我当然可以监视调用在其中运行的线程,并在等待一会后将其杀死,但这是最后的选择.从系统找回错误消息会很好.

I could of course monitor the thread in which the call runs and simply kill it after waiting for a while, but that's a last resort. Getting an error message back from the system would be nice.

推荐答案

我发现您可以使用ExecutorService的超时机制来中断MSGW中的ProgramCall.

I've found that you can use the timeout mechanism of ExecutorService to interrupt a ProgramCall in MSGW.

此后,您必须丢弃AS400对象,并且服务器作业仍在MSGW中,但是至少您可以在Javaside上继续.

You must discard the AS400 object afterwards, and the server job is still in MSGW, but at least you can continue on the Javaside.

(如果要调查挂起的作业,则需要使用单独的AS400对象.)

(You need to use a separate AS400 object if you want to investigate on the hanging job.)

这篇关于通过Java监视和处理IBM i系列(AS/400)上的作业上的MSGW消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-07 04:29