package com.knecon.fforesight.service.layoutparser.server.configuration;

import java.util.Set;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.knecon.fforesight.service.layoutparser.internal.api.queue.LayoutParsingQueueNames;
import com.knecon.fforesight.service.layoutparser.server.queue.MessageHandler;
import com.knecon.fforesight.tenantcommons.model.TenantQueueConfiguration;
import com.knecon.fforesight.tenantcommons.model.TenantQueueProvider;

@Configuration
public class TenantQueueProviderConfig {

    @Bean
    public TenantQueueProvider getTenantQueueConfigs() {

        return new TenantQueueProvider(Set.of(TenantQueueConfiguration.builder()
                                                      .listenerId(MessageHandler.LAYOUT_PARSING_REQUEST_LISTENER_ID)
                                                      .exchangeName(LayoutParsingQueueNames.LAYOUT_PARSING_REQUEST_EXCHANGE)
                                                      .queuePrefix(LayoutParsingQueueNames.LAYOUT_PARSING_REQUEST_QUEUE_PREFIX)
                                                      .dlqName(LayoutParsingQueueNames.LAYOUT_PARSING_DLQ)
                                                      .build()));
    }

}
