private void DoPublish(string subject, INatsMessage message, uint delay = 0) { // TODO 201207 if (Message.RECEIVE_ONLY == subject) if (message.IsReceiveOnly) { throw new InvalidOperationException(Resources.NatsClient_PublishReceiveOnlyMessage); } DoPublish(subject, message.ToJson(), delay); }
public void Publish(string subject, INatsMessage message) { if (message.CanPublishWithSubject(subject)) { DoPublish(subject, message); } else { throw new InvalidOperationException(String.Format(Resources.NatsClient_InvalidPublishAttempt_Fmt, message.GetType().Name, subject)); } }
public void PublishReply(string replyTo, INatsMessage message, uint delay) { if (message.CanPublishWithSubject(replyTo)) { DoPublish(replyTo, message, delay); } else { throw new InvalidOperationException(String.Format(Resources.NatsClient_InvalidPublishAttempt_Fmt, message.GetType().Name, replyTo)); } }
public static string FormatConnectMessage(INatsMessage message) { string messageJson = message.ToJson(); return(String.Format(CultureInfo.InvariantCulture, NatsCommandFormats.ConnectFmt, message)); }
public static string FormatPublishMessage(string subject, INatsMessage message) { string messageJson = message.ToJson(); return(FormatPublishMessage(subject, messageJson)); }
public static string FormatPublishMessage(string subject, INatsMessage message) { string messageJson = message.ToJson(); return FormatPublishMessage(subject, messageJson); }
public static string FormatConnectMessage(INatsMessage message) { string messageJson = message.ToJson(); return String.Format(CultureInfo.InvariantCulture, NatsCommandFormats.ConnectFmt, message); }
public void Publish(NatsCommand command, INatsMessage message) { DoPublish(command.Command, message); }
public void Publish(INatsMessage message) { DoPublish(message.PublishSubject, message); }