Kavin's SOA Blog

June 7, 2009

FTP Adapter connection Pooling


In order to setup connection pooling on a connection factory with “none” connection pool we will need to modify oc4j-ra.xml of the FTP adapter. We need to make sure that “keepConnections” parameter is set to true

<config-property name="keepConnections" value="true"/>

and we need to create connection-pool settings. Please note that you might find an empty node like

<connection-pooling use="none">
        </connection-pooling>

and you need to replace it with

<connection-pooling use="private"> 
            <property name="waitTimeout" value="300" />
            <property name="scheme" value="fixed_wait" />
            <property name="maxConnections" value="50" />
            <property name="inactivity-timeout-check" value="all" />
            <property name="minConnections" value="5" />
            <property name="inactivity-timeout" value="50" />
</connection-pooling>

Or create a shared connection pool say “ftpPool” as shown below

<connection-pool name="ftpPool">
      <property name="waitTimeout" value="300" />
       <property name="scheme" value="fixed_wait" />
       <property name="maxConnections" value="50" />
       <property name="inactivity-timeout-check" value="all" />
       <property name="minConnections" value="5" />
       <property name="inactivity-timeout" value="50" />
</connection-pool>

and then modify connection-pooling section as

<connection-pooling use="shared">
      <use-connection-pool>ftpPool</use-connection-pool>
</connection-pooling>’

It’s a good practice to configure connection pool while configuring connection factory for the first time. At that time it asks whether to use “private” or “shared” or “none” connection pool. If you make this selection during that time, you won’t be required to modify configuration files manually (which I discourage most).

3 Comments »

  1. Hello Kavin,
    the article was of extreme help.
    Thanks a lot. I have some other query if you could help. So, here is the situation –
    I have a bpel process which reads data (XML files) from an MQ.
    The issue is – if there are 30 XML files written on MQ at same instance of time – bple forks 30 parallel instances of that process to handle those XMLs. I want to modify the properties at process level (not domain level) that the process starts only 1 instance at a time and when that instance fails or completes, then only fork the next instance i.e. only 1 instance at a time.
    Will you be able to put some light on this. I would really appreciate it. thanks

    Comment by Sukhmeet — June 25, 2009 @ 10:21 am

    • Can you please provide more details around flow. Also if you can help me understand what do you mean by xml files? Is it DOM or file adapter is somewhere involved?

      Comment by Kavin — July 5, 2009 @ 10:02 am

      • Here is what exactly is happening in the bpel process :
        A third party system generates XML Files in DOM Structure
        and posts this data on the MQ (File Adapter not involved).
        The bpel process has an MQ Adapter constantly polling on this queue
        and also schema for the expected input is defined for the MQ Adapter – So,
        when the data is posted on the MQ, bpel process gets initiated, it picks u’
        the data (which is a file of format as pasted below), extracts key fields, does some db operations and transformations and finally posts the updated transformd message on a diffewrent MQ. My question is – if multiple XML datasets are written at the same time on the input MQ – it initiates multiple parallel bpel instances – I want to avoid that. I want only 1 bpel instance at a time, once it is over. .then only pickup next message from the MQ.
        Hope this makes the issues more clear. Below is a sample xml message posted on the MQ :

        2009-06-24T15:41:15-04:00
        2009-06-24 00:00

        urn:epcglobal:btt:BOL
        TSV-10001132

        urn:TEVA:secondaryShipment:IR
        10001132

        urn:TEVA:shipment:XR
        10001132

        7777
        2011-02-28
        357844009011
        urn:epc:id:sgln:1100001.00360.0
        urn:epc:id:sgln:1100001.00364.0

        urn:epc:id:sscc:1100093.1000007156
        7
        250
        6000

        urn:epc:id:sgtin:035784.3400901.100000222806
        3
        24
        24

        urn:epc:id:sgtin:035784.1400901.100001040343

        urn:epc:id:sgtin:035784.1400901.100001040344

        1
        6000

        Comment by Sukhmeet — July 6, 2009 @ 10:58 am


RSS feed for comments on this post. TrackBack URI

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 )

Connecting to %s

Theme: Shocking Blue Green. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.