Kbase P13454: Is it possible to know the status of an AppServer broker from the 4GL
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  16/10/2008 |
|
Status: Unverified
GOAL:
Is it possible to know the status of an AppServer broker from the 4GL
FIX:
No, it's not possible to know the status of an AppServer broker directly.
You can run the CONNECT() method of the AppServer handle with the NO-ERROR option, and then test the return value of the CONNECT() method itself: FALSE will indicate that you could not connect to the AppServer, and ERROR-STATUS:NUM-MESSAGES and ERROR-STATUS:GET-MESSAGE() will help you understand why. For example:
DEF VAR hServer AS HANDLE.
DEF VAR ok AS LOGICAL.
DEF VAR c AS INTEGER.
CREATE SERVER hServer.
ok = hServer:CONNECT("-H myHost -AppService asbroker1") NO-ERROR.
IF NOT ok THEN
DO:
MESSAGE "CONNECT() failed with the following errors." VIEW-AS ALERT-BOX ERROR.
DO c = 1 TO ERROR-STATUS:NUM-MESSAGES:
MESSAGE ERROR-STATUS:GET-MESSAGE(c) VIEW-AS ALERT-BOX ERROR.
END.
QUIT.
END.
Please be aware that there may be two different scenarios:
1) If the -H parameter refers to an existing machine, but with no AppServer/NameServer running, CONNECT() will fail in a short time (a couple of seconds), therefore the response time is acceptable.
2) If the -H parameter refers to a NON-existing or unreacheable machine, it may take quite a while before CONNECT() fails, as Progress has to wait for the TCP/IP layer to understand that communication with the requested machine is not possible at all. In this case, response time may be not acceptable.
However, it is expected that your application will be configured at least with the correct host name, and will always fall in case 1).