Glue Framework

applicationContext.xml

ucubeManager가 다음과 같이 applicationContext.xml에 포함되어 있어야 합니다. 그리고 ucubeManager가 가장 먼저 생성될 수 있도록 합니다.

<?xml version="1.0" encoding="UTF-8"?>
<beans . . .>
    <bean id="ucubeManager" class="com.poscoict.glueframework.ucube4.GlueUCubeManagerImpl">
        <property name="propertyFileName" value="D:/uCUBE4/Services/Send/Config/ucube.properties"/>
        <property name="serviceBrokerNames">
            <list>
                <value>Glue_SEND</value>
                <value>Glue_RECV</value>
            </list>
        </property>
        <property name="period" value="100"/>
    </bean>
    <bean . . .>
</beans>

u-CUBE

u-Cube property file ( ex. ucube.properties )

4개의 property가 설정되어 있습니다. 그 값은 경로를 포함하는 파일명입니다. 각 파일의 대한 설명은 여기서 다루지 않습니다.

handler.dir.path=D:/uCUBE4/Services/Send/Config/cfg/GlueSend_SBH.xml
common.file.path=D:/uCUBE4/Services/Send/Config/cfg/ServiceBrokerCommon.xml
config.file.path=D:/uCUBE4/Services/Send/Config/cfg/ServiceBrokerConfig.xml
license.file.path=D:/uCUBE4/Services/Send/Config/license_info_Development(4.3.x).xml

u-Cube handler file ( ex. GlueSend_SBH.xml )

ServiceBrokerHandler는 1개 이상의 ServiceBroker를 갖으며, 그 이름(name="Glue_SEND")은 ucubeManager(com.poscoict.glueframework.ucube4.GlueUCubeManagerImpl) 의 serviceBrokerNames에서 사용됩니다.

<?xml version="1.0" encoding="UTF-8"?>
<ServiceBrokerHandler name="GlueSend_SBH" xmlns="http://com/poscoict/eai/adapter/schema/broker"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://com/poscoict/eai/adapter/schema/broker ServiceBrokerHandler.xsd ">
    <ServiceBroker name="Glue_SEND">
        <Service name="APISource" position="START" init="true">
            <ConfigID>API_SOURCE</ConfigID>
            <RunType>INSTANCE</RunType>
            <NextService transaction="true">
                <Name>JMSDestination</Name>
            </NextService>
        </Service>
        <Service name="JMSDestination" position="END" init="true">
            <ConfigID>JMS_DESTINATION</ConfigID>
            <RunType>INSTANCE</RunType>
            <QueueName>GLUE.QUEUE</QueueName>
        </Service>
    </ServiceBroker>
    <!-- ServiceBroker name="Glue_RECV">
        <Service name="JMSSource" position="START" init="true">
            <ConfigID>JMS_SOURCE</ConfigID>
            <RunType>INSTANCE</RunType>
            <QueueName>GLUE.QUEUE</QueueName>
            <NextService transaction="true">
                <Name>APIDestination</Name>
            </NextService>
        </Service>
        <Service name="APIDestination" position="END" init="true">
            <ConfigID>API_DEST</ConfigID>
            <RunType>INSTANCE</RunType>
        </Service>
    </ServiceBroker -->
    <Common id="COMMON_GLUE_SERVICE" />
    <Monitor id="MONITOR_COMMON" />
</ServiceBrokerHandler>

u-Cube config file ( ex. ServiceBrokerConfig.xml )

ServiceConfig는 1개 이상의 ServiceInfo를 갖으며, 항상 CLASS_NAME을 필요로 합니다. ServiceInfo 중에 CLASS_NAME이 com.poscoict.eai.adapter.service.msgtype.api.APIDestination 인 것은 Glue Framework(glue-ucube)에서 RECEIVE_LISTENER_CLASS를 제공하고 있습니다. glue-ucube-{version}.jar에 com.poscoict.glueframework.ucube4.GlueUCubeReceiverListnerImpl이 있습니다.

