Exemple #1
0
        private static void Main(string[] args)
        {
            var       snsClient         = new AmazonSimpleNotificationServiceClient(RegionEndpoint.EUWest1);
            var       subscriberService = new TopicSubscriberService(snsClient);
            var       sqsClient         = new AmazonSQSClient(RegionEndpoint.EUWest1);
            ISettings settings          = new Settings();

            XmlConfigurator.Configure();

            var service = new EventStoreAuditService(subscriberService, sqsClient, settings);

            service.PollQueues();
        }
        public EventStoreAuditService(TopicSubscriberService subscriberService, AmazonSQSClient sqsClient, ISettings settings)
        {
            _subscriberService = subscriberService;
            _eventStore        = EventStoreHttpConnection.Create(ConnectionSettings.Default,
                                                                 string.Format("http://{0}:{1}", settings.Address, settings.HttpPort));

            _sqsClient          = sqsClient;
            _eventStoreQueueUrl = settings.QueueUrl;

            _timer = new Timer
            {
                AutoReset = true,
                Interval  = settings.TimeSpanPolling.TotalMilliseconds
            };

            _timer.Elapsed += TopicSubscriptionTimeoutElapsed;
            _timer.Start();
        }