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

import static com.knecon.fforesight.service.layoutparser.internal.api.queue.LayoutParsingQueueNames.LAYOUT_PARSING_DLQ;

import org.springframework.amqp.core.DirectExchange;
import org.springframework.amqp.core.Queue;
import org.springframework.amqp.core.QueueBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.knecon.fforesight.service.layoutparser.internal.api.queue.LayoutParsingQueueNames;

@Configuration
public class MessagingConfiguration {

    @Bean
    public DirectExchange layoutParsingRequestExchange() {

        return new DirectExchange(LayoutParsingQueueNames.LAYOUT_PARSING_REQUEST_EXCHANGE);
    }


    @Bean
    public Queue layoutParsingDLQ() {

        return QueueBuilder.durable(LAYOUT_PARSING_DLQ).build();
    }

}
