Dynamic Configuration
Setting Configuration Fields Dynamically
You can set the fields in a configuration section by sending the values as JSON to the config
endpoint of the REST API. The PUT method of /api/v5_2/config
requires the following parameters:
section
— the configuration section that the JSON updates. See the Configuration Fields page for a list of the configuration sections.version
— the version of the configuration. Corda versions configurations to avoid two concurrent updates clashing with each other. You can retrieve the current version, with the current configuration structure, using the GET method of the/api/v5_2/config
endpoint.config
— the configuration fields and values specified as JSON. For more information about these fields, see Configuration Fields.schemaVersion
— the configuration schema version. Set this to{"major": 1, "minor": 0}
for this version of Corda.
For example, to set fields in the messaging section using Bash with Curl or PowerShell:
curl -k -u $REST_API_USER:$REST_API_PASSWORD -X PUT -d '{"section":"corda.messaging", "version":"1", "config":"{"maxAllowedMessageSize":972800,"publisher":{"closeTimeout":600,"transactional":true},"subscription":{"commitRetries":3,"pollTimeout":500,"processorRetries":3,"processorTimeout":15000,"subscribeRetries":3,"threadStopTimeout":10000}}", "schemaVersion": {"major": 1, "minor": 0}}' "$REST_API_URL/config"
Invoke-RestMethod -SkipCertificateCheck -Headers @{Authorization=("Basic {0}" -f ${REST_API_USER}:${REST_API_PASSWORD})} -Method Put -Uri "$REST_API_URL/config" -Body (ConvertTo-Json -Depth 4 @{
{
"config": "{
"maxAllowedMessageSize":972800,
"publisher":{
"closeTimeout":600,
"transactional":true
},
"subscription":{
"commitRetries":3,
"pollTimeout":500,
"processorRetries":3,
"processorTimeout":15000,
"subscribeRetries":3,
"threadStopTimeout":10000
}
}",
"schemaVersion": {
"major": 1,
"minor": 0
},
"section": "corda.messaging",
"version": 1
})
Retrieving Current Configuration Values
You can retrieve the current values of the fields in a particular configuration section by using the GET method of the /api/v5_2/config
endpoint.
For example, to retrieve the fields in the messaging section using Bash with Curl or PowerShell:
curl -k -u $REST_API_USER:$REST_API_PASSWORD -X GET $REST_API_URL/config/corda.messaging
Invoke-RestMethod -SkipCertificateCheck -Headers @{Authorization=("Basic {0}" -f ${REST_API_USER}:${REST_API_PASSWORD})} -Uri "$REST_API_URL/config/corda.messaging"
The GET method of the /api/v5_2/config
endpoint returns the current values of the specified configuration section in JSON.
Was this page helpful?
Thanks for your feedback!
Chat with us
Chat with us on our #docs channel on slack. You can also join a lot of other slack channels there and have access to 1-on-1 communication with members of the R3 team and the online community.
Propose documentation improvements directly
Help us to improve the docs by contributing directly. It's simple - just fork this repository and raise a PR of your own - R3's Technical Writers will review it and apply the relevant suggestions.
We're sorry this page wasn't helpful. Let us know how we can make it better!
Chat with us
Chat with us on our #docs channel on slack. You can also join a lot of other slack channels there and have access to 1-on-1 communication with members of the R3 team and the online community.
Create an issue
Create a new GitHub issue in this repository - submit technical feedback, draw attention to a potential documentation bug, or share ideas for improvement and general feedback.
Propose documentation improvements directly
Help us to improve the docs by contributing directly. It's simple - just fork this repository and raise a PR of your own - R3's Technical Writers will review it and apply the relevant suggestions.