Skip to main content
Version: Next

Admin Property Config

This paper mainly explains how to configure Apache ShenYu properties on the admin side.

Property Config#

shenyu:  register:    registerType: http #http #zookeeper #etcd #nacos #consul    serverLists: #localhost:2181 #http://localhost:2379 #localhost:8848    props:      sessionTimeout: 5000      connectionTimeout: 2000      checked: true      zombieCheckTimes: 5      scheduledTime: 10      nacosNameSpace: ShenyuRegisterCenter  sync:    websocket:      enabled: true      messageMaxSize: 10240      allowOrigins: ws://localhost:9095;ws://localhost:9195;#      zookeeper:#        url: localhost:2181#        sessionTimeout: 5000#        connectionTimeout: 2000#      http:#        enabled: true#      nacos:#        url: localhost:8848#        namespace: 1c10d748-af86-43b9-8265-75f487d20c6c#        username:#        password:#        acm:#          enabled: false#          endpoint: acm.aliyun.com#          namespace:#          accessKey:#          secretKey:#    etcd:#      url: http://localhost:2379#    consul:#      url: http://localhost:8500  aes:    secret:      key: 2095132720951327      iv: 6075877187097700  ldap:    enabled: false    url: ldap://xxxx:xxx    bind-dn: cn=xxx,dc=xxx,dc=xxx    password: xxxx    base-dn: ou=xxx,dc=xxx,dc=xxx    object-class: person    login-field: cn  jwt:    expired-seconds: 86400000  shiro:    white-list:      - /      - /favicon.*      - /static/**      - /index**      - /plugin      - /platform/**      - /websocket      - /configs/**      - /shenyu-client/**      - /error      - /actuator/health      - /swagger-ui.html      - /webjars/**      - /swagger-resources/**      - /v2/api-docs      - /csrf  swagger:    enable: true

Property Detail#

shenyu.register config#

This section describes configurations related to client access. For details about client access principles, see: Application Client Access , for client access configuration, see: Application Client Access Config .

NameTypeDefaultRequiredDescription
registerTypeStringhttpYesWhich mode to use for registry. Currently, http, zookeeper, etcd, consul and nacos are supported.
serverListsStringnullNoConfigure the address of the registry. If http is used, you do not need to enter this parameter. In clustering, multiple addresses are separated by commas (,).
propsThe value of the property varies according to the registerType.
  • props config

The value of the attribute varies according to the registerType.

When the registerType is http, the supported properties are as follows.

NameTypeDefaultRequiredDescription
checkedbooleanfalseNois checked
zombieCheckTimesint5Nohow many times does it fail to detect the service.
scheduledTimeint10Notimed detection interval time

When the registerType is zookeeper, the supported properties are as follows.

NameTypeDefaultRequiredDescription
sessionTimeoutint30000Nosession timeout(millisecond)
connectionTimeoutint3000Noconnection timeout(millisecond)

When the registerType is etcd, no properties are provided for the time being.

When the registerType is nacos, the supported properties are as follows.

NameTypeDefaultRequiredDescription
nacosNameSpaceStringnullYesnamespace
usernameString""Nousername
passwordString""Nopassword
accessKeyString""NoaccessKey
secretKeyString""NosecretKey

When the registerType is consul, the supported properties are as follows.

NameTypeDefaultRequiredDescription
delayint1NoThe interval of each polling of monitoring metadata, in seconds, the default value is 1 second.
wait-timeint55No# wait-time: The waiting time for each polling of metadata monitoring, in seconds, the default value is 55 second .
metadata-pathStringshenyu/registerNoMetadata path name, default is shenyu/register.

When the registerType is apollo, the supported properties are as follows.

NameTypeDefaultRequiredDescription
appIdStringnullYesApollo appId
namespaceStringnullYesApollo namespace
portalUrlStringnullYesApollo portalUrl
envStringnullYesApollo env
clusterNameStringnullYesApollo clusterName
tokenStringnullYesApollo token
shenyu.sync config#

The Admin System and the Apache ShenYu gateway use data synchronization configurations.

The following properties are configured for data synchronization using websocket :

NameTypeDefaultRequiredDescription
enabledbooleantrueNowhether to enable websocket for data synchronization.
messageMaxSizeint0NoSet the websocket max buffer size in bytes.
allowOriginsString""NoSet allowed origins, multiple parameters separated by ;.

The following properties are configured for data synchronization using zookeeper :

NameTypeDefaultRequiredDescription
urlStringnullYeszookeeper server url
sessionTimeoutintnullYessession timeout(millisecond)
connectionTimeoutintnullYesconnection timeout(millisecond)

The following properties are configured for data synchronization using http long polling :

NameTypeDefaultRequiredDescription
enabledbooleantrueNowhether to enable.
refreshIntervalint5(minute)NoPeriodically fetch data from the database and load it into memory.
notifyBatchSizeint100Nonotify clients in batches

The following properties are configured for data synchronization using nacos :

NameTypeDefaultRequiredDescription
urlStringnullnacos url
namespaceStringnullYesnamespace
usernameStringnullNousername
passwordStringnullNopassword
acmNoaliyun ACM service configuration
  • acm config
NameTypeDefaultRequiredDescription
enabledbooleanfalseNowhether to enable
endpointStringnullNoACM service address
namespaceStringnullNonamespace
accessKeyStringnullNoaccessKey
secretKeyStringnullNosecretKey

The following properties are configured for data synchronization using etcd :

NameTypeDefaultRequiredDescription
urlStringnullYesetcd url

The following properties are configured for data synchronization using consul :

NameTypeDefaultRequiredDescription
urlStringnullYesconsul url
shenyu.aes.secret config#

aes secret properties:

NameTypeDefaultRequiredDescription
keyString2095132720951327Nokey
ivStringnullNoiv
shenyu.ldap config#

Spring ldap properties:

NameTypeDefaultRequiredDescription
enabledbooleantrueNowhether to enable
urlStringnullNoldap url
bind-dnStringnullNoUserDn
passwordStringnullNopassword
base-dnStringnullNosearchBase
object-classStringpersonNofilter
login-fieldStringcnNosearchBase
connectTimeoutint3000Noconnect timeout(millisecond)
readTimeoutint3000Noread timeout(millisecond)
shenyu.jwt config#

jwt properties:

NameTypeDefaultRequiredDescription
expired-secondslong24 60 60 * 1000LNoexpiration time(millisecond)
shenyu.shiro config#

shiro properties:

NameTypeDefaultRequiredDescription
white-listListnullNowhite list