A kind of system integration method based on the HttpClient technology
Technical field
The present invention needs to provide in the various systems of the system integration a kind of system integration method based on the HttpClient technology.
Background technology
Along with the continuous development of informatization, enterprise operation system quantity constantly increases, and complexity also more and more is difficult to control, and this just need be integrated into each operation system in the unified element task platform.And common system integration single-sign-on implementation method is utilized the integrated goal systems of IFRAME mode as adopting simulation login URL; All there is following problem based on single-sign-on of the reverse proxy function of Apache HTTP Server server etc.: the setting of detail parameters such as the connection time-out time of the uncontrollable more uncontrollable goal systems of request process of integrated business function or page time for reading; Can't be according to remote system running status control operation flow trend; A large amount of unusual occlusive effects native system performances etc. of asking when goal systems is unavailable.These problems have not only influenced integrated business function quality, and more likely can influence the performance of native system.
Summary of the invention
The purpose of this invention is to provide a kind of system integration method based on the HttpClient technology.
The objective of the invention is to realize by following mode; Utilize Apache Commons Httpclient technology to carry out communication, realize user's login of goal systems, simultaneously the session information of preservation and leading subscriber with server; System is provided with various parameters and comes the access request of remote system is accurately controlled; When the user asks the business function of access destination system, monitor whole request flow process and service response situation, and the feedback of various states in this monitor procedure is provided; According to the practical business demand feedack is comprised the concrete processing of switching, forwarding or the interruption of carrying out flow process then; When goal systems occurs comprising that service is unusual, the machine of delaying unusual the time, the method also provides the request interception mechanism to avoid a large amount of unusual request occlusive effects native system performances, surveys the normal recovery request in time of mechanism goal systems visit in case launch probe simultaneously; Final system request controllable process and the perfect exception handling realized specifically may further comprise the steps:
A. utilize Apache Commons Httpclient technical modelling HTTP client login goal systems, and the user session information after will logining is successfully preserved and management;
B. according to wanting integrated system's setting to comprise to connect overtime, the page to read the various required parameters of overtime, solicited message coded system, response page coded system, come the access request of remote system is accurately controlled through these parameters;
C. when the user asks the business function of access destination system; Monitor whole request flow process and service response situation; And the feedback of various states in this monitor procedure is provided; Comprise that request is rejected, connects overtime, login failed for user, the overtime information of requests for page, carries out handled based on business demand to feedback information then;
D. unusual when the goal systems appearance, comprise that service is unusual, the request interception mechanism is provided when delaying machine, avoid a large amount of occlusive effects of request unusually native system performances;
E. probe mechanism also starts thereupon when the request interception mechanism starts, and probe is constantly surveyed remote system on the backstage, in case goal systems is visited normally then in time proposed recovery request.
The invention has the beneficial effects as follows: the inventive method adopt strategies such as request process is accurately controlled, process status feedback, request interception, probe detection and mechanism innovation property solution each problem of prior art existence.Adopt Apache Commons Httpclient technical modelling HTTP client (like browser) and server to carry out user's login that communication realizes goal systems, the session information of preservation and leading subscriber simultaneously.System can come the visit of remote system is accurately controlled through various required parameters are set; When the user asks the business function of access destination system, monitor whole request flow process and service response situation and the feedback of various states in this monitor procedure is provided; According to the practical business demand feedack is specifically handled, as carried out switching, forwarding or the interruption etc. of flow process.The method also provides the request interception mechanism to avoid a large amount of unusual request occlusive effects native system performances when unusual (as serving unusual, the machine of delaying) appears in goal systems, surveys the normal recovery request in time of mechanism goal systems visit in case launch probe simultaneously.The final controlled and perfect exception handling of request process of realizing.
Description of drawings
Fig. 1 is that required parameter is provided with function diagram in detail;
Fig. 2 is system integration overall flow figure.
Embodiment
Explanation at length below with reference to Figure of description method of the present invention being done.
The invention solves the uncontrollable problem of whole request flow process in the system integration in the past, can turn to according to accurate control request process of the business need of reality or operation flow, this is a quantum jump of system integration problem.The introducing request interception of novelty and probe are surveyed mechanism; Stopped traditional integrated system if appearance might cause the hidden danger of local system collapse when unusual or unavailable; The stability and the fail safe of the system's operation that improves greatly, the degree of coupling between system is lower, and relative independentability is stronger.Can conveniently add new integrated system from exploitation angle this invention, also can be transplanted to easily in other the project and go.
The operating process key step of the inventive method is following:
A. utilize Apache Commons Httpclient technical modelling HTTP client login goal systems, and the user session information after will logining is successfully preserved and management, later user sends when goal systems is sent access request once more in the lump;
B. according to different integrated systems different required parameters is set; As connect time-out time, the page and read time-out time, the maximum frequency of failure, loop detection cycle, loop detection number of times, solicited message coded system, response page coded system, whether launch other detail parameters such as this single-sign-on agency and every main frame maximum number of connections, come the access request of remote system is accurately controlled through these parameters;
C. when the user asks the business function of access destination system, monitor whole request flow process and service response situation and provide feedback such as the request address of various states in this monitor procedure illegal, request is rejected, connects overtime, login failed for user, the overtime inefficacy of user conversation, accession page does not exist or transfer, requests for page are overtime, user's unauthorized access etc.; Based on the practical business demand concrete feedback information is carried out handled respectively then, like simple prompting, the switching of carrying out flow process, forwarding or interruption etc.;
D. the method provides the request interception mechanism when unusual (as serving unusual, the machine of delaying) appears in goal systems.When user access request frequency of failure accumulative total reaches threshold values, then no longer send request to remote system, the request that receives is later on all directly tackled and is avoided a large amount of unusual request occlusive effects native system performances;
E. probe mechanism also starts thereupon when the request interception mechanism starts, and probe is constantly surveyed remote system on the backstage, in case the normal recovery request in time of goal systems visit.
Except that the described technical characterictic of specification, be the known technology of those skilled in the art.