protected override Dictionary <string, Action <BasicDeliverEventArgs> > DoGetPaths() { return(new Dictionary <string, Action <BasicDeliverEventArgs> > { [MqKeyword.UpdateUserRSAKeyRoutingKey] = ea => { string loginName = ea.BasicProperties.ReadHeaderString(MqKeyword.LoginNameHeaderName); string appId = ea.BasicProperties.AppId; var key = UserMqBodyUtil.GetUpdateUserRSAKeyMqReceiveBody(ea.Body); VirtualRoot.Execute(new UpdateUserRSAKeyMqCommand(appId, loginName, ea.GetTimestamp(), key)); } }); }
protected override void DoGo(BasicDeliverEventArgs ea) { base.DoGo(ea); switch (ea.RoutingKey) { case MqKeyword.UpdateUserRSAKeyRoutingKey: { string loginName = ea.BasicProperties.ReadHeaderString(MqKeyword.LoginNameHeaderName); DateTime timestamp = Timestamp.FromTimestamp(ea.BasicProperties.Timestamp.UnixTime); string appId = ea.BasicProperties.AppId; var key = UserMqBodyUtil.GetUpdateUserRSAKeyMqReceiveBody(ea.Body); VirtualRoot.Execute(new UpdateUserRSAKeyMqMessage(appId, loginName, timestamp, key)); } break; default: break; } }
protected override bool DoGo(BasicDeliverEventArgs ea) { bool baseR = base.DoGo(ea); bool r = true; switch (ea.RoutingKey) { case MqKeyword.UpdateUserRSAKeyRoutingKey: { string loginName = ea.BasicProperties.ReadHeaderString(MqKeyword.LoginNameHeaderName); DateTime timestamp = Timestamp.FromTimestamp(ea.BasicProperties.Timestamp.UnixTime); string appId = ea.BasicProperties.AppId; var key = UserMqBodyUtil.GetUpdateUserRSAKeyMqReceiveBody(ea.Body); VirtualRoot.Execute(new UpdateUserRSAKeyMqCommand(appId, loginName, timestamp, key)); } break; default: r = false; break; } return(baseR || r); }