示例#1
0
        protected internal virtual FetchExternalTasksExtendedDto createDto(long?responseTimeout, string workerId)
        {
            FetchExternalTasksExtendedDto externalTask = new FetchExternalTasksExtendedDto();

            FetchExternalTasksExtendedDto.FetchExternalTaskTopicDto topic = new FetchExternalTasksExtendedDto.FetchExternalTaskTopicDto();
            topic.TopicName    = "aTopicName";
            topic.LockDuration = 12354L;

            externalTask.MaxTasks = 5;
            externalTask.WorkerId = workerId;
            externalTask.Topics   = Collections.singletonList(topic);

            if (responseTimeout != null)
            {
                externalTask.AsyncResponseTimeout = responseTimeout;
            }

            return(externalTask);
        }
示例#2
0
        private FetchExternalTasksExtendedDto createDto(long?responseTimeout, bool usePriority, bool withVariables, bool withDeserialization)
        {
            FetchExternalTasksExtendedDto fetchExternalTasksDto = new FetchExternalTasksExtendedDto();

            if (responseTimeout != null)
            {
                fetchExternalTasksDto.AsyncResponseTimeout = responseTimeout;
            }
            fetchExternalTasksDto.MaxTasks    = 5;
            fetchExternalTasksDto.WorkerId    = "aWorkerId";
            fetchExternalTasksDto.UsePriority = usePriority;
            FetchExternalTasksExtendedDto.FetchExternalTaskTopicDto topicDto = new FetchExternalTasksExtendedDto.FetchExternalTaskTopicDto();
            fetchExternalTasksDto.Topics = Collections.singletonList(topicDto);
            topicDto.TopicName           = "aTopicName";
            topicDto.LockDuration        = 12354L;
            if (withVariables)
            {
                topicDto.Variables = Collections.singletonList(MockProvider.EXAMPLE_VARIABLE_INSTANCE_NAME);
            }
            topicDto.DeserializeValues   = withDeserialization;
            fetchExternalTasksDto.Topics = Collections.singletonList(topicDto);
            return(fetchExternalTasksDto);
        }