OpenTP1 Version 7 TP1/Client User's Guide TP1/Client/J

[Contents][Index][Back][Next]

2.2.9 RPCs that use the name service

An RPC that uses the name service constitutes a service request that can be executed from a Java application or servlet. It cannot be executed from a Java applet due to security limitations.

This section explains the RPC flow that uses the name service and the definition necessary for distributing the service request destination schedulers among RPCs.

Organization of this subsection
(1) RPC flow using the name service
(2) Definition for distributing the service request destination schedulers among RPCs
(3) Definition for issuing an RPC to TP1/Server in the multi-homed host environment

(1) RPC flow using the name service

To issue an RPC that uses the name service, specify dcnamuse=Y in the TP1/Client/J environment definition. Also specify the dchost and dcnamport operands in the TP1/Client/J environment definition or specify the nam server with the setDchost method. Before calling an rpcCall method, you must call an rpcOpen method. At the end of the CUP, you must call an rpcClose method.

The following figure shows the flow of a service request when the name service is used.

Figure 2-7 Flow of a service request when the name service is used

[Figure]

  1. Create an instance of the TP1Client class that is provided by TP1/Client/J.
  2. Call the rpcOpen method to initialize the RPC environment of the CUP.
  3. Call the rpcCall method to issue a service request to the specified SPP.#
  4. Call the rpcClose method to release the RPC environment.

#
The internal processing of the rpcCall method is as follows:
  1. Establishes connection with the nam server that is defined with the dchost and dcnamport operands.
  2. Sends a request to acquire service information and release connection with the nam server.
  3. After receiving a connection establishment request from the nam server to send a response message, establishes connection and receives the service information.
  4. Releases connection with the nam server and uses the service information in the response message from the nam server to establish connection with the SCD server on the TP1/Server that is executing the service.
  5. After establishing connection with the SCD server, sends the service request and releases the connection.
  6. After receiving a connection establishment request from an SPP to send a response message, establishes the connection and receives the response message.
  7. Releases the connection with the SPP.

When you use this facility, you cannot issue an RPC to an SPP that receives requests from a socket. If you specify a value of 2 or greater for the dccltrpcmaxmsgsize operand of the TP1/Client/J environment definition, an RPC using the name service collects information only from services that are running on a TP1/Server that supports the rpc_max_message_size operand of the system common definition. Even when the input parameter length for the service exceeds the value in the rpc_max_message_size operand of the system common definition at the service request destination, the service request is executed. You cannot issue an RPC to an SPP on a TP1/Server that does not support the rpc_max_message_size operand of the system common definition.

(2) Definition for distributing the service request destination schedulers among RPCs

When RPCs use the name service, you can store the information on the service request destination schedulers from the name server into the cache, and distribute the service request destination schedulers among RPCs by referencing the information in the cache. To distribute the service request destination schedulers among RPCs, the following definitions are necessary for TP1/Client/J and TP1/Server.

(a) Definition for TP1/Client/J

To distribute the service request destination schedulers among RPCs, specify dccltloadbalance=Y in the TP1/Client/J environment definition.

With this setting, TP1/Client/J acquires information on multiple service request destination schedulers from the name server and stores the information on the service request destination scheduler having the lowest load level in the cache. One or more service request destination schedulers may be stored in the cache.

If multiple service request destination schedulers are stored in the cache, the first service request destination scheduler is selected at random. If the service request from an RPC is the second or subsequent one, the cache is referenced to obtain information on service request destination schedulers, and service request destination schedulers are switched in the round-robin mode and distributed among the RPCs.

Specifying a time limit for the cache
Using the dccltcachetim operand of the TP1/Client/J environment definition, you can specify a time limit for retaining the information on the service request destination schedulers in the cache.
After storing information on the service request destination schedulers in the cache, if the cache expiration date is reached, the information on the service request destination schedulers in the cache is discarded. The cache is updated when information on the service request destination schedulers is subsequently acquired and stored in the cache.
The dccltcachetim operand of the TP1/Client/J environment definition is valid only when dccltloadbalance=Y is specified in the TP1/Client/J environment definition.
(b) Definition for TP1/Server

When operands are specified in the TP1/Server definitions listed below, the scheduler load information is also acquired when information on the service request destination schedulers is acquired from the name server.

Schedule service definition
  • scd_announce_server_status=Y (default)#1

User service definition or user service default definition
  • loadcheck_interval
  • levelup_queue_count#2
  • leveldown_queue_count#2

#1
If N is specified in this operand, the load level of the scheduler is always set to LEVEL0 (low load level). If a scheduler whose load level is always LEVEL0 becomes a service request destination scheduler of TP1/Client/J, it is always selected, regardless of its actual load condition.

#2
Specify this operand if the Specify scheduler's load level is to be determined by the number of remaining service requests.

(3) Definition for issuing an RPC to TP1/Server in the multi-homed host environment

If the communication destination TP1/Server is in the multi-homed host environment, an RPC that uses the name service may encounter a communication error. This is caused when the network where the CUP resides cannot communicate with the network adapter that corresponds to the host name (IP address) specified by the my_host operand in the system common definition of the communication destination TP1/Server.

To avoid this problem, specify dccltnammlthost=Y in the TP1/Client/J environment definition. The following figure shows two network configuration examples and shows whether the dccltnammlthost operand of TP1/Client/J environment definition is required in each of these network configurations.

Figure 2-8 Example of issuing an RPC to TP1/Server in the multi-homed host environment

[Figure]

For the CUP in network configuration example 2 to be able to communicate with IP address 4, dccltnammlthost=Y must be specified in the TP1/Client/J environment definition. Without this specification, a communication error occurs between the CUP and IP address 4.

If the communication destination TP1/Server is in the multi-homed host environment, and the service request destination SPP resides on the same TP1/Server, specifying dccltnammlthost=Y in the TP1/Client/J environment definition enables the issuance of an RPC. If a TP1/Server residing on a network to which no CUP is connected is specified in the all_node operand of the system common definition of the communication destination TP1/Server, an attempt to issue an RPC to an SPP on the first TP1/Server causes an error. If the communication destination TP1/Server is not in the multi-homed host environment, you can issue an RPC regardless of the specification in the dccltnammlthost operand of the TP1/Client/J environment definition.