Skip to content

Commit c0c059a

Browse files
committed
Release
1 parent 60f6d69 commit c0c059a

File tree

1 file changed

+78
-1
lines changed

1 file changed

+78
-1
lines changed

README.md

+78-1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ The following topics are covered:
4848
- [object:Cf (Client Function)](#objectcf-client-function)
4949
- [Execute Client Functions](#execute-client-functions)
5050
- [Properties](#properties)
51+
- [Rate Limit and Concurrent connection](#rate-limit-and-concurrent-connection)
5152
- [Change Log](#change-log)
5253
- [License](#license)
5354

@@ -196,7 +197,7 @@ print(dbridge.connectionstate.reconnect_attempt)
196197
| *connecting* | Your application is now attempting to connect to dataBridges network. |
197198
| *connected* | The connection to dataBridges network is open and authenticated with your `appkey`. |
198199
| *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. |
199-
| *connect_error* | The dataBridges network connection was previously connected and has now errored and closed. |
200+
| *connect_error* | This event will show system messages related to dataBridges network as well as Rate-limit exceptions (details in Rate-limit section). |
200201
| *disconnected* | The application is now disconnected from the dataBridges network. The application will than need to initiate fresh connection attempt again. |
201202
| *reconnecting* | Your application is now attempting to reconnect to dataBridges network as per properties set for reconnection. |
202203
| *reconnect_error* | Reconnection attempt has errored. |
@@ -2043,6 +2044,82 @@ except dBError as e:
20432044
| ------------- | ------------------------- | ------------------------------------------------------------ |
20442045
| 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. |
20452046

2047+
## Rate Limit and Concurrent connection
2048+
2049+
dataBridges implements both messages rate-limiting and max number of concurrent connections.
2050+
2051+
### Messages rate-limits
2052+
2053+
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.
2054+
2055+
- Check your account limits to understand what rate-limits are applicable to you or contact your account manager.
2056+
- Default socket level rate limits are 10 messages / second per connections.
2057+
2058+
#### What happens when the rate limit is exceeded?
2059+
2060+
Once the rate-limit is exceeded, all further channel messages as well as RPC and CF calls are not processed by the system.
2061+
2062+
> *Note:* Do note publishing messages or executing RPC and CF calls post rate-limit exceeding will increase your message consumption.
2063+
2064+
##### Events you can bind to get notified about rate-limit exceeded and restored
2065+
2066+
The connectionstatus object allows you to bind for event `connect_error`.
2067+
When the rate-limit is exceeded or restored you will get the following payload.code
2068+
2069+
- `ERR_socket_ratelimit_exceeded`
2070+
- `ERR_ratelimit_exceeded`
2071+
- `ERR_ratelimit_restored`
2072+
2073+
Take a look at the attached code-set to manage how to get notified about limit exceeded conditions.
2074+
2075+
##### What is rate limit restored?
2076+
2077+
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.
2078+
2079+
### Concurrent Connection limits
2080+
2081+
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.*
2082+
2083+
#### What happens when the concurrent connection limit is exceeded?
2084+
2085+
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.
2086+
2087+
<h4> Events you can bind to get notified about concurrent connection limit exceeded </h4>
2088+
2089+
The connectionstatus object allows you to bind for event `connect_error`.
2090+
When the concurrent connection limit is exceeded you will get the following payload.code
2091+
2092+
- `ERR_concurrent_connection_limit`
2093+
2094+
Take a look at the attached code-set to manage how to get notified about limit exceeded conditions.
2095+
2096+
### Code-set to get notified and take further action
2097+
2098+
You can add the below code-set to your program to get notified and take further action.
2099+
2100+
```python
2101+
self.dbridge.connectionstate.bind("connect_error", self.connecterror)
2102+
2103+
async def connecterror(self, payload):
2104+
try:
2105+
if payload.code == "ERR_socket_ratelimit_exceeded":
2106+
print("Socket ratelimit Exceeded")
2107+
return
2108+
elif payload.code == "ERR_ratelimit_exceeded":
2109+
print("Customer ratelimit Exceeded ", payload.message)
2110+
return
2111+
elif payload.code == "ERR_ratelimit_restored":
2112+
print("Customer ratelimit Restored ")
2113+
return
2114+
elif payload.code == "ERR_concurrent_connection_limit":
2115+
print("Customer Connection limit Exceeded.")
2116+
return
2117+
else:
2118+
print("connect_error ", payload.code, payload.message)
2119+
except Exception as e:
2120+
print(e)
2121+
```
2122+
20462123

20472124

20482125
## Change Log

0 commit comments

Comments
 (0)