CN103763394A - System and method for achieving access and callout of EJB through ESB - Google Patents

System and method for achieving access and callout of EJB through ESB Download PDF

Info

Publication number
CN103763394A
CN103763394A CN201410045943.6A CN201410045943A CN103763394A CN 103763394 A CN103763394 A CN 103763394A CN 201410045943 A CN201410045943 A CN 201410045943A CN 103763394 A CN103763394 A CN 103763394A
Authority
CN
China
Prior art keywords
ejb
esb
message
http
end points
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201410045943.6A
Other languages
Chinese (zh)
Other versions
CN103763394B (en
Inventor
逯利军
钱培专
许瑞顺
汪金忠
林强
张昆
侯卫东
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
CERTUSNET CORP
Original Assignee
CERTUSNET CORP
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by CERTUSNET CORP filed Critical CERTUSNET CORP
Priority to CN201410045943.6A priority Critical patent/CN103763394B/en
Publication of CN103763394A publication Critical patent/CN103763394A/en
Application granted granted Critical
Publication of CN103763394B publication Critical patent/CN103763394B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)
  • Telephonic Communication Services (AREA)

Abstract

The invention relates to a system and method for achieving access and callout of EJB through an ESB. The system comprises the ESB, a client terminal, an interceptor, an EJB server and an EJB transmission module, wherein the ESB comprises an HTTP inbound endpoint and an EJB outbound endpoint, the interceptor is used for packaging parameters in a calling EJB message sent by the client terminal into a message body of an HTTP Post method and sending the parameters to the HTTP inbound endpoint of the ESB, the EJB transmission module is used for calling and converting an HTTP message in the ESB into the calling EJB message through a remote control method and sending the calling EJB message to the EJB server through the EJB outbound endpoint. According to the system and method for achieving the access and the callout of the EJB through the ESB, by the adoption of the structure, the EJB is called and packaged into an HTTP so as to achieve the EJB supporting function and the clustering function of the ESB, the ESB can support the access and the callout of the EJB, the load balancing of the EJB and ESB calling is achieved, and the application range is wider.

Description

