/// <summary> /// Process PinkoMsgClientPing /// </summary> public IBusMessageOutbound ProcessPinkoMsgClientPing(IBusMessageInbound envelop, PinkoMsgClientPing pinkoMsgClientPing) { var subs = ClientSubscriptions[pinkoMsgClientPing.DataFeedIdentifier.SubscribtionId]; // Reset date to latest if (subs.IsNotNull() && subs.LastPing < pinkoMsgClientPing.PingTime) subs.LastPing = pinkoMsgClientPing.PingTime; return null; }
/// <summary> /// client ping accessor /// </summary> /// <param name="maketEnvId"></param> /// <param name="clientCtx"></param> /// <param name="clientId"></param> /// <param name="signalRId"></param> /// <param name="webRoleId"></param> /// <param name="subscribtionId"></param> /// <returns></returns> public HttpResponseMessage GetPing(string maketEnvId, string clientCtx, string clientId, string signalRId, string webRoleId, string subscribtionId ) { if (string.IsNullOrEmpty(maketEnvId)) return new HttpResponseMessage(HttpStatusCode.BadRequest) { ReasonPhrase = "Invalid Pinko Ping. Missing Market Environment Id" }; if (string.IsNullOrEmpty(clientCtx)) return new HttpResponseMessage(HttpStatusCode.BadRequest) { ReasonPhrase = "Invalid Pinko Ping. Missing Client Context." }; if (string.IsNullOrEmpty(clientId)) return new HttpResponseMessage(HttpStatusCode.BadRequest) { ReasonPhrase = "Invalid Pinko Ping. Missing Client Id." }; if (string.IsNullOrEmpty(signalRId)) return new HttpResponseMessage(HttpStatusCode.BadRequest) { ReasonPhrase = "Invalid Pinko Ping. Missing SignalR Id." }; if (string.IsNullOrEmpty(webRoleId)) return new HttpResponseMessage(HttpStatusCode.BadRequest) { ReasonPhrase = "Invalid Pinko Ping. Missing Web Role Id." }; if (string.IsNullOrEmpty(subscribtionId)) return new HttpResponseMessage(HttpStatusCode.BadRequest) { ReasonPhrase = "Invalid Pinko Ping. Missing Subscription Id" }; var expMsg = new PinkoMsgClientPing { DataFeedIdentifier = { MaketEnvId = maketEnvId, ClientCtx = clientCtx, ClientId = clientId, SignalRId = signalRId, WebRoleId = webRoleId, SubscribtionId = subscribtionId } }; var msgEnvelop = PinkoApplication.FactorWebEnvelop(clientCtx, WebRoleConnectManager.WebRoleId, expMsg); msgEnvelop.ReplyTo = string.Empty; msgEnvelop.QueueName = PinkoConfiguration.PinkoMessageBusToWorkerSubscriptionManagerAllTopic; msgEnvelop.PinkoProperties[PinkoMessagePropTag.RoleId] = WebRoleConnectManager.WebRoleId; ServerMessageBus.Publish(msgEnvelop); return new HttpResponseMessage(HttpStatusCode.OK); }