The content of the invention
It is an object of the invention to provide a kind of system integration method based on HttpClient technologies.
The purpose of the present invention is realized in the following manner, using Apache Commons Httpclient technologies and clothes
Business device is communicated, and realizes the User logs in of goal systems, while preserving and managing the session information of user, system arranges various
Parameter carries out precise control come the access request to remote system, and goal systems refers in multiple remote systems wherein one
Individual system, in the business function of user's request access target system, monitoring is whole to ask flow process and service response situation, and carries
For the feedback of various states during this monitoring, then feedack is carried out including flowing according to practical business demand
Switching, forwarding or the concrete process interrupted of journey, when there is including abnormal service, the exception of machine of delaying in goal systems, the method
Also provide request interception mechanism and avoid a large amount of exception request occlusive effects the system performances, while enabling probe detection mechanism one
Denier goal systems accesses normal recovery request in time, finally realizes system request process control and perfect exception handling,
Specifically include following steps:
A. goal systems is logged in using Apache Commons Httpclient technical modelling HTTP clients, and will step on
User session information after record success is preserved and is managed;
B. basis wants integrated system to arrange includes that connection time-out, the page read time-out, solicited message coded system, respond
The various required parameters of page coded system, carry out precise control come the access request to remote system by these parameters;
C., in the business function of user's request access target system, monitoring is whole to ask flow process and service response situation,
And the feedback of various states during this monitoring is provided, including request is rejected, connects time-out, login failed for user, request
The information of page time-out, then according to business demand, make whether 1. access again, 2. whether need to log in, 3. whether exceed
Failure maximum times, the loop detection cycle 4. whether is reached, 5. whether exceeded loop detection number of times, 6. whether reached time-out time
Process;
D. when goal systems occur it is abnormal, including service it is abnormal, delay machine when request interception mechanism is provided, it is to avoid great Liang Yi
Occlusive effects the system performance is asked often;
E. while asking interception mechanism to start, probe mechanism also starts therewith, and constantly detection is long-range on backstage for probe
System, proposes recovery request if goal systems is accessed normally in time.
It is integrated, the integrated system to the deployed each operation system reached the standard grade based on the integrated system of HttpClient technologies
System calls the functional module of each operation system by way of Transfer Parameters, obtains the parameter value for needing.The system being integrated
Limit with logging in, remote port is accessed etc. requires, but be integrated system occur connection time-out, the page cannot respond to, and work(
The problems such as login that energy interface interchange occurs is redirected, thus integrated system solves the problems, such as integrated failure by following functions:
(1)Login page is configured.Including " key " value parameter for obtaining user name, password, identifying code;Configuration all " keys "
Property value;
(2)Page cache required parameter is configured.Including the cache file for obtaining the system that is integrated;Asking for cache file is set
Evaluation;
(3)Page response failure parameter configuration.Including the maximum times for arranging request failure;The request stand-by period is set;
The loop detection cycle is set;Loop detection number of times is set;
(4)Main frame connection number is arranged.Arrange including main frame maximum number of connections, multi-thread number of passes.
The invention has the beneficial effects as follows:The inventive method is fed back using request process precise control, process status, request is blocked
Cut, probe detection etc. strategy with mechanism innovation solve prior art presence each problem.Using Apache
Commons Httpclient technical modelling HTTP clients(Such as browser)Carry out communicating realizing goal systems with server
User logs in, while preserving and managing the session information of user.System can be by arranging various required parameters come to long-range system
The access of system carries out precise control, and whole request flow process and service are monitored in the business function of user's request access target system
Response condition and provide this monitoring during various states feedback, feedack is had according to practical business demand
Body process, such as carries out switching, forwarding or interruption of flow process etc..When exception occurs in goal systems(Exception, machine of delaying are serviced such as)When this
Method also provides request interception mechanism and avoids a large amount of exception request occlusive effects the system performances, while enabling probe explorer
Once system goal systems accesses normal recovery request in time.The controllable and perfect exception handling of request process is realized finally.
Specific embodiment
The method of the present invention is described in detail below with reference to Figure of description.
The present invention entirely asks the uncontrollable problem of flow process in solving the conventional system integration, can be according to actual industry
Business requirement is accurately controlled request process or operation flow is turned to, and this is a quantum jump of system integration problem.Novelty is drawn
Enter request to intercept and probe detection mechanism, if having prevented to be possible to cause this when traditional integrated system occurs abnormal or unavailable
The hidden danger of ground system crash, the stability and security of the system operation for greatly improving, the degree of coupling between system are lower, relatively solely
Vertical property is higher.New integrated system can be conveniently added in the invention from exploitation angle, it is also possible to be easily transplanted to other items
In mesh.
The operating process key step of the inventive method is as follows:
A. goal systems is logged in using Apache Commons Httpclient technical modelling HTTP clients, and will step on
User session information after record success is preserved and is managed, and when user sends access request to goal systems again later, one is concurrent
Send;
B. different required parameters are arranged according to different integrated systems, when such as connection time-out time, the page read time-out
Between, the maximum frequency of failure, the loop detection cycle, loop detection number of times, solicited message coded system, response page coded system,
Whether enable this single-sign-on to act on behalf of and per other detail parameters such as main frame maximum numbers of connections, by these parameters come to long-range system
The access request of system carries out precise control;
C. monitor in the business function of user's request access target system and entirely ask flow process and service response situation simultaneously
Feedback such as the request address that there is provided various states during this monitoring is illegal, request is rejected, connect the mistake of overtime, User logs in
Lose, user conversation time-out failure, accession page do not exist or shift, requests for page time-out, user's unauthorized access etc., Ran Hougen
Factually border business demand carries out respective handling respectively to specific feedback information, such as simply points out, carries out the switching of flow process, turns
Send out or interrupt etc.;
D. when exception occurs in goal systems(Exception, machine of delaying are serviced such as)When this method provide request interception mechanism.When with
The family access request frequency of failure then no longer sends to remote system when having reached threshold values and asks, and the request for receiving later is all straight
Connect interception and avoid a large amount of exception request occlusive effects the system performances;
E. while asking interception mechanism to start, probe mechanism also starts therewith, and constantly detection is long-range on backstage for probe
System, once goal systems accesses normal recovery request in time.
In addition to the technical characteristic described in specification, the known technology of those skilled in the art is.