Controlling Handler Order in PAS

Posted by benBuckley on 26-Jul-2018 08:57

Is there any way to control the order of web handlers and URL mappings when building a WAR file beyond the ? I have several handlers that begin with the same sub-URI, and the alphabetical ordering of the services happens to put the shorter ones before the more detailed.

Example:

handler1=SomeHandler:/url/{param}
handler2=OtherHandler:/url/{param}/morestuff

Alternatively, is there a way to rename a service after it's been created?

All Replies

Posted by Peter Judge on 26-Jul-2018 09:08

The handlerN  lines in the properties file is the way to do it.
- The order in which they are defined is important, so in your example SomeHandler is used, instead of OtherHandler.
- The  handlers are selected with “begins” checks (and a regex) in the webapp.
 
 

Posted by benBuckley on 26-Jul-2018 09:18

I understand that, and controlling that order is what I'm asking about. The issue I'm having is, when the properties file is generated as part of the WAR file creation. From what I can tell, the initial handler order is being determined by the alphabetical order of the defined services, With ServiceA having its handler lines coming before ServiceB.

My question is whether there's any way to alter this default order without having to modify the generated properties file, or if not, if there's a way to change the names of the services without destroying and recreating them (with hackish solutions being acceptable).

Posted by Peter Judge on 26-Jul-2018 10:04

The challenge with handlers is that not only must they be in order but the N in handlerN MUST be sequential without gaps.
 
The other challenge with the web transport is that we (with one exception) do not tie the ABL service name you provide in PDSOE to any part of the URI. So you can create a /web based service called “RandomServiceName” and with a handler, and add /foo and /bar as URIs for it and the service name is NOT added to the URIs (and thus handler definitions in the properties file).
 
I would recommend that you add the ABL service name to the URI mappings so that you can have better control over your URIs; this should also make for easier renaming
 
We are currently working on improvements in the definition and deployment of ABL services which aim to address these and other issues around /web based ABL services.
 
FWIW, PDSOE creates an intermediary file that it sends top the server and applies there (adds to the openedge.properties file). From memory that contains a handler name and the URIs it handles. I don’t know how that file is applied to the oe.props file (ie appended or prepended etc)
 
 
 
 
 
 
 

Posted by benBuckley on 26-Jul-2018 10:11

My experience suggest that, when deployed through PDS, the intermediary appends new handlers the list, with more recent additions having a higher handler number.

It looks like, at least for the time being, I'll need to rebuild my services.

This thread is closed