Realization accesses EJB and recall the system and method for ESB
Technical field
The present invention relates to ESB field, relate in particular to EJB and call the http protocol field that is packaged into, specifically refer to a kind of system and method that EJB is accessed and recalled ESB of realizing.
Background technology
ESB (ESB, Enterprise Service Bus) be to build based on the service-oriented architecture of SOA(, Service-Oriented Architecture) key component of the architecture of using during solution is the one group of architecture function that is realized and supported SOA by middleware Technology.ESB provides message mechanism a kind of opening, measured, by simple standard adapter and interface, completes the interoperability between coarseness application (service) and other assemblies, can meet the integrated demand of large-scale isomery corporate environment.By using ESB, can, in the situation that changing code hardly, in a kind of seamless non-intruding mode, make the existing system of enterprise there is brand-new service interface, and can in deployed environment, support any standard.
Mule ESB is a kind of ESB and integrated platform based on Java, lightweight, cheap because of it, configure, expand simply, and flexibility is strong, makes it very popular, is instantly to use maximum integrated platforms of increasing income.It is based on EIP(EIP) realize; Core component UMO realizes and integrates logic; Support 20 multiple transport protocols (File, FTP, UDP, SMTP, POP, HTTP, SOAP, JMS etc.).And integrated many popular projects of increasing income, and such as Spring, ActiveMQ, CXF, Axis, Drools etc.Allow developer fast, simply to connect application, and can realize the conversion of data.
The major function of Mule ESB is as follows:
The establishment and management (Service creation and hosting) of service: expose as the service container of a lightweight with Mule ESB and manage reusable service.
(Service mediation) reconciled in service: hide form and the agreement of service message, and service logic is independent from message, and can realize independently service call of this locality.
Message route (Message routing): the rearrangement of content-based and regular message route, message screening, message merging and message.
Data transaction (Data transformation): carry out translation data in different forms and host-host protocol.
But MULE ESB product does not provide the access support to EJB3 and recalls support, the business application component technology in cannot integrated existing EJB(Java, Enterprise Java Bean) agreement subsystem.EJB is playing the part of key player in widely accepted J2EE(Java2 platform, enterprise edition (Java2Platform, Enterprise Edition, Java platform environment), has become the standard technique of application server.It provides the ability of transaction, since three-decker proposes, and intermediate layer, namely business logic tier, is the core of processing transactions, owing to separating from data storage layer, it has just replaced most of status of storage process.From distributed angle, EJB is as CORBA(Common Object Request Broker Architecture, Common Object Request Broker Architecture) the same, distributed basis is provided, means of communication between object is provided, under the support of J2EE framework, operate in the EJB in EJB server, meet the requirement of enterprise's application about distribution, transplanting, safety, transaction completely.And community's version do not possess clustering functionality yet, for the J2EE enterprise-level application of high capacity, cannot meet.The load-balancing function of cluster can, by calling all and being distributed to each child node, be alleviated the performance of each node server, reaches high-performance and the high availability of enterprises service.
Therefore, be necessary to seek the access way of a kind of EJB, and meet the load balancing that EJB calls, EJB called to uniform load to each child servers, and this problem to be solved by this invention just.
Summary of the invention
The object of the invention is to overcome the shortcoming of above-mentioned prior art, provide a kind of can realization by EJB is called to be packaged into http protocol and to realize support and the clustering functionality of ESB to EJB, make ESB can support the access of EJB and recall and meet load balancing that EJB and ESB call, the realization with broader applications scope is by EJB access and recalls the system and method for ESB.
To achieve these goals, realization of the present invention has following formation by EJB access and the system and method that recalls ESB:
This realization accesses EJB and recall the system of ESB, and its main feature is that described system comprises:
ESB, comprises the inbound end points of HTTP and EJB departures end points;
Client, calls EJB message in order to send;
Blocker, in order to the inbound end points of HTTP that parameter in EJB message is encapsulated in the message body of HTTP Post method and is sent to described ESB that calls that described client is sent;
EJB server;
EJB delivery module, in order to be converted to the HTTP message in described ESB to call EJB message and be sent to described EJB server by described EJB departures end points by RMI.
Preferably, the described parameter in EJB message of calling comprises service interface class, JNDI lookup names, call method title, parameter type list, parameter value list.
The invention still further relates to a kind of method that EJB is accessed and recalled ESB that realizes based on described system, its main feature is that described method comprises the following steps:
(1) client call EJB service access ESB;
(2) the HTTP message conversion of ESB is that EJB recalls;
Described client call EJB service access ESB comprises the following steps:
(11) described blocker obtains that described client sends calls EJB message;
(12) described blocker is searched the described inbound end points of HTTP and is encapsulated in the message body of HTTPPost method calling parameter in EJB message;
(13) described blocker is sent to the described inbound end points of HTTP by the message body of HTTP Post method;
The HTTP message conversion of described ESB is that EJB recalls and comprises:
(21) described EJB delivery module obtains and ESB, is packaged with the HTTP message of calling EJB message from the inbound end points of described HTTP;
(22) described EJB delivery module carries out RMI by the message body in HTTP message and is converted to and calls EJB message;
(23) described EJB delivery module is sent to described EJB server by described EJB departures end points by the EJB message after conversion.
Preferably, described search the described inbound end points of HTTP, be specially:
By Java order directory service, search the described inbound end points of HTTP.
More preferably, described is encapsulated in the message body of HTTP Post method calling parameter in EJB message, is specially:
Described blocker is encapsulated into service interface class, Java order directory service lookup names, call method title, parameter type list, the parameter value list of calling in EJB message in the message body of HTTP Post method.
Preferably, between described step (12) and (13), further comprising the steps of:
(121) by Linux virtual server, the message body of HTTP Post method is carried out to load balance process.
Preferably, the address of described EJB server is the address of the EJB cluster based on HA-JNDI mode.
The system and method that has adopted the realization in this invention that EJB is accessed and recall ESB, has following beneficial effect:
(1) by EJB is called, be packaged into http protocol and realize support and the clustering functionality of ESB to EJB, make ESB can support the access of EJB and recall, for becoming possibility between integrated existing isomery EJB distributed system.
(2), by being combined with LVS, reached the load balancing that ESB processes.
(3) by with being combined with of HA-JNDI, realized the clustering functionality of EJB.
Accompanying drawing explanation
Fig. 1 is the structural representation that realization of the present invention accesses EJB and recall the system of ESB.
Fig. 2 is the flow chart that realization of the present invention accesses EJB and recall the method for ESB.
Fig. 3 is the flow chart of client call EJB service access ESB of the present invention.
Fig. 4 is that the HTTP message conversion of ESB of the present invention is the flow chart that EJB recalls.
Embodiment
In order more clearly to describe technology contents of the present invention, below in conjunction with specific embodiment, conduct further description.
As shown in Figure 1, realization of the present invention comprises EJB access and the system that recalls ESB:
ESB, comprises the inbound end points of HTTP and EJB departures end points;
Client, calls EJB message in order to send;
Blocker, in order to the inbound end points of HTTP that parameter in EJB message is encapsulated in the message body of HTTP Post method and is sent to ESB that calls that client is sent;
EJB server;
EJB delivery module, in order to be converted to the HTTP message in ESB to call EJB message and be sent to EJB server by the EJB end points that sets off by RMI.
This mode that EJB is accessed to ESB, step is as follows:
Because EJB essence is RMI(Remote Method Invocation, RMI) method call, must know service interface class, lookup names, call method title, parameter type list, parameter value list, and http protocol is to comprise Head(head), the form such as Body (message body), support 8 kinds of method calls such as GET, POST, HEAD, PUT, message between the two needs conversion simultaneously.Therefore, the core of our solution is exactly the conversion of EJB and HTTP message and calls, and ESB side is converted to HTTP the Function Extension that EJB calls.
Client is when calling EJB service, in client, increase blocker, this blocker obtains and calls client call EJB counterfoil, by JNDI (Java Naming and Directory Interface, Java named directory service) search ESB HTTP Inbound(inbound) entrance, blocker is by service interface class in EJB message, JNDI lookup names, call method title, parameter type list, the parameters such as parameter value list are encapsulated in the message body (Body) of HTTP POST method, thereby realize EJB and be converted to HTTP, and be the sub-project under Apache Jakarta Common by HttpClient(, can be used to provide efficiently, up-to-date, the client programming kit of the support http protocol of feature richness) use POST method to send to the Http Inbound entrance that ESB is corresponding.Return results as far call result RemoteInvocationResult, if call generation extremely, return to RemoteAccessException.
In ESB side, increase EJB delivery module, resolve HTTP message, the message of the HTTP that acquisition methods is POST, crosses byte stream by the BODY information exchange in message and is converted to HttpRemoteInvocation, realizes RMI conversion.This module must configure the required interface class of EJB service call and JDNI searches the information such as name, and this module has been expanded the XSD(definition of MULE) and SCHEMA(framework), EJB service configuration only need to configure corresponding interface class and JNDI and search name, makes EJB service configuration seamless and without invasive.
After EJB message conversion is HTTP, at present a lot of to the realization of HTTP message load balancing, we are combined with LVS(Linux Virtual Server, Linux virtual server) realize EJB message conversion and be HTTP message after, the load balancing of ESB message.EJB server provides cluster service by HA-JNDI mode simultaneously, when EJB recalls, can call EJB cluster service.
As shown in Figure 2, realization of the present invention comprises the following steps EJB access and the method that recalls ESB:
(1) client call EJB service access ESB;
(2) the HTTP message conversion of ESB is that EJB recalls;
Client call EJB service access ESB comprises the following steps:
(11) what blocker obtained that client sends calls EJB message;
(12) blocker is searched the inbound end points of HTTP and is encapsulated in the message body of HTTP Post method calling parameter in EJB message;
(121) by Linux virtual server, the message body of HTTP Post method is carried out to load balance process;
(13) blocker is sent to the inbound end points of HTTP by the message body of HTTP Post method;
The HTTP message conversion of ESB is that EJB recalls and comprises:
(21) EJB delivery module obtains and ESB, is packaged with the HTTP message of calling EJB message from the inbound end points of HTTP;
(22) EJB delivery module carries out RMI by the message body in HTTP message and is converted to and calls EJB message;
(23) EJB delivery module by EJB set off end points by conversion after EJB message be sent to EJB server.
Below in conjunction with drawings and Examples, the present invention is introduced:
Sub-process 1: client call EJB serves access.
As shown in Figure 3, client is carrying out EJB while calling, first by JNDI, call ESB end http address, increased HttpInvokerClientInterceptor blocker, this blocker is acted on behalf of by Java, the parameters such as service interface class, jndi lookup names, call method title, parameter type list, parameter value list in EJB message are encapsulated in the message body (Body) of HTTP POST method, thereby realize EJB and be converted to HTTP, and use POST method to send to the Http Inbound entrance that ESB is corresponding by HttpClient.Return results as far call result RemoteInvocationResult, if call generation extremely, return to RemoteAccessException.Call to HTTP connect abnormal, unserializing abnormal and service exception has done encapsulation process.
The HTTP message conversion of sub-process 2:ESB is that EJB recalls.
As shown in Figure 4, in ESB side, by configuration Service(ESB service) at the inbound end points of Http Inbound() receive the EJB message being converted to after HTTP, the message of the HTTP that is POST by HttpRequestBodyToRemoteInvocation class analytic method, Body information exchange in message body is crossed to byte stream and be converted to HttpRemoteInvocation, realize RMI conversion, then by the Outbound Endpoint of EJB, call EJB, response message is converted to RemoteInvocationResult from Http Response simultaneously and returns.
Sub-process 3: load balancing.
As shown in Fig. 2 overview flow chart, ESB is for EJB call entry, the http invoker configuration mode of supporting database and two kinds of ESB of file, and database is used JDBC to connect.Configurable ESB address port is information after LVS carries out HTTP load balancing, reaches the object of load balancing.While recalling, the EJB subsystem address of configuration is used the address of HA-JNDI to connect the EJB group system of using HA-JNDI mode to dispose, thereby realizes the clustering functionality that EJB recalls.
The system and method that has adopted the realization in this invention that EJB is accessed and recall ESB, has following beneficial effect:
(1) by EJB is called, be packaged into http protocol and realize support and the clustering functionality of ESB to EJB, make ESB can support the access of EJB and recall, for becoming possibility between integrated existing isomery EJB distributed system.
(2), by being combined with LVS, reached the load balancing that ESB processes.
(3) by with being combined with of HA-JNDI, realized the clustering functionality of EJB.
In this specification, the present invention is described with reference to its specific embodiment.But, still can make various modifications and conversion obviously and not deviate from the spirit and scope of the present invention.Therefore, specification and accompanying drawing are regarded in an illustrative, rather than a restrictive.

Claims (7)

1. realization accesses EJB and recall a system for ESB, it is characterized in that, described system comprises:
ESB, comprises the inbound end points of HTTP and EJB departures end points;
Client, calls EJB message in order to send;
Blocker, in order to the inbound end points of HTTP that parameter in EJB message is encapsulated in the message body of HTTP Post method and is sent to described ESB that calls that described client is sent;
EJB server;
EJB delivery module, in order to be converted to the HTTP message in described ESB to call EJB message and be sent to described EJB server by described EJB departures end points by RMI.
2. realization according to claim 1 accesses EJB and recall the system of ESB, it is characterized in that, the described parameter in EJB message of calling comprises service interface class, JNDI lookup names, call method title, parameter type list, parameter value list.
3. based on the system described in claim 1 or 2, realize a method that EJB is accessed and recalled ESB, it is characterized in that, described method comprises the following steps:
(1) client call EJB service access ESB;
(2) the HTTP message conversion of ESB is that EJB recalls;
Described client call EJB service access ESB comprises the following steps:
(11) described blocker obtains that described client sends calls EJB message;
(12) described blocker is searched the described inbound end points of HTTP and is encapsulated in the message body of HTTP Post method calling parameter in EJB message;
(13) described blocker is sent to the described inbound end points of HTTP by the message body of HTTP Post method;
The HTTP message conversion of described ESB is that EJB recalls and comprises:
(21) described EJB delivery module obtains and ESB, is packaged with the HTTP message of calling EJB message from the inbound end points of described HTTP;
(22) described EJB delivery module carries out RMI by the message body in HTTP message and is converted to and calls EJB message;
(23) described EJB delivery module is sent to described EJB server by described EJB departures end points by the EJB message after conversion.
4. realization according to claim 3 by EJB access with recall the method for ESB, is characterized in that, described searches the described inbound end points of HTTP, is specially:
By Java order directory service, search the described inbound end points of HTTP.
5. realization according to claim 4 accesses EJB and recall the method for ESB, it is characterized in that, described is encapsulated in the message body of HTTP Post method calling parameter in EJB message, is specially:
Described blocker is encapsulated into service interface class, Java order directory service lookup names, call method title, parameter type list, the parameter value list of calling in EJB message in the message body of HTTP Post method.
6. realization according to claim 3 accesses EJB and recall the method for ESB, it is characterized in that, between described step (12) and (13), further comprising the steps of:
(121) by Linux virtual server, the message body of HTTP Post method is carried out to load balance process.
7. realization according to claim 3 accesses EJB and recall the method for ESB, it is characterized in that, the address of described EJB server is the address of the EJB cluster based on HA-JNDI mode.
CN201410045943.6A 2014-02-10 2014-02-10 Realize that EJB is accessed and recalled the system and method for ESB Active CN103763394B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410045943.6A CN103763394B (en) 2014-02-10 2014-02-10 Realize that EJB is accessed and recalled the system and method for ESB

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410045943.6A CN103763394B (en) 2014-02-10 2014-02-10 Realize that EJB is accessed and recalled the system and method for ESB

Publications (2)

Publication Number Publication Date
CN103763394A true CN103763394A (en) 2014-04-30
CN103763394B CN103763394B (en) 2017-05-31

Family

ID=50530552

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410045943.6A Active CN103763394B (en) 2014-02-10 2014-02-10 Realize that EJB is accessed and recalled the system and method for ESB

Country Status (1)

Country Link
CN (1) CN103763394B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107809362A (en) * 2017-11-15 2018-03-16 深圳四方精创资讯股份有限公司 The collocation method and its system of ESB
CN107872437A (en) * 2016-09-27 2018-04-03 阿里巴巴集团控股有限公司 A kind of method, apparatus and server for service request
CN110673967A (en) * 2019-09-26 2020-01-10 中电万维信息技术有限责任公司 Cluster system and access and call-out method based on EJB, ActiveMQ and ESB
CN111695072A (en) * 2019-03-12 2020-09-22 上海蔚来汽车有限公司 Method and device for converting HTTP (hyper text transport protocol) request

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101339520B (en) * 2007-12-04 2011-01-26 浙江大学 Method for accessing EJB into enterprise service bus
CN101236510B (en) * 2008-02-22 2010-06-02 深圳市金蝶中间件有限公司 EJB cluster failure recovery processing method and system
CN102158548A (en) * 2011-03-02 2011-08-17 山东中创软件工程股份有限公司 Method for accessing external services into enterprise service bus

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107872437A (en) * 2016-09-27 2018-04-03 阿里巴巴集团控股有限公司 A kind of method, apparatus and server for service request
CN107872437B (en) * 2016-09-27 2021-07-09 阿里巴巴集团控股有限公司 Method, device and server for service request
CN107809362A (en) * 2017-11-15 2018-03-16 深圳四方精创资讯股份有限公司 The collocation method and its system of ESB
CN107809362B (en) * 2017-11-15 2020-10-23 深圳四方精创资讯股份有限公司 Configuration method and system of enterprise service bus
CN111695072A (en) * 2019-03-12 2020-09-22 上海蔚来汽车有限公司 Method and device for converting HTTP (hyper text transport protocol) request
CN110673967A (en) * 2019-09-26 2020-01-10 中电万维信息技术有限责任公司 Cluster system and access and call-out method based on EJB, ActiveMQ and ESB

Also Published As

Publication number Publication date
CN103763394B (en) 2017-05-31

Similar Documents

Publication Publication Date Title
JP6577618B2 (en) An extensible single-point orchestration system for application programming interfaces
CN106131213B (en) Service management method and system
CN109542457B (en) Distributed application distribution and deployment system and method for edge computing network
CN101207550B (en) Load balancing system and method for multi business to implement load balancing
EP3138003B1 (en) System and method for supporting a bypass-domain model and a proxy model and updating service information for across-domain messaging in a transactional middleware machine environment
CN102281190B (en) Networking method for load balancing apparatus, server and client access method
CN110958281B (en) Data transmission method and communication device based on Internet of things
US20170195458A1 (en) Middleware abstraction layer (mal)
CN106790059B (en) Service calling method and system for cloud system of smart television L aunch
US20090080432A1 (en) System and method for message sequencing in a broadband gateway
US8082296B2 (en) Bus system
CN103945000A (en) Load balance method and load balancer
CN103763394A (en) System and method for achieving access and callout of EJB through ESB
CN113630310B (en) Distributed high-availability gateway system
Srirama et al. Mobile web service provisioning and discovery in android days
WO2021089158A1 (en) Network entities for supporting analytics generation
CN100411367C (en) Method and apparatus for implementing simultaneous processing of multiple service logic on server
Indrasiri et al. Introduction to WSO2 ESB
US11683400B1 (en) Communication protocol for Knative Eventing's Kafka components
US9438693B2 (en) System and method for message retry in a broadband gateway
WO2023038994A1 (en) Systems, apparatus, and methods to improve webservers using dynamic load balancers
CN114185695A (en) Loosely-coupled data processing method and system based on industrial APP micro-service
WO2014031044A1 (en) Method and node for enabling automatic deployment of resource components
Paniagua Discovery and push notification mechanisms for mobile cloud services
Abiona et al. Architectural model for Wireless Peer-to-Peer (WP2P) file sharing for ubiquitous mobile devices

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant