I'm still new to both PAS and KUIB and after searching a while for any information on this issue I can't find anything.
As part of my KUIB app I make some separate $http get/put requests. When I make a code change to the backend, I stop the agents so that the new code is loaded as the new agents start. The issue is that after stopping the agents, the first time the KUIB app loads, my separate get/put requests fail with 500 errors. If I then refresh the page everything works fine because the PAS agents are already running.
Do I need to configure something in PAS so that the requests queues up while the agent(s) start, or do I have to handle this within the KUIB app?
Also, we are aware of the problem with first requests failure when we perform deletion/termination of the agent and we are working on a fix for it for the future releases. So to update new code, I would suggest terminateIDLESessions as a right choice.
We do not need to stop the agent if we want to update the ABL code. You can follow the same approach that we follow with PDSOE while publishing updated code to the PASOE Server.
You can use the oemanager API(terminate inactive Sessions) to terminate the sessions that are sitting IDLE. On your next request, new sessions will be started and they will load the updated classes.
Here are the details to call that API
URI - http://<host>:<port>/oemanager/applications/<appname>/<agentId>/sessions
HTTP Operation - DELETE
Media type - Application/vnd.progress+json
curl -X DELETE -v -u username:password "localhost:8810/.../sessions"
Great, thanks Irfan.
In regards to the DELETE operation, is there a call get the list of agent(s) and session(s) similar to the Agents screen in OE Explorer? If not, do you have to use OE Explorer to get the <agentid> or is there another method so that everything can be done from the command line?
In-order to get all the HTTP sessions then you do
In-order to get all agents
In-order to get all the sessions of an agent
Thanks for the information. I ran into an issue a while back where the code executing wasn't updated but my guess is I just sent my requests to quick. After running a few tests just now it appears the code is updating correctly without stopping the agents.
Since I don't necessarily need to stop the agents, I should only get the 500 errors on the first call(s) right after PAS is started. I'd still like to handle these if it isn't too much work. Any thoughts on that aspect of my original question. I found the following posts regarding $httpProvider.interceptors but can't figure out within the KUIB architecture how to get this to work.
Perfect! Thanks for the info and doc reference, this will definitely help streamline the management of PAS for us.
Also try this little program and tell me how it works for you. Simply place it in your PASOEContent/static folder, and publish to your instance. Run it at /static/devinfo.html to view data about your PAS instance and to "delete" your agent or sessions. It illustrates use of the above documented API using jQuery.
Kendo UI Builder uses the Kendo UI DataSource which internally uses the JSDO. The JSDO uses the XMLHttpRequest object (XHR) to communicate with the backend.
I do not expect the Angular interceptors to work with direct XHR calls.
There are ways that we could overload the XHR object used by the JSDO to intercept the request.
However, personally, I would go with Irfan's suggestion of using terminateIDLESessions.
I hope this helps,
Thanks for the program, I have it installed but unfortunately it isn't working. I believe this is because I am currently running all of this from the KUIB dev/node.js environment. Due to the nature of the application, even when I release this to production we will not be serving the KUIB app from PAS, we will have this on IIS. The program is still very useful as I can get some great information and examples from it.