Generation  pregnancy  for  raw egg  packet   M  child N

Generation  pregnant  for  egg  package  students  male  child N █ Micro Signal █: 138-0226-9370█ █ surrogate pack bag boy █ successful surrogacy package of health ████████████

In a distributed service framework, the basic problem is one of the most remote communications services is how, in Java there are many communication technology enables remote areas, for example: RMI, MINA, ESB, Burlap , Hessian, SOAP, EJB and JMS etc., between these terms in the end is what to do with it, they are behind in the end based on what principles to achieve it, is to understand the basics of implementing distributed service framework, and if there are high demands on performance, then understanding the technology behind these mechanisms is a must, in this article we take a closer look in the future.

 

First, the    basic principle

To achieve communication between network machines, first of all have to look at the basic principles of computer network communications systems, see at the bottom level, the network communication needs to be done is to flow from one computer to another computer, and based transport protocol IO to the network, where transmission protocol more famous there http, tcp, udp, etc., http, tcp, udp Socket is based on the concept of certain types of application scenarios and extend the transport protocol, network IO, mainly bio , nio, aio three ways, all distributed applications are based on this principle and realize, just to ease the application of a variety of languages ​​usually provide some more close-to-use application layer protocol applications.

 

Remote communications services, need to achieve a computer is initiated request, another machine upon receiving a request for the corresponding processing results back to the requesting terminal, which in turn will have as one way request, synchronization request, asynchronous request mode requests, etc., in accordance with the principle of network communication, it is necessary to achieve this needs to be done is to request into a stream transmitted by a transmission protocol to the distal end, the distal end of the computer for processing after receiving the requested stream, the processing is completed after results into the stream, and returns to the calling terminal through a transmission protocol.

The principle is this, but in order to facilitate the application, the industry introduced a lot based on this principle of application-level protocol that we can not go directly to the bottom of things such operations, usually application-level remote communication protocol provides:

In order to avoid direct stream operations do not bother to provide a more user-friendly language or fit a standard transmission format;

Network communication mechanism, that is done for you will be converted to transport stream format, transmitted over some transmission protocol to a remote computer, the remote computer after receiving the converted stream in transmission format, and stores in some way or notify the remote computer.

So when learning application-level remote communication protocol, we can learn with these questions:

What is the standard format for transmission ◆?

◆ how to request conversion of streaming?

◆ how to receive and process flow?

◆ transport protocol is?

However, application-level remote communication protocol and what will not do much to improve on the transport protocol, primarily in flow operation, so that the application layer generates the process flow and processing flow more stick together or standard language used, as transfer protocol is usually optional, well-known in the field of java there: RMI, XML-RPC, Binary-RPC, SOAP, CORBA, JMS, specifically look at these application-level protocol for remote communication:

 

Three,    RMI

RMI is typical for java custom remote communication protocols, as we all know, in the single vm, we can communicate by calling java object instance, then the remote communication, if also in this way is of course best , and this mechanism for remote communication becomes RPC (remote Procedure Call), RMI is precisely towards this goal born.

RMI is based on the principle of a complete telecommunication look at the process:

◆ client sends a request, transmit them to the RMI client stub class;

◆ stub class information interfaces, methods, parameters and the like serialized request;

◆ the socket on the streaming of the sequence to the server;

◆ the server receives forwarded to the corresponding class of the skelton stream;

◆ skelton class information requested call category actual processing after deserialization;

◆ After processing class processed results back to the skelton class;

◆ Skelton resulting sequence of classes, by the socket Stub stream to the client;

◆ stub deserialized after receiving stream, after the de-serialization Java Object returned to the caller.

To answer a few questions based on the principle of learning with application-level protocol before the next:

What is the standard format for transmission ◆?

Is Java ObjectStream.

◆ how to request conversion of streaming?

Based on the object information into java Java serialization mechanism for the request stream.

◆ how to receive and process flow?

Activate the corresponding listening port according to the protocol used, when there is flow into the stream based on Java serialization mechanism deserialized, and the acquired information according to the corresponding processing target RMI protocol, and call processing, the processed results Also be returned based on java serialization mechanism.

◆ transport protocol is?

Socket。

 

Four,    XML-RPC

XML-RPC and RMI is also a similar protocol remote calls, and it differs in that it RMI xml standard format definition information (requested object, method parameters, etc.) the request, so that the benefits of what it is also possible to use when cross-language communication.

A look at the remote communication process XML-RPC protocol:

◆ client sends a request, in accordance with the XML-RPC protocol request information filling;

After completion xml ◆ filling into stream for transmission over a transmission protocol;

◆ received after receiving the converted stream to xml, acquisition request according to the XML-RPC protocol and processed;

