You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by lyall <Ly...@The-Pearces.com> on 2009/05/22 02:20:05 UTC
Re: Oracle BPEL <-> ActiveMQ - Howto?
Just for completeness, here is a complete copy of my instructions in my
MediaWiki page, which works.
== Introduction ==
In order to have Apache ActiveMQ as a valid JMS target, in BPEL, the
following steps need to be done.
These steps also apply to any J2EE container that wishes to use ActiveMQ.
=== Active MQ JMS Resource Archive ===
Take the Resource Adapter archive from an ActiveMQ installation
<tt>lib\optional\activemq-rar-5.2.0.rar</tt>
This is the activeMQ resource adapter archive - for client as well as
embedded server.
Personally, I don't think we need to include all this if we just want a
client, only if we want an embedded server.
Still, instructions are instructions...
Create a directory on the Applications disk (as opposed to data) called
<tt>activemq-rar-5.2.0\</tt> which contains the extracted content of the
<tt>activemq-rar-5.2.0.rar</tt> archive (and contrary to file suffix, it is
a jar archive, you don't need winrar to unpack it).
=== SOA Changes ===
==== Server.xml ====
For the purposes of this page, mileage may vary for you.
<tt>SOA_HOME=D:\oracle\product\10.1.3.1\OracleAS_2</tt>
Placed the following XML segment ('''Make sure you have the ''correct''
pathname! e:\ may not be valid for you!''')
{{File|${SOA_HOME}\j2ee\'''instanceName'''\config\server.xml|<pre>
<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>
</pre>}}
into <tt>${SOA_HOME}\j2ee\'''instanceName'''\config\server.xml</tt> where
'''instanceName''' is the instance name in which BPEL is running, by
default, '''oc4j_soa'''.
==== application.xml ====
I then edited
<tt>${SOA_HOME}\j2ee\'''oc4j_soa'''\config\application.xml</tt>
changing
{{File|'''Before'''
${SOA_HOME}\j2ee\'''oc4j_soa'''\config\application.xml|<pre>
<orion-application>
...[snip]...
<imported-shared-libraries>
<import-shared-library name="adf.oracle.domain"/>
</imported-shared-libraries>
</pre>}}
to
{{File|'''After'''
${SOA_HOME}\j2ee\'''oc4j_soa'''\config\application.xml|<pre>
<orion-application>
...[snip]...
<imported-shared-libraries>
<import-shared-library name="adf.oracle.domain"/>
<import-shared-library name="apache.jmsprovider.mq"/>
</imported-shared-libraries>
</pre>}}
==== oc4j-ra.xml ====
This file can be manually edited, but probably the best way is to use the
OC4J Administration console (http://soabox/em) to configure the JMS
connection Factories in the 'default' OC4J instance. This file is rewritten
by OC4J so editing it whilst the instance is running is probably a waste of
time.
Refer to [http://activemq.apache.org/configuring-version-5-transports.html
ActiveMQ Transports] for configuration options for the Factory settings,
such as <tt>keepAlive=true</tt>.
If it already exists, simply add the connector-factory element to the
already existing list.
The file
<tt>${SOA_HOME}\j2ee\oc4j_soa\application-deployments\default\JmsAdapter/oc4j-ra.xml</tt>.
I obtained the username/passwords from an activeMQ instance
<tt>c:\apache-activemq-5.2.0conf\credentials.properties</tt> file, on the
[[VM ActiveMQ]]
It should be noted, that according to
[http://activemq.apache.org/resource-adapter-properties.html the ActiveMQ
Resource Adapter Documenation], the BrokerURL property is optional, but I
have coded it to point to our running ActiveMQ broker, for the sake of a
quiet life (which I never seem to have).
===== Primary oc4j-ra.xml =====
NOTE: The BrokerURL address must be changed to reflect the appropriate
broker for the SOA Instance.
{{File|'''Primary'''
${SOA_HOME}\j2ee\oc4j_soa\application-deployments\default\JmsAdapter/oc4j-ra.xml|<pre>
<?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>
</pre>}}
===== Secondary oc4j-ra.xml =====
'''Note the IP address is ???.???.???.??? as it varies depending on which
instance'''
{{File|'''Secondary'''
${SOA_HOME}\j2ee\oc4j_soa\application-deployments\default\JmsAdapter/oc4j-ra.xml|<pre>
<?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>
</pre>}}
--
View this message in context: http://www.nabble.com/Oracle-BPEL-%3C-%3E-ActiveMQ---Howto--tp22449017p23662539.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.