Skip to content

Commit 9003996

Browse files
committed
Release
1 parent 7231ea3 commit 9003996

1 file changed

Lines changed: 81 additions & 1 deletion

File tree

README.md

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

@@ -191,7 +192,7 @@ Console.WriteLine(dbridge.connectionstate.reconnect_attempt);
191192
| *connecting* | Your application is now attempting to connect to dataBridges network. |
192193
| *connected* | The connection to dataBridges network is open and authenticated with your `appkey`. |
193194
| *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. |
194-
| *connect_error* | The dataBridges network connection was previously connected and has now errored and closed. |
195+
| *connect_error* | This event will show system messages related to dataBridges network as well as Rate-limit exceptions (details in Rate-limit section). |
195196
| *disconnected* | The application is now disconnected from the dataBridges network. The application will than need to initiate fresh connection attempt again. |
196197
| *reconnecting* | Your application is now attempting to reconnect to dataBridges network as per properties set for reconnection. |
197198
| *reconnect_error* | Reconnection attempt has errored. |
@@ -1775,6 +1776,85 @@ try {
17751776
| ------------- | ------------------------- | ------------------------------------------------------------ |
17761777
| 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. |
17771778

1779+
## Rate Limit and Concurrent connection
1780+
1781+
dataBridges implements both messages rate-limiting and max number of concurrent connections.
1782+
1783+
### Messages rate-limits
1784+
1785+
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.
1786+
1787+
- Check your account limits to understand what rate-limits are applicable to you or contact your account manager.
1788+
- Default socket level rate limits are 10 messages / second per connections.
1789+
1790+
#### What happens when the rate limit is exceeded?
1791+
1792+
Once the rate-limit is exceeded, all further channel messages as well as RPC and CF calls are not processed by the system.
1793+
1794+
> *Note:* Do note publishing messages or executing RPC and CF calls post rate-limit exceeding will increase your message consumption.
1795+
1796+
##### Events you can bind to get notified about rate-limit exceeded and restored
1797+
1798+
The connectionstatus object allows you to bind for event `connect_error`.
1799+
When the rate-limit is exceeded or restored you will get the following payload.code
1800+
1801+
- `ERR_socket_ratelimit_exceeded`
1802+
- `ERR_ratelimit_exceeded`
1803+
- `ERR_ratelimit_restored`
1804+
1805+
Take a look at the attached code-set to manage how to get notified about limit exceeded conditions.
1806+
1807+
##### What is rate limit restored?
1808+
1809+
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.
1810+
1811+
### Concurrent Connection limits
1812+
1813+
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.*
1814+
1815+
#### What happens when the concurrent connection limit is exceeded?
1816+
1817+
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.
1818+
1819+
<h4> Events you can bind to get notified about concurrent connection limit exceeded </h4>
1820+
1821+
The connectionstatus object allows you to bind for event `connect_error`.
1822+
When the concurrent connection limit is exceeded you will get the following payload.code
1823+
1824+
- `ERR_concurrent_connection_limit`
1825+
1826+
Take a look at the attached code-set to manage how to get notified about limit exceeded conditions.
1827+
1828+
### Code-set to get notified and take further action
1829+
1830+
You can add the below code-set to your program to get notified and take further action.
1831+
1832+
```c#
1833+
Action<object> connecterror_callback;
1834+
this.dbridge.connectionstate.bind("connect_error", connecterror_callback = (object eventinfo) => {
1835+
dBridges.exceptions.dBError payload = eventinfo as dBridges.exceptions.dBError;
1836+
1837+
switch (payload.code)
1838+
{
1839+
case "ERR_socket_ratelimit_exceeded":
1840+
Console.WriteLine("Socket ratelimit Exceeded");
1841+
break;
1842+
case "ERR_ratelimit_exceeded":
1843+
Console.WriteLine("Customer ratelimit Exceeded {0}", payload.message);
1844+
break;
1845+
case "ERR_ratelimit_restored":
1846+
Console.WriteLine("Customer ratelimit Restored");
1847+
break;
1848+
case "ERR_concurrent_connection_limit":
1849+
Console.WriteLine("Customer Connection limit Exceeded.");
1850+
break;
1851+
default:
1852+
Console.WriteLine("connect_error {0} {1}", payload.code, payload.message);
1853+
break;
1854+
}
1855+
});
1856+
```
1857+
17781858

17791859

17801860
## Change Log

0 commit comments

Comments
 (0)