Webspeed AppServer

Posted by bart.syryn on 15-Dec-2015 04:54

Hi, Maybe a stupid question, but is it possible to let a webspeed-broker connect to an AppServer when it starts in the OpenEdge Explorer. At some point I need the Handle to the AppServer for 'run "abcd" on server handle-appserver' in my webspeed programs. Or is the only way a CONNECT statement in the webspeed programs everytime I need some data and businesslogic ? Kind regards Bart Syryn

All Replies

Posted by Mike Fechner on 15-Dec-2015 04:57

These kind of things typically require you to take your own copy of the web-disp.p which is the WebSpeed agent startup procedure. Sometimes it may be enough to use your own startup procedure, do your custom initialization, connect to your appservers and run web-disp.p as the final statement.

Posted by Garry Hall on 15-Dec-2015 07:02

FWIW, there was a bunch of functionality jammed into WebSpeed in 9.1D. Part of this was the ability to set a SUPER_PROC env var for the agent which identified the name of a super-procedure to be run at startup. It was added to a potentially long list of other procedures in the super stack. If Mike's answer doesn't meet your need, you could try this. Caveats: I have never used it so I can't comment on its usefulness, and I don't know if this is supported in PASOE WebSpeed.

Posted by Peter Judge on 15-Dec-2015 08:44

I've done this (added a super in 'classic WebSpeed').  An example of the code is at github.com/.../sessionsuper.p and the config is at github.com/.../ubroker.properties .
 
The mechanism is different in PASOE/Webspeed, where you would likely had your own handler to do this.
 

Posted by bart.syryn on 16-Dec-2015 04:21

Hi,

First of all, thanks for the replies !

The two solutions seems to accomplish what I was looking for.

I've added a super-procedure in the webspeed broker (Environment). In that procedure I connect to the AppServer (like Peter suggested).

I came accross two issues. First was the use of the function 'getAppServer'. I couldn't implement this in my procedure that runs on the webserver (abc.p) and need to run a procedure on the appserver (def.p). I wasn't able to get the handle of the appserver because I wasn't able to call that function. I'm missing something here...  So I solved it with a global shared variable, maybe not the best solution but it worked.

Second issue, how can I disconnect from the AppServer ? The disconnect should happen when the WebSpeed Broker is stopped...

Kind regards

Bart S.

Posted by Mike Fechner on 16-Dec-2015 04:31

Do you really need to disconnect? When the client (WebSpeed agent) QUIT's the AppServer connection will be disconnected anyway. And that will also call the disconnect procedure - if that's your concern.

In web-disp.p there is a WAIT-FOR Block.

/* Wait for a web-request to come in */
WAIT-FOR-BLOCK: 
REPEAT ON ERROR UNDO WAIT-FOR-BLOCK, LEAVE WAIT-FOR-BLOCK 
       ON QUIT  UNDO WAIT-FOR-BLOCK, LEAVE WAIT-FOR-BLOCK
       ON STOP  UNDO WAIT-FOR-BLOCK, NEXT  WAIT-FOR-BLOCK: 

My expectation is, that when WebSpeed exists, the code after that block would be executed. So you'd be back at maintaining your own web-disp.p. At least for a test.

Posted by bart.syryn on 16-Dec-2015 08:52

Hi Mike,

If the connection is disconnected in a correct manner when the WebSpeed broker is stopped, than there's no need to add it in a .p.

I'll do some testing and see what happens.

Thanks !

This thread is closed