private void OnUnbind(string msg, string reply, string subject) { Logger.Debug(Strings.UnbindRequestDebugLogMessage, ServiceDescription(), msg, reply); SimpleResponse response = new SimpleResponse(); UnbindRequest unbind_req = new UnbindRequest(); unbind_req.FromJsonIntermediateObject(JsonConvertibleObject.DeserializeFromJson(msg)); unbind_req.Credentials.ServiceWorkFactory.StartNew( () => { try { bool result = this.Unbind(unbind_req.Credentials); if (result) { this.NodeNats.Publish(reply, null, EncodeSuccess(response)); } else { this.NodeNats.Publish(reply, null, EncodeFailure(response)); } } catch (Exception ex) { Logger.Warning(ex.ToString()); NodeNats.Publish(reply, null, EncodeFailure(response, ex)); } }); }
private void OnUnbind(string msg, string reply, string subject) { Logger.Debug(Strings.UnbindRequestDebugLogMessage, ServiceDescription(), msg, reply); SimpleResponse response = new SimpleResponse(); UnbindRequest unbind_req = new UnbindRequest(); unbind_req.FromJsonIntermediateObject(JsonConvertibleObject.DeserializeFromJson(msg)); unbind_req.Credentials.ServiceWorkFactory.StartNew( () => { try { bool result = this.Unbind(unbind_req.Credentials); if (result) { this.nodeNats.Publish(reply, null, EncodeSuccess(response)); } else { this.nodeNats.Publish(reply, null, EncodeFailure(response)); } } catch (Exception ex) { Logger.Warning(ex.ToString()); nodeNats.Publish(reply, null, EncodeFailure(response, ex)); } }); }