Beispiel #1
0
        /// <summary>
        ///   Publish messsage to topic.
        /// </summary>
        /// <param name = "topic">The topic to publish the message to. The topic represents a channel.</param>
        /// <param name = "subject">The suject used when publishing to the topic.</param>
        /// <param name = "message">The body message used when publishing to the topic.</param>
        public void Publish(Topic topic, string subject, string message)
        {
            Validate.That(topic).IsNotNull();
            Validate.That(subject).IsNotNullOrEmpty();
            Validate.That(message).IsNotNullOrEmpty();

            amazonSnsFacade.PublishMessageToTopic(topic.TopicArn, subject, message);
        }
        public void Publish(Topic topic, string subject, string message)
        {
            topic.Requires().IsNotNull();
            subject.Requires().IsNotNullOrWhiteSpace();
            message.Requires().IsNotNullOrWhiteSpace();

            amazonSnsFacade.PublishMessageToTopic(topic.TopicArn, subject, message);
        }
        /// <summary>
        /// Publish messsage to topic.
        /// </summary>
        /// <param name="topic">The topic to publish the message to. The topic represents a channel.</param>
        /// <param name="subject">The suject used when publishing to the topic.</param>
        /// <param name="message">The body message used when publishing to the topic.</param>
        public void Publish(Topic topic, string subject, string message)
        {
            Validate.That(topic).IsNotNull();
            Validate.That(subject).IsNotNullOrEmpty();
            Validate.That(message).IsNotNullOrEmpty();

            if (isDisposed)
            {
                throw new ObjectDisposedException(MethodBase.GetCurrentMethod().DeclaringType.Name, "instance has been disposed");
            }

            amazonSnsFacade.PublishMessageToTopic(topic.TopicArn, subject, message);
        }
        public void Publish(Topic topic, string subject, string message)
        {
            topic.Requires("topic").IsNotNull();
            subject.Requires("subject").IsNotNullOrWhiteSpace();
            message.Requires("message").IsNotNullOrWhiteSpace();

            if (isDisposed)
            {
                throw new ObjectDisposedException(MethodBase.GetCurrentMethod()?.DeclaringType?.Name,
                                                  "instance has been disposed");
            }

            amazonSnsFacade.PublishMessageToTopic(topic.TopicArn, subject, message);
        }