diff --git a/src/com/eactive/eai/common/routing/jms/TimerEventListenerQueueConsumerService.java b/src/com/eactive/eai/common/routing/jms/TimerEventListenerQueueConsumerService.java index c58bffb..6656c62 100644 --- a/src/com/eactive/eai/common/routing/jms/TimerEventListenerQueueConsumerService.java +++ b/src/com/eactive/eai/common/routing/jms/TimerEventListenerQueueConsumerService.java @@ -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(); diff --git a/src/com/eactive/eai/common/util/ServiceLocator.java b/src/com/eactive/eai/common/util/ServiceLocator.java index cec4809..1f991af 100644 --- a/src/com/eactive/eai/common/util/ServiceLocator.java +++ b/src/com/eactive/eai/common/util/ServiceLocator.java @@ -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")); @@ -212,32 +206,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 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