Esempio n. 1
0
        /// <summary>
        /// Configures a publisher for a pre-existing topic.
        /// </summary>
        /// <param name="topicArn">The ARN of the topic to publish to.</param>
        /// <param name="configure">An optional delegate to configure a topic publisher.</param>
        /// <typeparam name="T">The type of the message to publish to.</typeparam>
        /// <returns>The current <see cref="PublicationsBuilder"/>.</returns>
        /// <exception cref="ArgumentNullException"></exception>
        public PublicationsBuilder WithTopicArn <T>(string topicArn, Action <TopicAddressPublicationBuilder <T> > configure = null)
            where T : Message
        {
            if (topicArn == null)
            {
                throw new ArgumentNullException(nameof(topicArn));
            }

            var builder = new TopicAddressPublicationBuilder <T>(TopicAddress.FromArn(topicArn));

            configure?.Invoke(builder);

            Publications.Add(builder);

            return(this);
        }
Esempio n. 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TopicAddressPublicationBuilder{T}"/> class.
 /// </summary>
 /// <param name="topicAddress">The address of the topic to publish to.</param>
 internal TopicAddressPublicationBuilder(TopicAddress topicAddress)
 {
     _topicAddress = topicAddress;
 }
 public TopicAddressPublisher(IAmazonSimpleNotificationService snsClient, ILoggerFactory loggerFactory, IMessageSubjectProvider subjectProvider, IMessageSerializationRegister serializationRegister, Func <Exception, Message, bool> handleException, TopicAddress topicAddress)
     : base(topicAddress.TopicArn, snsClient, serializationRegister, loggerFactory, subjectProvider, handleException)
 {
 }