package com.jasamedika.medifirst2000.notification;

//@Configuration
//@EnableRabbit
public class RabbitMQConfiguration {
	
	public final static String TOPIC_EXCHANGE_NAME = "jasamedika-medifirst-exchange";
	public final static String QUEUE_NAME = "internal-queu";
	public final static String ROUTING_KEY = "ruanganId.*";
	
//	@Bean
//	public ConnectionFactory connectionFactory() {
//	    CachingConnectionFactory connectionFactory = new CachingConnectionFactory("localhost");
//	    connectionFactory.setUsername("guest");
//	    connectionFactory.setPassword("guest");
//	    return connectionFactory;
//	}
//	
//	@Bean
//	public RabbitTemplate getRabbitTemplate(){
//		RabbitTemplate rabbit = new RabbitTemplate(connectionFactory());
//		rabbit.setExchange(TOPIC_EXCHANGE_NAME);
//		rabbit.setRoutingKey(ROUTING_KEY);
//	    return rabbit;
//	}
//	
//
//	@Bean
//    public Queue getQueue() {
//        return new Queue(QUEUE_NAME, true);
//    }
//	
//	@Bean
//	public TopicExchange getTopicExchange() {
//		return new TopicExchange(TOPIC_EXCHANGE_NAME);
//    }
//	
//	@Bean
//    public SimpleRabbitListenerContainerFactory myRabbitListenerContainerFactory() {
//      SimpleRabbitListenerContainerFactory factory = new SimpleRabbitListenerContainerFactory();
//      factory.setConnectionFactory(connectionFactory());
//      factory.setAcknowledgeMode(AcknowledgeMode.MANUAL);
//      
//      return factory;
//    }
//    
//	// ini ibarat jalan tolnya.. :P
//	@Bean
//	public Binding binding(Queue queue, TopicExchange exchange) {
//        return BindingBuilder.bind(queue).to(exchange).with(ROUTING_KEY);
//    }
}

