Esempio n. 1
0
        /// <summary>
        /// Sends the specified message.
        /// </summary>
        /// <param name="message">The message.</param>
        public void Send(Message message)
        {
            _logger.Value.DebugFormat("SQSMessageProducer: Publishing message with topic {0} and id {1} and message: {2}",
                                      message.Header.Topic, message.Id, message.Body);

            using (var client = new AmazonSimpleNotificationServiceClient(_connection.Credentials, _connection.Region))
            {
                var publisher = new SqsMessagePublisher(_topicArn, client);
                publisher.Publish(message);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Sends the specified message.
        /// </summary>
        /// <param name="message">The message.</param>
        public void Send(Message message)
        {
            s_logger.LogDebug("SQSMessageProducer: Publishing message with topic {Topic} and id {Id} and message: {Request}",
                              message.Header.Topic, message.Id, message.Body);

            ConfirmTopicExists(message.Header.Topic);

            using (var client = new AmazonSimpleNotificationServiceClient(_connection.Credentials, _connection.Region))
            {
                var publisher = new SqsMessagePublisher(_ensuredTopics[message.Header.Topic], client);
                publisher.Publish(message);
            }
        }