원복
This commit is contained in:
@@ -79,7 +79,7 @@ public class TimerEventListenerQueueConsumerService implements InitializingBean
|
||||
es = Executors.newFixedThreadPool(maxThread);
|
||||
|
||||
ServiceLocator locator = ServiceLocator.getInstance();
|
||||
logger.debug("TimerEventListenerQueueConsumerService startConsumer [ uri=" + uri +"]");
|
||||
|
||||
QueueConnectionFactory connectionFactory = locator.getQueueConnectionFactory(uri);
|
||||
connection = connectionFactory.createQueueConnection();
|
||||
|
||||
|
||||
@@ -188,23 +188,17 @@ public class ServiceLocator {
|
||||
public QueueConnectionFactory getQueueConnectionFactory(String qConnFactoryName)
|
||||
throws ServiceLocatorException {
|
||||
QueueConnectionFactory factory = null;
|
||||
System.out.println("=================getQueueConnectionFactory qConnFactoryName["+qConnFactoryName+"]");
|
||||
|
||||
try {
|
||||
if (cache.containsKey(qConnFactoryName)) {
|
||||
factory = (QueueConnectionFactory) cache.get(qConnFactoryName);
|
||||
} else {
|
||||
factory = (QueueConnectionFactory) initial.lookup(qConnFactoryName);
|
||||
cache.put(qConnFactoryName, factory);
|
||||
// System.out.println("=================getQueueConnectionFactory not containsKey");
|
||||
// factory = getRemoteQueueConnectionFactory(
|
||||
// "t3://192.168.240.176:8003", // 또는 실제 서버 주소
|
||||
// qConnFactoryName
|
||||
// );
|
||||
|
||||
}
|
||||
// } catch (NamingException ne) {
|
||||
// //throw new ServiceLocatorException(ne);
|
||||
// throw new ServiceLocatorException(ExceptionUtil.getErrorCode(ne,"RECEAICUL113"));
|
||||
} catch (NamingException ne) {
|
||||
//throw new ServiceLocatorException(ne);
|
||||
throw new ServiceLocatorException(ExceptionUtil.getErrorCode(ne,"RECEAICUL113"));
|
||||
} catch (Exception e) {
|
||||
//throw new ServiceLocatorException(e);
|
||||
throw new ServiceLocatorException(ExceptionUtil.getErrorCode(e,"RECEAICUL114"));
|
||||
@@ -213,32 +207,6 @@ System.out.println("=================getQueueConnectionFactory qConnFactoryName[
|
||||
return factory;
|
||||
}
|
||||
|
||||
|
||||
public QueueConnectionFactory getRemoteQueueConnectionFactory(String providerUrl, String jmsFactoryJndiName)
|
||||
throws ServiceLocatorException {
|
||||
QueueConnectionFactory factory = null;
|
||||
|
||||
try {
|
||||
if (cache.containsKey(jmsFactoryJndiName)) {
|
||||
factory = (QueueConnectionFactory) cache.get(jmsFactoryJndiName);
|
||||
} else {
|
||||
Hashtable<String, Object> env = new Hashtable<>();
|
||||
env.put(Context.INITIAL_CONTEXT_FACTORY, WEBLOGIC_INITIAL_CONTEXT_FACTORY);
|
||||
env.put(Context.PROVIDER_URL, providerUrl); // ex: "t3://localhost:7001"
|
||||
|
||||
Context ctx = new InitialContext(env);
|
||||
factory = (QueueConnectionFactory) ctx.lookup(jmsFactoryJndiName);
|
||||
cache.put(jmsFactoryJndiName, factory);
|
||||
}
|
||||
return factory;
|
||||
|
||||
} catch (NamingException ne) {
|
||||
throw new ServiceLocatorException(ExceptionUtil.getErrorCode(ne, "RECEAICUL113"));
|
||||
} catch (Exception e) {
|
||||
throw new ServiceLocatorException(ExceptionUtil.getErrorCode(e, "RECEAICUL114"));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. 기능 : Queue를 반환하는 method
|
||||
* 2. 처리 개요 :
|
||||
|
||||
Reference in New Issue
Block a user