/// <summary>
 /// Instantiates the Poller.
 /// </summary>
 /// <param name="props">
 /// A <see cref="MessageGearsProperties"/>
 /// </param>
 /// <param name="listener">
 /// A <see cref="MessageGearsListener"/>
 /// </param>
 /// <param name="myAwsAccountKey">
 /// You AWS Account Key
 /// </param>
 /// <param name="myAwsSecretKey">
 /// Your AWS Secret Key
 /// </param>
 public MessageGearsAwsQueuePoller(MessageGearsAwsProperties props, MessageGearsListener listener)
 {
     this.props = props;
     this.emptyQueueDelayMillis = props.EmptyQueuePollingDelaySecs * 1000;
     this.listener = listener;
     AmazonSQSConfig config = new AmazonSQSConfig().WithMaxErrorRetry(props.SQSMaxErrorRetry);
     this.sqs = AWSClientFactory.CreateAmazonSQSClient (props.MyAWSAccountKey, props.MyAWSSecretKey, config);
     this.receiveMessageRequest = new ReceiveMessageRequest ()
         .WithQueueUrl (props.MyAWSEventQueueUrl)
         .WithMaxNumberOfMessages (props.SQSMaxBatchSize)
         .WithAttributeName("ApproximateReceiveCount")
         .WithVisibilityTimeout(props.SQSVisibilityTimeoutSecs);
     this.deleteMessageRequest = new DeleteMessageRequest().WithQueueUrl(props.MyAWSEventQueueUrl);
 }
Exemplo n.º 2
0
        /// <summary>
        /// Instantiates the Poller.
        /// </summary>
        /// <param name="props">
        /// A <see cref="MessageGearsProperties"/>
        /// </param>
        /// <param name="listener">
        /// A <see cref="MessageGearsListener"/>
        /// </param>
        /// <param name="myAwsAccountKey">
        /// You AWS Account Key
        /// </param>
        /// <param name="myAwsSecretKey">
        /// Your AWS Secret Key
        /// </param>
        public MessageGearsAwsQueuePoller(MessageGearsAwsProperties props, MessageGearsListener listener)
        {
            this.props = props;
            this.emptyQueueDelayMillis = props.EmptyQueuePollingDelaySecs * 1000;
            this.listener = listener;
            AmazonSQSConfig config = new AmazonSQSConfig().WithMaxErrorRetry(props.SQSMaxErrorRetry);

            this.sqs = AWSClientFactory.CreateAmazonSQSClient(props.MyAWSAccountKey, props.MyAWSSecretKey, config);
            this.receiveMessageRequest = new ReceiveMessageRequest()
                                         .WithQueueUrl(props.MyAWSEventQueueUrl)
                                         .WithMaxNumberOfMessages(props.SQSMaxBatchSize)
                                         .WithAttributeName("ApproximateReceiveCount")
                                         .WithVisibilityTimeout(props.SQSVisibilityTimeoutSecs);
            this.deleteMessageRequest = new DeleteMessageRequest().WithQueueUrl(props.MyAWSEventQueueUrl);
        }
Exemplo n.º 3
0
 /// <summary>
 /// Use to construct an instance of the ActivityFileProcessor class.
 /// </summary>
 /// <param name="listener">
 /// Your implementation of the MessageGearsListener interface that know what to do with each event type that can come back from the MessageGears system.<see cref="MessageGearsListener"/>
 /// </param>
 public MessageGearsActivityFileProcessor(MessageGearsListener listener)
 {
     this.listener = listener;
 }
 /// <summary>
 /// Use to construct an instance of the ActivityFileProcessor class.
 /// </summary>
 /// <param name="listener">
 /// Your implementation of the MessageGearsListener interface that know what to do with each event type that can come back from the MessageGears system.<see cref="MessageGearsListener"/>
 /// </param>
 public MessageGearsActivityFileProcessor(MessageGearsListener listener)
 {
     this.listener = listener;
 }