The REST API provides some protection against an excessive number of REST API calls made within a short period of time. A simple mechanism prevents message transmission delay due to too many incoming requests via the REST API, and detects some misconfiguration in scripts calling the REST API that causes them to call it far more than expected. Though the default limit is 500 requests per minute, an appropriate limit is very much dependent on the hardware that Rhapsody is running on and the normal message processing load. The limit setting is found in the rhapsody.properties
file:
# Configure the maximum number of requests per minute via the REST API #RestApi.MaximumRequestsPerMinute=500
To change the default limit:
- Edit the value in the
rhapsody.properties
file. - Uncomment the line.
- Restart the Rhapsody engine so that it picks up the change.
If more than the configured number of requests are received via the REST API within a minute, subsequent requests in excess of the limit are rejected with a 429 Too Many Requests
HTTP status code. When the minute expires, the request count is reset, and new requests are accepted.
Additionally, if any requests are rejected due to this limit, an alert is raised to make this obvious to the user. This alert is enabled by default as a warning, and is raised as soon as any requests are rejected (although enabled by default it will not be raised unless the REST API is in use). The alert remains visible in the Management Console until it is manually dismissed by the user. Only one instance of this alert is raised at a time.