◆ after the processed result is written in accordance with the XML-RPC protocol xml and returns.

Also to answer the question:

◆ transmission is the standard format?

XML standard format.

◆ how to request conversion of streaming?

The XML into a stream.

◆ how to receive and process flow?

Acquired by listening to the stream port request, it is converted to XML, and obtain information request according to the protocol, for processing and returns the results written in XML.

◆ transport protocol is?

Http

 

五、   Binary-RPC

 

Binary-RPC see the name to know and XML-RPC is about the same, the only difference is that the standard format for transmission by the XML into binary format.

Also to answer the question:

◆ transmission is the standard format?

Standard binary file format.

◆ how to request conversion of streaming?

The binary format files into the stream.

◆ how to receive and process flow?

Request acquired by listening to the flow port, is converted to a binary file, in accordance with the protocol information acquisition request, and writes the result to process the XML return.

◆ transport protocol is?

Http。

 

Six,    the SOAP

SOAP original intent was to SimpleObject Access Protocol, is used in a distributed environment, lightweight, XML-based communication protocol for information exchange can be considered SOAP XML RPC is an advanced version of exactly the same principle both are http + XML, different only in that the difference between the two definitions of the XML specification, standard service call protocol SOAP Webservice is used, so this will not pay more elaborated.

 

Seven,    CORBA

Common Object Request BrokerArchitecture (Common Object Request Broker [scheduler] Program Architecture), is used to define a set of "distributed object systems" standard, as initiated by the setting unit and the standard OMG (Object Menagement Group). CORBA's purpose is to define a set of protocols, objects that meet this protocol can interact with each other, whether they are what kind of language, and whether they are run on what kind of machine and operating system.

CORBA in my opinion is similar to the SOA architecture, covering optional remote communication protocol, but it alone can not be included here in terms of communication protocol, and CORBA basically eliminated, coupled with the CORBA do not understand how, in this not be explained.

 

Eight,    JMS

JMS it is to achieve Java remote communications as a means and method, a JMS-based communication and remote RPC is different, although the effect of RPC can be done, but because it is not defined in the protocol level, so we do not think JMS RPC is a protocol, but it really is a remote communication protocol, there is a similar thing JMS system in other languages, such mechanisms can be called unified messaging, messaging and it is usually high concurrency, distributed recommended areas of a communication mechanism, a major problem here is fault-tolerant (for details see ErLang paper).

JMS view of a remote communication process:

◆ client requests into line with the provisions of the Message JMS;

◆ by JMS API or the JMS Queue Message into the Topic;

◆ such as JMS Queue, then sends the corresponding target Queue, as for the Topic, then sent to subscribe to this Topic of JMS Queue.

Processing in rotation by the end of the JMS Queue, to get a message, a message is received and processed according to parse JMS Message protocol.

Answer question:

◆ transmission is the standard format?

Message JMS provisions.

◆ how to request conversion of streaming?

The parameter information into the Message can be.

◆ how to receive and process flow?

In rotation to the JMS Queue Message received, after receiving processing, after processing into still based Message Queue transmitting manner or Multicast.

◆ transport protocol is?

Limited.

JMS is also commonly used to achieve one of the methods based remote asynchronous calls.

Of course, the principles described above and not all the optional field java a remote communication protocol, for example, there ORMI EJB employed, Spring own definition of a simple Http Invoker like.

After reading the principles we look at the current java framework or library can be used in the field of remote communication, well-known are: JBoss-Remoting, Spring- Remoting, Hessian, Burlap, XFire (Axis), ActiveMQ, Mina, Mule, EJB3, etc. and so on, to make a brief introduction for each evaluation and, actually, to do a distributed service framework, these things are to have a very deep understanding, because the distributed service framework is actually a solution that contains the field and distributed application-level field two aspects of the problem.

Of course, you can own to realize their communications framework or library based on remote network communication theory (transportprotocol + Net IO).

So when library or framework for understanding these remote communications, will bring any problems to learn it?

◆ protocol implementation is based on what?

◆ how to initiate a request?

◆ how the request into a protocol-compliant format?

◆ What Transfer Protocol use?

◆ responder to receive requests based on what mechanism?

◆ how to restore the stream transmission format?

◆ how to respond after treatment is completed?

 

九、   JBoss-Remoting

Jboss-remoting framework for telecommunications is a field of java written by jboss, based on this framework, it can be very simple java object-based implementation of multiple transport protocols of the RPC.

Directly answer the question:

◆ protocol implementation is based on what?

JBoss-Remoting is a communications framework, which supports a variety of communication protocols ways, e.g. pure socket + io embodiment, RMI embodiment, http + io methods.

◆ how to initiate a request?

