Esempio n. 1
0
        public QueueTriggerAttributeBindingProvider(INameResolver nameResolver,
                                                    QueueServiceClientProvider queueServiceClientProvider,
                                                    IOptions <QueuesOptions> queueOptions,
                                                    IWebJobsExceptionHandler exceptionHandler,
                                                    SharedQueueWatcher messageEnqueuedWatcherSetter,
                                                    ILoggerFactory loggerFactory,
                                                    IQueueProcessorFactory queueProcessorFactory,
                                                    QueueCausalityManager queueCausalityManager)
        {
            _queueServiceClientProvider = queueServiceClientProvider ?? throw new ArgumentNullException(nameof(queueServiceClientProvider));
            _queueOptions                 = (queueOptions ?? throw new ArgumentNullException(nameof(queueOptions))).Value;
            _exceptionHandler             = exceptionHandler ?? throw new ArgumentNullException(nameof(exceptionHandler));
            _messageEnqueuedWatcherSetter = messageEnqueuedWatcherSetter ?? throw new ArgumentNullException(nameof(messageEnqueuedWatcherSetter));
            _queueCausalityManager        = queueCausalityManager ?? throw new ArgumentNullException(nameof(queueCausalityManager));

            _nameResolver          = nameResolver;
            _loggerFactory         = loggerFactory;
            _queueProcessorFactory = queueProcessorFactory;

            _innerProvider =
                new CompositeArgumentBindingProvider(
                    new ConverterArgumentBindingProvider <QueueMessage>(new CloudQueueMessageDirectConverter(), loggerFactory), // $$$: Is this the best way to handle a direct CloudQueueMessage? TODO (kasobol-msft) is this needed?
                    new ConverterArgumentBindingProvider <string>(new StorageQueueMessageToStringConverter(), loggerFactory),
                    new ConverterArgumentBindingProvider <byte[]>(new StorageQueueMessageToByteArrayConverter(), loggerFactory),
                    new ConverterArgumentBindingProvider <BinaryData>(new StorageQueueMessageToBinaryDataConverter(), loggerFactory),
                    new UserTypeArgumentBindingProvider(loggerFactory)); // Must come last, because it will attempt to bind all types.
        }