/// <summary> /// Publishes the specified message. /// </summary> /// <param name="message">The message to publish.</param> public void Publish(object message) { string topic = _topicBuilder.GetMessageTag(_selfIdentity.Context, message.GetType()); // Use message type as a topic string serializedMessage = WrapMessage(message).ToString(); _socket.SendMoreFrame(Encode(topic)).SendFrame(Encode(serializedMessage)); }
/// <summary> /// Add subscrubtion to given message type /// </summary> /// <param name="messageType">Type of the message to subscrube.</param> public void SubscribeTo(Type messageType) { _socket.Subscribe(_topicBuilder.GetMessageTag(_peer.Context, messageType)); }