docs(gw): enrich README.md

This commit is contained in:
JianBo He 2021-07-23 14:45:20 +08:00
parent 67bb8d0564
commit 80eb7f313d
2 changed files with 37 additions and 6 deletions

View File

@ -22,9 +22,31 @@
## ROADMAP
Gateway v0.1: Management support
Gateway v0.1: "Basic Functionals"
- Management support
- Conn/Frame/Protocol Template
- Support Stomp/MQTT-SN/CoAP/LwM2M/ExProto
Gateway v0.2: Conn/Frame/Protocol Template
Gateway v0.2: "Integration & Friendly Management"
- Hooks & Metrics & Statistic
- HTTP APIs
- Management in the cluster
- Integrate with AuthN
- Integrate with `emqx_config`
- Improve hocon config
- Mountpoint & ClientInfo's Metadata
- The Concept Review
Gateway v0.3: "Fault tolerance and high availability"
- The restart mechanism for gateway-instance
- Consistency of cluster state
- Configuration hot update
Gateway v1.0: "Best practices for each type of protocol"
- CoAP
- Stomp
- MQTT-SN
- LwM2M
### Compatible with EMQ X

View File

@ -246,15 +246,24 @@ open_session(_Type, false = _CleanStart,
{error, not_supported_now}.
%% @private
create_session(_Type, ClientInfo, ConnInfo, CreateSessionFun) ->
create_session(Type, ClientInfo, ConnInfo, CreateSessionFun) ->
try
Session = emqx_gateway_utils:apply(
CreateSessionFun,
[ClientInfo, ConnInfo]
),
%% TODO: v0.2 session metrics & hooks
%ok = emqx_metrics:inc('session.created'),
%ok = emqx_hooks:run('session.created', [ClientInfo, emqx_session:info(Session)]),
ok = emqx_gateway_metrics:inc(Type, 'session.created'),
SessionInfo = case is_record(Session, emqx_session) of
true -> emqx_session:info(Session);
_ ->
case is_map(Session) of
false ->
throw(session_structure_should_be_map);
_ ->
Session
end
end,
ok = emqx_hooks:run('session.created', [ClientInfo, SessionInfo]),
Session
catch
Class : Reason : Stk ->