Skip to content

Commit 82042a1

Browse files
committed
Release
1 parent 29cfd41 commit 82042a1

File tree

1 file changed

+81
-1
lines changed

1 file changed

+81
-1
lines changed

README.md

Lines changed: 81 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ The following topics are covered:
4141
- [object:Cf (Client Function)](#objectcf-client-function)
4242
- [Properties](#properties)
4343
- [System events for cf object](#system-events-for-cf-object)
44+
- [Rate Limit and Concurrent connection](#rate-limit-and-concurrent-connection)
4445
- [Change Log](#change-log)
4546
- [License](#license)
4647

@@ -201,7 +202,7 @@ console.log(dbridge.connectionstate.reconnect_attempt);
201202
| *connecting* | Your application is now attempting to connect to dataBridges network. |
202203
| *connected* | The connection to dataBridges network is open and authenticated with your `appkey`. |
203204
| *connection_break* | Indicates a network disconnection between application and dataBridges network. The library will initiate an automatic reconnection, if the reconnection property is set as true. |
204-
| *connect_error* | The dataBridges network connection was previously connected and has now errored and closed. |
205+
| *connect_error* | This event will show system messages related to dataBridges network as well as Rate-limit exceptions (details in Rate-limit section). |
205206
| *disconnected* | The application is now disconnected from the dataBridges network. The application will than need to initiate fresh connection attempt again. |
206207
| *reconnecting* | Your application is now attempting to reconnect to dataBridges network as per properties set for reconnection. |
207208
| *reconnect_error* | Reconnection attempt has errored. |
@@ -1707,6 +1708,85 @@ try {
17071708
| ------------- | ------------------------- | ------------------------------------------------------------ |
17081709
| DBNET_CF_CALL | ERR_CALLEE_QUEUE_EXCEEDED | No new cf calls are being routed by the dataBridges network to the application because the application's current cf processing queue has already exceeded. <br />Each application connection cannot exceed cf.queue.maximum. Refer to management console documentation for cf.queue.maximum details. |
17091710

1711+
## Rate Limit and Concurrent connection
1712+
1713+
dataBridges implements both messages rate-limiting and max number of concurrent connections.
1714+
1715+
### Messages rate-limits
1716+
1717+
Messages rate-limits are applicable at socket connection level and at overall level (aggregate messages consumption). For sockets message the rate limits are at per second and per minute level whereas overall rate-limit is at per hour, per day, per month level.
1718+
1719+
- Check your account limits to understand what rate-limits are applicable to you or contact your account manager.
1720+
- Default socket level rate limits are 10 messages / second per connections.
1721+
1722+
#### What happens when the rate limit is exceeded?
1723+
1724+
Once the rate-limit is exceeded, all further channel messages as well as RPC and CF calls are not processed by the system.
1725+
1726+
> *Note:* Do note publishing messages or executing RPC and CF calls post rate-limit exceeding will increase your message consumption.
1727+
1728+
##### Events you can bind to get notified about rate-limit exceeded and restored
1729+
1730+
The connectionstatus object allows you to bind for event `connect_error`.
1731+
When the rate-limit is exceeded or restored you will get the following payload.code
1732+
1733+
- `ERR_socket_ratelimit_exceeded`
1734+
- `ERR_ratelimit_exceeded`
1735+
- `ERR_ratelimit_restored`
1736+
1737+
Take a look at the attached code-set to manage how to get notified about limit exceeded conditions.
1738+
1739+
##### What is rate limit restored?
1740+
1741+
When overall rate-limits are exceeded (hour, day, month), system will notify rate-limit restored once the new time-window is entered. Do note, rate limit restored is not sent for per second and per minute rate-limiters.
1742+
1743+
### Concurrent Connection limits
1744+
1745+
Each purchase has an concurrent limit connection. *Check your account limits to understand what concurrent connections limits are applicable to you or contact your account manager.*
1746+
1747+
#### What happens when the concurrent connection limit is exceeded?
1748+
1749+
The system will disconnect excess connection and before that it will send a notification to the connection that the limit has been exceeded and the connection will be closed.
1750+
1751+
<h4> Events you can bind to get notified about concurrent connection limit exceeded </h4>
1752+
1753+
The connectionstatus object allows you to bind for event `connect_error`.
1754+
When the concurrent connection limit is exceeded you will get the following payload.code
1755+
1756+
- `ERR_concurrent_connection_limit`
1757+
1758+
Take a look at the attached code-set to manage how to get notified about limit exceeded conditions.
1759+
1760+
### Code-set to get notified and take further action
1761+
1762+
You can add the below code-set to your program to get notified and take further action.
1763+
1764+
```javascript
1765+
databridge.connectionstate.bind("connect_error", (payload) => {
1766+
switch (payload.code) {
1767+
case 'ERR_socket_ratelimit_exceeded':
1768+
// add your code to manage this condition
1769+
console.log('Socket ratelimit Exceeded');
1770+
break;
1771+
case 'ERR_ratelimit_exceeded':
1772+
// add your code to manage this condition
1773+
console.log( 'Customer ratelimit Exceeded', payload.message);
1774+
break;
1775+
case 'ERR_ratelimit_restored':
1776+
// add your code to manage this condition
1777+
console.log( 'Customer ratelimit Restored');
1778+
break;
1779+
case 'ERR_concurrent_connection_limit':
1780+
// add your code to manage this condition
1781+
console.log('Customer Connection limit Exceeded.');
1782+
break;
1783+
default:
1784+
console.log('connect_error', payload.code, payload.message);
1785+
break;
1786+
}
1787+
});
1788+
```
1789+
17101790

17111791

17121792
## Change Log

0 commit comments

Comments
 (0)