package com.zi.mwms.solution.config;

import java.util.Arrays;

import com.cim.idm.framework.autoconfigure.ZidmPlatformProperties;
import com.zi.mwms.solution.esb.MessageEvent;

import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ImportResource;

@Configuration
@ConditionalOnProperty(prefix = ZidmPlatformProperties.PLATFORM_PREFIX,name = "use-tibrv" ,havingValue = "true",matchIfMissing = false)
@ImportResource(locations= {"classpath:/esb/esb.service.xml","classpath:/esb/${svr}/esb.tibrv.xml"})
public class TibrvMessageEventConfig {
	@Bean("MessageEvent")
	public MessageEvent messageEvent() {
		MessageEvent messageEvent = new MessageEvent();

		messageEvent.setListenBeanNameList(Arrays.asList(new String[] { "DQListener" }));
		return messageEvent;
	}
}
