Tuesday, May 13, 2008

Adapter Configuration for seamless migration to different environments

Adapter Configuration for seamless migration to different environments

A general issue with the adapters is how to configure their properties for different environments at deployment time such as,

· File Adapters: [Logical/Physical]Directory Location
· DBAdapters: Mapping File
· AQAdapters: Queue Name

The list goes on, but the multi-environment configuration details works the same way. The important thing to note is that these properties are defined in the [adapter_service_name].wsdl under the //binding/jca:operation Xpath. The Outbound Adapter configuration uses the Interaction Specification and Inbound Adapter uses the Activation Specification and the way they need to be configured varies too,

A) Outbound Adapters: I will take an example of Outbound File Adapter to explain the modifications to the BPEL project,

1. [adapter_service_name].wsdl

<binding name="Write_binding" type="tns:Write_ptt">
<jca:binding />
<operation name="Write">
<jca:operation
LogicalDirectory="OutputDirectory"
InteractionSpec="oracle.tip.adapter.file.outbound.FileInteractionSpec"
FileNamingConvention="data_%yyyyMMdd%.xml"
NumberMessages="1"
OpaqueSchema="false" >
</jca:operation>
<input>
<jca:header message="hdr:OutboundHeader_msg" part="outboundHeader"/>
</input>
</operation>
</binding>

2. bpel.xml

<partnerLinkBinding name="FileAdpater">
<property name="OutputDirectory">D:\temp</property>
</partnerLinkBinding>

The Adapter configuration will use the value of OutputDirectory in the deployment descriptor and the value in the bpel.xml can be changed using the custom ant task.

B) Inbound Adapters: I will take an example of Inbound File Adapter to explain the modifications to the BPEL project,

1. [adapter_service_name].wsdl

<binding name="Read_binding" type="tns:Read_ptt">
<pc:inbound_binding />
<operation name="Read">
<jca:operation
LogicalDirectory="InputDirectory"
ActivationSpec="oracle.tip.adapter.file.inbound.FileActivationSpec"
DeleteFile="true"
IncludeFiles=".*\.xml"
PollingFrequency="60"
MinimumAge="0"
OpaqueSchema="false" >
</jca:operation>
<input>
<jca:header message="hdr:InboundHeader_msg" part="inboundHeader"/>
</input>
</operation>
</binding>

2. bpel.xml

<partnerLinkBindings>
<partnerLinkBinding name="InboundFileAdapter">
<property name="wsdlLocation">InboundFileAdapter.wsdl</property>
</partnerLinkBinding>
</partnerLinkBindings>
<activationAgents>
<activationAgent className="oracle.tip.adapter.fw.agent.jca.JCAActivationAgent" partnerLink="InboundFileAdapter">
<property name="InputDirectory">C:\temp</property>
<property name="portType">Read_ptt</property>
</activationAgent>
</activationAgents>

The Adapter configuration will use the value of InputDirectory in the deployment descriptor (bpel.xml) .For different environment this value can be modified using the using the custom ant task.

No comments:

Search This Blog