In JBoss-Remoting, simply the need to initiate a request parameter object passed InvocationRequest jboss-remoting objects can also be based on the needs of the object InvocationRequest meet InvocationRequest package according to the protocol.

◆ how the request into a protocol-compliant format?

JBoss-Remoting to implement the request into the byte stream object based on the Java serialization mechanism, or JBoss own serialized.

◆ What Transfer Protocol use?

Support for multiple transport protocols, such as socket, http and so on.

◆ responder to receive requests based on what mechanism?

Responder simply register their processing target to the server side of the Connector object JBoss-Remoting can be provided.

◆ how to restore the stream transmission format?

JBoss-Remoting to achieve reduction of the request information based on the java java object serialization mechanism or jboss own serialized.

◆ how to respond after treatment is completed?

After completion of the processing result of the object can be returned directly, jboss-remoting will serialize objects in accordance with this protocol, it returns to the calling terminal.

Further, jboss-remoting supports multiple communication modes such as synchronous / asynchronous / unidirectional communications.

 

 

 
 

十、   Spring-Remoting

Spring-remoting is provided by Spring Java in the field of telecommunications framework, based on this framework, the same can also be very simple ordinary way of spring bean to some remote protocol to publish, you can also configure the bean spring bean remote call.

◆ protocol implementation is based on what?

And JBoss-Remoting, like, as a telecommunications framework, Spring library by integrating a variety of remote communication, enabling support for multiple protocols, such as rmi, http + io, xml-rpc, binary-rpc and so on.

◆ how to initiate a request?

In Spring, due to its remote call for bean uses a proxy to achieve, request a full launch mode is invoked via the service interface.

◆ how the request into a protocol-compliant format?

Spring according to the agreement object information request, into a stream, e.g. SpringHttp Invoker is done based on a protocol defined by their Spring, the transport protocol is used on http, request information is converted based on the java serialization mechanism for streaming transmission .

◆ What Transfer Protocol use?

Support for multiple transport protocols, such as rmi, http, and so on.

◆ responder to receive requests based on what mechanism?

Follow agreement responder receives a request, for the user, the ordinary spring bean configured to respond to an end or the end of service simply by the spring arrangement.

◆ how to restore the stream transmission format?

In accordance with the agreement to restore.

◆ how to respond after treatment is completed?

After processing to directly back, spring-remoting do the corresponding sequences according to the protocol of the embodiment.

Eleven,    the Hessian

Hessian is provided by a caucho-based remote communications library binary-RPC implementation.

◆ protocol implementation is based on what?

Based Binary-RPC protocol.

◆ how to initiate a request?

API required by Hessian itself provided to initiate the request.

◆ how the request into a protocol-compliant format?

Hessian through its custom serialization mechanism to serialize the request information, generates a binary stream.

◆ What Transfer Protocol use?

Hessian Http-based transmission protocol.

◆ responder to receive requests based on what mechanism?

The responder receives the request API Hessian provided.

◆ how to restore the stream transmission format?

The Hessian its private serialization mechanism to deserialize the request information, are transmitted to the corresponding user when the request information objects.

◆ how to respond after treatment is completed?

After processing directly returns, Hessian results serialize objects, is transmitted to the calling terminal.

Twelve,    Burlap

Burlap is also caucho provide it and hessian difference is that it is based on XML-RPC protocol.

◆ protocol implementation is based on what?

Based on XML-RPC protocol.

◆ how to initiate a request?

According to API Burlap provided.

◆ how the request into a protocol-compliant format?

Request information into protocol-compliant XML format, the conversion into transmission streams.

◆ What Transfer Protocol use?

Http protocol.

◆ responder to receive requests based on what mechanism?

Monitor Http request.

◆ how to restore the stream transmission format?

Reduction based on XML-RPC protocol.

◆ how to respond after treatment is completed?

Return result is written in XML, Burlap to return by the end of the call.

Thirteen,    XFire, Axis

XFire, Axis Webservice is the implementation framework, WebService can be regarded as a complete SOA architecture to achieve the standard, so the use of XFire, Axis these means is the use of a webservice way.

◆ protocol implementation is based on what?

SOAP-based protocol.

◆ how to initiate a request?

After obtaining a direct call to the remote service's proxy.

◆ how the request into a protocol-compliant format?

Request information into the XML format follow the SOAP protocol, a transmission frame is converted stream.

◆ What Transfer Protocol use?

Http protocol.

◆ responder to receive requests based on what mechanism?

Monitor Http request.

◆ how to restore the stream transmission format?

The reduction SOAP protocol.

◆ how to respond after treatment is completed?

Return result is written in XML, returned by the call to end the frame.

 
 