<?xml version="1.0" encoding="UTF-8"?>
<ServiceConfig xmlns="http://com/poscoict/eai/adapter/schema/config"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://com/poscoict/eai/adapter/schema/config ServiceBrokerConfig.xsd ">

    <!-- for TC GlueService -->
    <ServiceInfo id="API_SOURCE">
        <CLASS_NAME>com.poscoict.eai.adapter.service.msgtype.api.APISource</CLASS_NAME>
    </ServiceInfo>
    <ServiceInfo id="API_DEST">
        <CLASS_NAME>com.poscoict.eai.adapter.service.msgtype.api.APIDestination</CLASS_NAME>
        <RECEIVE_LISTENER_CLASS>com.poscoict.glueframework.ucube4.GlueUCubeReceiverListnerImpl</RECEIVE_LISTENER_CLASS>
        <ServiceName>ucube4recv</ServiceName>
    </ServiceInfo>
    <ServiceInfo id="JMS_SOURCE">
        <CLASS_NAME>com.poscoict.eai.adapter.service.jms.JMSSource</CLASS_NAME>
        <INITIAL_CONTEXT_FACTORY>org.jnp.interfaces.NamingContextFactory</INITIAL_CONTEXT_FACTORY>
        <RUN_TYPE>AUTO_LAUNCH</RUN_TYPE>
        <JMSPROVIDER_URL>203.238.222.43:1099</JMSPROVIDER_URL>
        <QUEUE_CONNECTION_FACTORY>UIL2ConnectionFactory</QUEUE_CONNECTION_FACTORY>
        <QUEUE_PREFIX>queue/</QUEUE_PREFIX>
        <USERNAME>guest</USERNAME>
        <PASSWORD>guest</PASSWORD>
        <ENABLE_LOCALQUEUE>FALSE</ENABLE_LOCALQUEUE>
        <ONMESSAGE_WAIT_TIME>3000</ONMESSAGE_WAIT_TIME>
        <APPEND_CHUNK>TRUE</APPEND_CHUNK>
        <!--USE_NON_TRANSACTED_MODE>TRUE</USE_NON_TRANSACTED_MODE-->
    </ServiceInfo>
    <ServiceInfo id="JMS_DESTINATION">
        <CLASS_NAME>com.poscoict.eai.adapter.service.jms.JMSDestination</CLASS_NAME>
        <INITIAL_CONTEXT_FACTORY>org.jnp.interfaces.NamingContextFactory</INITIAL_CONTEXT_FACTORY>
        <JMSPROVIDER_URL>203.238.222.43:1099</JMSPROVIDER_URL>
        <QUEUE_CONNECTION_FACTORY>UIL2ConnectionFactory</QUEUE_CONNECTION_FACTORY>
        <QUEUE_PREFIX>queue/</QUEUE_PREFIX>
        <USERNAME>guest</USERNAME>
        <PASSWORD>guest</PASSWORD>
        <ENABLE_LOCALQUEUE>FALSE</ENABLE_LOCALQUEUE>
        <MAX_LQ_SIZE>10240</MAX_LQ_SIZE>
        <ENABLE_CHUNK>TRUE</ENABLE_CHUNK>
        <CHUNK_SIZE>500000</CHUNK_SIZE>
    </ServiceInfo>
</ServiceConfig>

<RECEIVE_LISTENER_CLASS> 는 Glue Framework 버전의 따라 달라집니다.

  • Glue Framework 4 인경우 - <ServiceName> 은 필수임.
    ...
        <ServiceInfo id="API_DEST">
            <CLASS_NAME>com.poscoict.eai.adapter.service.msgtype.api.APIDestination</CLASS_NAME>
            <RECEIVE_LISTENER_CLASS>com.poscoict.glueframework.ucube4.GlueUCubeReceiverListnerImpl</RECEIVE_LISTENER_CLASS>
            <ServiceName>MSGFW001</ServiceName>
            <extra1>dummy</extra1>
            <extra2>dummy</extra2>
        </ServiceInfo>
    ...
    
  • Glue Framework 3 인경우 - <USER_PARAM1> 이 ServiceName으로 사용됨.
    ...
        <ServiceInfo id="API_DEST">
            <CLASS_NAME>com.poscoict.eai.adapter.service.msgtype.api.APIDestination</CLASS_NAME>
            <RECEIVE_LISTENER_CLASS>com.posdata.glue.ucube4.PosUCubeReceiveListener</RECEIVE_LISTENER_CLASS>
            <USER_PARAM1>MSGFW001</USER_PARAM1>
            <USER_PARAM2>extra</USER_PARAM2>
        </ServiceInfo>
    ...
    

u-Cube common file ( ex. ServiceBrokerCommon.xml )

<?xml version="1.0" encoding="UTF-8"?>
<ServiceBrokerCommon xmlns="http://com/poscoict/eai/adapter/schema/common"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://com/poscoict/eai/adapter/schema/common ServiceBrokerCommon.xsd ">
    <Common id="COMMON_GLUE_SERVICE">
        <LogLevel>DEBUG</LogLevel>
        <EventQueue>EVENT.QUEUE</EventQueue>
        <DataQueue>DATA.QUEUE</DataQueue>
        <EaiBaseDirectory>D:\uCUBE4\Services\Send</EaiBaseDirectory>
        <SrcPc>GLUEsend_SERVICE</SrcPc>
        <ReconnectInterval>10000</ReconnectInterval>
        <EncodingValue>UTF-8</EncodingValue>
        <EnableMonitor>false</EnableMonitor>
        <BackGroundConn>true</BackGroundConn>
    </Common>
    <Monitor id="MONITOR_COMMON">
        <Type>DESTINATION</Type>
        <DestinationName>MON</DestinationName>
        <InitialContextFactory>org.jnp.interfaces.NamingContextFactory</InitialContextFactory>
        <JmsproviderUrl>203.238.222.43:1099</JmsproviderUrl>
        <TopicConnectionFactory>UIL2ConnectionFactory</TopicConnectionFactory>
        <TopicName>ADAPTER.MONITOR</TopicName>
        <TopicPrefix>topic/</TopicPrefix>
        <Username>guest</Username>
        <Password>guest</Password>
        <EnableLocalqueue>false</EnableLocalqueue>
        <SendStatusInterval>60000</SendStatusInterval>
    </Monitor>
</ServiceBrokerCommon>

u-Cube license file ( ex. license_info_Development(4.3.x).xml )

<?xml version="1.0" encoding="UTF-8"?>
<poscoict-license xmlns="http://www.poscoict.com/license">
    <solutionName>uCUBE</solutionName>
    <companyName>uCUBE_TEST(1231)</companyName>
    <projectName>uCUBE_TEST(1231)</projectName>
    <licenseMode>Development</licenseMode>
    <expireDate>2014-12-31</expireDate>
    <licenseKey>uCUBE_TEST(1231)-Development(4.3.x).license</licenseKey>
</poscoict-license>