D10075 - Configuration, vertx-rpc.yml

In micro service mode, zero system has implemented simple rpc communication between different services, when you want to connect other services, you should set the rpc configuration.

Rpc Client is enabled in micro service mode only.

1. Configuration

1.1. vertx.yml

zero:
  lime: rpc
  vertx:
    instance:
    - name: vx-zero
      options:
        # Fix block 2000 limit issue.
        maxEventLoopExecuteTime: 30000000000

1.2. vertx-rpc.yml

rpc:
  ssl: false
  uniform:
    type: PEM
  extension:
    {name}:
      type: XXX

Please be careful about the attributesuniformandextensionit’s the same except following:

This configuration up.god.file is only used in **SSL **mode.

2. Full Examples

You can ignore the details of the example, this chapter focus on rpc client only, we’ll introduce rpc server configuration in forward.

## vertx-server.yml
# Rpc Server with PEM ( OpenSSLEngine )
- name: ipc-cronus
  type: ipc
  config:
    port: 6883
    host: 0.0.0.0
    ssl: true
    type: PEM
    cert: tlk/server-cert.pem
    key: tlk/server-key.pem

# Rpc Server with Jsk ( JSKEngine )
- name: ipc-cronus
  type: ipc
  config:
    port: 6883
    host: 0.0.0.0
    ssl: true
    type: JKS
    jsk: tlk/server-key.jks
    password: wibble

## vertx-rpc.yml ( The name depend on lime )
# Rpc Client use default
rpc:
  ssl: true
  uniform:
    type: PEM
    cert: tlk/server-cert.pem
    key: tlk/server-key.pem

# Rpc Client with spec service

rpc:
  ssl: true
  uniform:
    type: PEM
    cert: tlk/server-cert.pem
    key: tlk/server-key.pem
  extension:
    up-cerous:
      type: JKS
      jsk: tlk/server-key.jks
      password: wibble

3. Summary

Rpc client is a critical role in zero system to finish service communicating works, you should know how to configure different roles of rpc.

Once you have configured above two parts in different micro services, these services could communicate internally directly in zero system. You can say goodbye to old Http EndPoint communication internally.