Changing JCA Adapter properties using Configuration Plans

Changing JCA Adapter properties using Configuration Plans

While moving from one environment to another (DEV à TEST àPRD), you typically must modify several environment-specific values like –JDBC connection strings,

  • Host names of various servers,
  • Port details etc.

Composite.xml – Here you can replace following –

  • Any composite,
  • Service component,
  • Reference,
  • Service and
  • Binding properties.

Bindings – bindings.ws

  • Attribute values for bindings

WSDL

  • Schema Location attribute of an import in a WSDL file
  • Location attribute of an include in a WSDL fi

XSD

  • Schema Location attribute of an include, import, and redefine in an XSD file

JCA

  • Any properties in JCA adapter files

Policy

  • Modify and add policy references for the following
  • Service component
  • Service and reference binding components

Solution is to use configuration plan. Configuration plans enable you to modify these values using a single text (XML) file called a configuration plan. The configuration plan is created in either Oracle J-Developer or from the command line. During process deployment, the configuration plan is used to search the SOA project for values that must be replaced to adapt the project to the next target environment.

This blog we will check how to replace properties in JCA adapter files –

Use Case – Changing the Physical path for File Adapter from which it will read/write the contents.

While developing the Application; you design the adapter to have following path

  • /u01/fs/dev/filelocation

The .jca file in this case will look like

<connection-factory location=”eis/file/R12Fileadapter” adapterRef=””/>
<endpoint-interaction portType=”Write_ptt” operation=”Write”>
<interaction-spec className=”oracle.tip.adapter.file.outbound.FileInteractionSpec”>
<property name=”PhysicalDirectory” value=”/u01/fs/dev/filelocation “/>
<property name=”Append” value=”false”/>
<property name=”NumberMessages” value=”1″/>
</interaction-spec>
</endpoint-interaction>

  1. Generate a configuration for your composite
  2. Use the following code in configuration file to change the file location (Physical directory property of File Adapter ) –

    <wsdlAndSchema name=”SampleFileAdapter_file.jca”>
    <jca:property name=”PhysicalDirectory”><replace>/u01/fs/crp/filelocation</replace>       </jca:property>    </wsdlAndSchema> 

  3. You will get the Physical Directory path replaced to – u01/fs/crp/filelocation

Similarly; you can replace the Topic/Queue name for the JMS adapter using following

<!– replace jms destination for jms adapter –>
<wsdlAndSchema name=”JMSAdapter_jms.jca”>
<jca:property name=”DestinationName”>

<replace>jms/CRPTopic</replace>
</jca:property>
</wsdlAndSchema>

Advertisements

2 comments

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s