Thursday, February 01, 2007

Bidirectional GIOP

Bi-dir introduction

Bi-dir is a GIOP level capability that allows CORBA client and server (ORB) to reuse existing connection for bidirectional usage and is available from GIOP 1.2 onwards.

Prior to GIOP 1.2, only the client ORB could send the following GIOP messages - Request, Cancel Request, Locate Request.

Similarly, only the server ORB could send the following GIOP messages – Reply, Locate Reply and Close Connection.

The client ORB would initiate a new connection to server ORB and send its messages. The server ORB would then send back its messages on the same connection. If however, the server ORB also had a client component and had to, for example, make a callback request, then it had to open a new connection.

With the introduction of GIOP, this restriction is no longer valid, and either side of the ORB could send any message on the connection initiated by the connection.

Client and server side ORB responsibilities
Client side ORB responsibility
  • Client-ORB opens a connection to the server-ORB·
  • Client-ORB declares to the server that the connection opened is bi-dir capable
  • This is done, on the wire, by sending a service-context containing all the listen end-points that it wants to expose to the server through that connection. The bi-dir service context actually contains a list of host-port pairs which the server can reach using this connection.
  • The client application programmatically can indicate to the client-ORB that it should open bi-dir connection by setting the Bidirectional Policy. Its values could be “NORMAL”, which is the default case indicating no bi-dir support, or “BOTH”, indicating that the client should open bi-dir connections to the server.
  • In VBC, this can also be achieved through configuration property by setting vbroker.orb.enableBiDir to “client” or “both”
  • Further more, programmatically, to specify which CORBA objects need to be exposed through a bi-dir connection, Bidirectional Policy (value = BOTH) can also be specified on the POA. This would make the POA expose all objects contained in it to be exposed.
  • In VBC along with setting the POA policy, the server connection manager of the server engine, which the POA will be associated with also should be set to expose its listen points. Specifying the property vbroker.se.xxx.scm.yyy.manager.exportBiDir to true does this. Please note that if this property is not set, and vbroker.orb.enableBiDir is either “client” or “both”, then again, this SCM will be exposed.
  • All the requests that the client sends to the server on this connection will have even numbered request Id.
Server side ORB responsibility
  • If the server is bi-dir capable, then on reading the bi-dir service context on a request from the client, it should understand that the client is bi-dir capable, and try to use the same connection for all invocations from the server back to the client. In other words, if the server intends on making an invocations to objects hosted on the listen points as enumerated by the bi-dir service context, then instead of opening new connections to these end-points while making requests, it should reuse the client initiated connection
  • In VBC, to enable the server for bi-dir capability, the property vbroker.se.xxx.scm.yyy.manager.importBiDir should be set to true. This allows the particular SCM to enable the server to reuse the connection. If this property is not set, but the property vbroker.orb.enableBiDir is set to “server” or “both”, then again, this feature is enabled. If both these properties are false, the server will never honor client’s bi-dir capability.VisiBroker for C++ Implementation
VisiBroker for C++ Implementation