Oracle BPEL ActiveMQ - Howto?

 

<!-- /* Font Definitions */ @font-face {font-family:宋体; panose-1:2 1 6 0 3 1 1 1 1 1; mso-font-alt:SimSun; mso-font-charset:134; mso-generic-font-family:auto; mso-font-pitch:variable; mso-font-signature:3 135135232 16 0 262145 0;} @font-face {font-family:"/@宋体"; panose-1:2 1 6 0 3 1 1 1 1 1; mso-font-charset:134; mso-generic-font-family:auto; mso-font-pitch:variable; mso-font-signature:3 135135232 16 0 262145 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:""; margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman"; mso-fareast-font-family:宋体;} a:link, span.MsoHyperlink {color:blue; text-decoration:underline; text-underline:single;} a:visited, span.MsoHyperlinkFollowed {color:purple; text-decoration:underline; text-underline:single;} @page Section1 {size:8.5in 11.0in; margin:1.0in 1.25in 1.0in 1.25in; mso-header-margin:.5in; mso-footer-margin:.5in; mso-paper-source:0;} div.Section1 {page:Section1;} -->

下面是从我的 MediaWiki上完整拷贝过来的,能够很好的工作:

 


== 介绍 ==

为了使 Apache ActiveMQ BPEL中作为一个有效的 J MS target, 需要做如下这些步骤:


这些步骤也适用于 J2EE container(OC4J):

=== Active MQ JMS 资源包 ===

 

ActiveMQ安装目录下取 lib/optional/activemq-rar-5.2.0.rar

这是 ActiveMQ资源适配包 适用于客户端和嵌入式 Server

 

个人认为如果只作为客户端是不需要包中的所有文件,只有作为嵌入式 Server才需要。

 

创建一个名叫 activemq-rar-5.2.0的目录,目录包含 activemq-rar-5.2.0.rar(此包是一个 jar包并不是一个 rar包)包解开后的所有文件。


==== 编辑 Server.xml ====



假设 oracle AS 安装在 D:/oracle/product/10.1.3.1/OracleAS_2目录


set SOA_HOME=D:/oracle/product/10.1.3.1/OracleAS_2

将下面这段 XML放入到 %SOA_HOME%/j2ee/”instanceName”/config/server.xml (请确保你的路径是正确的 )

<shared-library name="apache.jmsprovider.mq" version="5.2.0">
<code-source path="e:/activemq-rar-5.2.0/activation-1.1.jar"/>
<code-source path="e:/activemq-rar-5.2.0/activeio-core-3.1.0.jar"/>
<code-source path="e:/activemq-rar-5.2.0/activemq-core-5.2.0.jar"/>
<code-source path="e:/activemq-rar-5.2.0/activemq-ra-5.2.0.jar"/>
<code-source
path="e:/activemq-rar-5.2.0/backport-util-concurrent-2.1.jar"/>
<code-source path="e:/activemq-rar-5.2.0/camel-core-1.5.0.jar"/>
<code-source path="e:/activemq-rar-5.2.0/derby-10.1.3.1.jar"/>
<code-source
path="e:/activemq-rar-5.2.0/geronimo-j2ee-management_1.0_spec-1.0.jar"/>
<code-source path="e:/activemq-rar-5.2.0/jaxb-api-2.0.jar"/>
<code-source path="e:/activemq-rar-5.2.0/jaxb-impl-2.0.3.jar"/>
<code-source path="e:/activemq-rar-5.2.0/jsr173_api-1.0.jar"/>
<code-source path="e:/activemq-rar-5.2.0/log4j-1.2.14.jar"/>
<code-source path="e:/activemq-rar-5.2.0/xbean-spring-3.4.jar"/>
<import-shared-library name="apache.commons.logging"/>
</shared-library>

: “instanceName” BPEL运行的名字

==== 编辑 application.xml ====

 

然后编辑 %SOA_HOME%/j2ee/”instanceName”/config/ application.xml文件


<orion-application>
...[snip]...
<imported-shared-libraries>
<import-shared-library name="adf.oracle.domain"/>
</imported-shared-libraries>


改为

<orion-application>
...[snip]...
<imported-shared-libraries>
<import-shared-library name="adf.oracle.domain"/>
<import-shared-library name="apache.jmsprovider.mq"/>
</imported-shared-libraries>


==== 编辑 oc4j-ra.xml ====

此文件可以手工编辑,但是可能最好的方式是使用 OC4J的管理控制台在 ”default”实例下配置 JMS connection Factories. 此文件会被 OC4J重写,因此当 OC4J在运行时手工编辑它是浪费时间



Factory的设置选项请参考 [http://activemq.apache.org/configuring-version-5-transports.html ActiveMQ Transports],比如 keepAlive=true


如果 %SOA_HOME%/j2ee/oc4j_soa/application-deployments/default/JmsAdapter/oc4j-ra.xml已经存在,只需简单的将 connector-factory元素加入其中


activeMQ实例中获取 username/password( c:/apache-activemq-5.2.0conf/credentials.properties文件 )

应该注意,根据
[http://activemq.apache.org/resource-adapter-properties.html the ActiveMQ
Resource Adapter Documenation], BrokerURL 属性是可选的,但是为了平静的生活(以前似乎从没有过)我已经设置它指向我们运行的 ActiveMQ broker


===== Primary oc4j-ra.xml =====

注意 : BrokerURL 地址必须改变来反映正确的 broker.

 

编辑文件 :

%SOA_HOME%/j2ee/oc4j_soa/application-deployments/default/JmsAdapter/oc4j-ra.xml


<?xml version="1.0"?>
<oc4j-connector-factories
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ;

xsi:noNamespaceSchemaLocation="http://www.oracle.com/technology/oracleas/schema/oc4j-connector-factories-10_0.xsd" ;

schema-major-version="10" schema-minor-version="0" >
<imported-shared-libraries>
<import-shared-library name="oracle.bpel.common"/>
<import-shared-library name="oracle.xml"/>
<import-shared-library name="apache.jmsprovider.mq"/>
</imported-shared-libraries>
<connector-factory location="eis/activemq/Queue/Primary"
connector-name="Jms Adapter">
<config-property name="connectionFactoryLocation"

value="org.apache.activemq.ActiveMQConnectionFactory"/>
<config-property name="factoryProperties"

value="BrokerURL=tcp://???.???.???.???:61616?keepAlive=true"/>
<config-property name="acknowledgeMode"
value="AUTO_ACKNOWLEDGE"/>
<config-property name="isTopic" value="false"/>
<config-property name="isTransacted" value="true"/>
<config-property name="username" value="system"/>
<config-property name="password" value="manager"/>
<connection-pooling use="none">
</connection-pooling>
<security-config use="none">
</security-config>
</connector-factory>
<connector-factory location="eis/activemq/Topic/Primary/ATopic"
connector-name="Jms Adapter">
<config-property name="connectionFactoryLocation"

value="org.apache.activemq.ActiveMQConnectionFactory"/>
<config-property name="factoryProperties"

value="BrokerURL=tcp://???.???.???.???:61616?keepAlive=true"/>
<config-property name="acknowledgeMode"
value="AUTO_ACKNOWLEDGE"/>
<config-property name="isTopic" value="true"/>
<config-property name="isTransacted" value="true"/>
<config-property name="username" value="system"/>
<config-property name="password" value="manager"/>
<connection-pooling use="none">
</connection-pooling>
<security-config use="none">
</security-config>
</connector-factory>
</oc4j-connector-factories>



===== Secondary oc4j-ra.xml =====

注意 IP地址为 ???.???.???.???,因为它的值由 instance决定



编辑

%SOA_HOME%/j2ee/oc4j_soa/application-deployments/default/JmsAdapter/oc4j-ra.xml


<?xml version="1.0"?>
<oc4j-connector-factories
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ;

xsi:noNamespaceSchemaLocation="http://www.oracle.com/technology/oracleas/schema/oc4j-connector-factories-10_0.xsd" ;

schema-major-version="10" schema-minor-version="0" >
<imported-shared-libraries>
<import-shared-library name="oracle.bpel.common"/>
<import-shared-library name="oracle.xml"/>
<import-shared-library name="apache.jmsprovider.mq"/>
</imported-shared-libraries>
<connector-factory location="eis/activemq/Queue/Secondary"
connector-name="Jms Adapter">
<config-property name="connectionFactoryLocation"

value="org.apache.activemq.ActiveMQConnectionFactory"/>
<config-property name="factoryProperties"

value="BrokerURL=tcp://???.???.???.???:61616?keepAlive=true"/>
<config-property name="acknowledgeMode"
value="AUTO_ACKNOWLEDGE"/>
<config-property name="isTopic" value="false"/>
<config-property name="isTransacted" value="true"/>
<config-property name="username" value="system"/>
<config-property name="password" value="manager"/>
<connection-pooling use="none">
</connection-pooling>
<security-config use="none">
</security-config>
</connector-factory>
<connector-factory location="eis/activemq/Topic/Secondary/ATopic"
connector-name="Jms Adapter">
<config-property name="connectionFactoryLocation"

value="org.apache.activemq.ActiveMQConnectionFactory"/>
<config-property name="factoryProperties"

value="BrokerURL=tcp://???.???.???.???:61616?keepAlive=true"/>
<config-property name="acknowledgeMode"
value="AUTO_ACKNOWLEDGE"/>
<config-property name="isTopic" value="false"/>
<config-property name="isTransacted" value="true"/>
<config-property name="username" value="system"/>
<config-property name="password" value="manager"/>
<connection-pooling use="none">
</connection-pooling>
<security-config use="none">
</security-config>
</connector-factory>
</oc4j-connector-factories>


你可能感兴趣的:(Oracle BPEL ActiveMQ - Howto?)