Fourteen,    ActiveMQ

ActiveMQ JMS is achieved, the remote communication JMS-based messaging is such a good choice, after all messaging functions on its own so that it can be very easy to achieve synchronous / asynchronous / one-way calls, etc., but also from the message mechanism fault-tolerant point of view is a good choice, which is able to do Erlang important foundation for fault tolerance.

◆ protocol implementation is based on what?

JMS-based protocols.

◆ how to initiate a request?

Follow JMS API to initiate requests.

◆ how the request into a protocol-compliant format?

I do not know, guess should be a binary stream.

◆ What Transfer Protocol use?

Support for multiple transport protocols, such as socket, http, and so on.

◆ responder to receive requests based on what mechanism?

Listening port in line with the agreement.

◆ how to restore the stream transmission format?

3 with the problem.

◆ how to respond after treatment is completed?

Follow JMS API message is generated and written in the JMS Queue.

There are Spring-Intergration, Mule, Lingo etc. Such a mechanism based on the example JMS for remote communication.

Fifteen,    Mina

Mina is a communications framework provided by Apache, until there is no mention in the piece of network IO, the previously mentioned basic framework or library are based on BIO, and Mina is the use of NIO and NIO concurrent increase in the amount of contrast in terms of BIO It has significantly improved performance, and Java in close connection with performance improvements, and its NIO this OS is not a small relationship.

◆ protocol implementation is based on what?

Based purely Socket + NIO.

◆ how to initiate a request?

Mina provided by the Client API.

◆ how the request into a protocol-compliant format?

Mina followed java serialization mechanism to serialize objects request.

◆ What Transfer Protocol use?

Support for multiple transport protocols, such as socket, http, and so on.

◆ responder to receive requests based on what mechanism?

NIO way to monitor protocol port.

◆ how to restore the stream transmission format?

Java serialization mechanism follows the request object is deserialized.

◆ how to respond after treatment is completed?

Follow Mina API be returned.

MINA NIO is a way, therefore supports asynchronous calls is no suspense.

Sixteen,    the EJB

EJB most prominent in its distributed, EJB uses ORMI protocol, and RMI protocol is about the same, but it makes prominent aspects of EJB security control in distributed communications, transport pool, smart proxy and other areas are not distributed reckoned with.

◆ protocol implementation is based on what?

Based ORMI protocol.

◆ how to initiate a request?

EJB calls.

◆ how the request into a protocol-compliant format?

Java serialization mechanism follows the request object to be serialized.

◆ What Transfer Protocol use?

Socket。

◆ responder to receive requests based on what mechanism?

Snooping port.

◆ how to restore the stream transmission format?

Java serialization mechanism follows the request object is deserialized.

◆ how to respond after treatment is completed?

Returned directly to the processing object.

In a distributed service framework in a series of articles for the previous jndi suspected of misleading mechanism under jndi mention in this blog also incidentally, because the JNDI implementation dependent, where only jndi jboss explain under It achieved.

After the object instance is bound to jboss jnp server, when the remote terminal using Context.lookup () Gets mode and start calling the remote object instance, jboss jndi implementation is acquired from the object instance jnp server, back serialize local, then deserialized locally after class calls locally.

Through this mechanism, we can know, in fact, there must be a local object instance is bound to jboss on the class of otherwise deserialization time certainly would have failed, and remote communications need to do is to perform a certain action in remote and to obtain the corresponding results can be seen purely based JNDI is not remote communication.

But also to achieve distributed JNDI service framework is a key technical point, because transparency can be achieved remote and local calls through it, like ejb, while it is also good to hide the actual deployment mechanisms (like the datasource) and other programs.

XVII summary

From the analysis of a series, in the telecommunications field, the knowledge involved is still quite a number of, for example: communication protocol (Socket / tcp / http / udp / rmi / xml-rpc etc.), message mechanism, network IO (BIO / NIO / AIO), multiThread, local calls and remote call transparency scheme (involving java classloader, DynamicProxy, Unit Test etc.), asynchronous and synchronous call, the network communication processing mechanism (automatic reconnection, broadcast, exception, pooling, etc.), JavaSerialization (private serialization mechanisms of various protocols, etc.), to achieve the principles of various frames (transmission format, how to transform the transport stream format, how to request the information into a transmission format, how to receive the stream, how to restore the transport stream format, etc.), which should be proficient in something which, according to the actual needs have to be decided only in understanding the principles of the case in order to easily make a choice, even do according to the needs of private remote communication protocol, for people who engage in distributed service platform or develop larger distributed application, I think at least the above-mentioned knowledge Point is the need for a better understanding.

 

Guess you like

Origin www.cnblogs.com/plec/p/10958401.html