You are on page 1of 5

Configure Adapter Threads in Oracle SOA 11G

In in earlier posting, I mentioned you can configure multiple threads of inbound (polling) adapters of
Oracle SOA. However, the ways to configure multiple threads vary between adapters and product
versions, and the information scatter cross multiple documentations.
Hence it is worth to consolidate them here. Below are how to configure Adapter threads in Oracle SOA

1. JMS Adapter
Property Name: adapter.jms.receive.threads
Configuration File: adapter binding at composite.xml
<service name="dequeue" ui:wsdlLocation="dequeue.wsdl">
<binding.jca config="dequeue_jms.jca">
<property name="adapter.jms.receive.threads" type="xs:string"

2. AQ Adapter
Property Name:
Configuration file: composite.xml
<service name="dequeue" ui:wsdlLocation="dequeue.wsdl">
<binding.jca config="dequeue_aq.jca">
<property name="" type="xs:string"

3. MQ Adapter
Property Name: InboundThreadCount
Configuration File: *.jca file

4. Database Adapter
It takes multiple steps to configure database adapter threads.
Step 1: Configure distributed polling. The query in the polling database adapter needs to be a distributed
polling in order to avoid data duplication. Please follow the two best practices in the documentation to
establish the right kind of distributed polling.
Step 2. Set activationInstances as adapter binding property at composite.xml (SOA 11G) to achieve
multiple threads in database adapter.
Alternatively, you can set NumberOfThreads in the jca file (SOA onward). Technically,
activationInstances and NumberOfThreads properties work differently, in such that NumberOfThreads
works in the scope of per activation agent. Before SOA, NumberOfThreads is NOT supported in
clustered environment or when activationInstances>1. At SOA onward, you can use either
activationInstances or NumberOfThreads properties to achieve the multi-threading effect. But if for some
reason you set both, the total concurrent threads will be activationInstances x NumberOfThreads. For
example, if you activationInstances=2, and NumberOfThreads=5, that means there are are 5 threads
running within each activation instance.
Step 3. Tune MaxTransactionSize and MaxRaiseSize to throttle the incoming messages along side with
activationAgents/NumberOfThreads. These two properties are configured either through the DbAdapter
wizard at JDeveloper, or manually directly at the *.jca file.

<endpoint-activation portType="poll_ptt" operation="receive">

<activation-spec className="oracle.tip.adapter.db.DBActivationSpec">
<property name="PollingStrategy" value="LogicalDeletePollingStrategy"/>
<property name="MaxRaiseSize" value="5"/>
<property name="MaxTransactionSize" value="10"/>
5. File/FTP Adapter
File/FTP adapter's threading model is a bit complex. In essence, there is a separation poller thread and
processor thread, except in the "Single Threaded Model" (comparatively, JMS/AQ adapters always use
the same thread to poll and process). There is always only one poller thread, while there could be multiple
processor threads. Please go through the documentation thoroughly so that you can choose a threading
model appropriate to your application.

Step 1: Choose a threading model

Default Threading Model

Modified Threading Model 1: Single Threaded Model

Modified Threading Model 2: Partitioned Threaded Model

Step 2: Configure threads depending on the threading model you choose

If you choose the Default Threading Model, you can set the thread count of global processor through
the oracle.tip.adapter.file.numProcessorThreads property at the file. This is
read from the classpath. So you could, for example, copy it to some directory under ORACLE_HOME and
then reference it in the WLS classpath in However, the Partition Threading Model is
recommended over the Default Threading Model (see below) if you do have a need to define processor
If you choose the Single Threaded Model, set the SingleThreadModel=true at the *.jca file. And as the
name applies, you don't worry about any thread counts.
<property name="SingleThreadModel" value="true"/>
If you choose the Partitioned Threaded Model, you can set the thread count for processor threads per
adapter at the *.jca file:
<property name="ThreadCount" value="4"/>

Please note the value of the ThreadCount is closely related to the kind of threading model you choose:
If the ThreadCount property is set to 0, then the threading behavior is like that of the single
threaded model.
If the ThreadCount property is set to -1, then the global thread pool is used, as in the default
threading model.

The maximum value for the ThreadCount property is 40.

Posted by Francis Ip at 9:48 AM
Email ThisBlogThis!Share to TwitterShare to Facebook

nitinaggarwalFebruary 21, 2012 at 3:31 AM
Very nice post
AnonymousApril 25, 2012 at 5:50 AM
Does SOA 11g now contain an e-mail adapter? I know OESB didn't in 10g but was just wondering if
mediator now does. I need to extract incoming e-mail attachments for processing through SOA and
was wondering if I can do this without installing OSB.

Francis IpMay 29, 2012 at 9:33 AM
This comment has been removed by the author.

Francis IpMay 29, 2012 at 9:34 AM
There is one available now but only in preview mode. Search around and you will
find some postings about it.

Swapnil Subhash KharwadkarMay 5, 2012 at 4:56 AM





how will it be different if i set NumberOfThreads=1 and activeInstances=1 ?


Francis IpMay 24, 2012 at 11:47 AM
The detailed explanation is in the documentation quoted above. Basically
SingleThreadMode=true means "The single threaded model is a modified threaded
model that enables the poller to assume the role of a processor". In other words,
the poller thread and the processor thread are the same thread.
For file adapter, do NOT use activationInstance > 1. Otherwise you will have data
duplications as the multiple activation instances of inbound file adapter will not

Francis IpMay 24, 2012 at 11:47 AM
And NumberOfThreads do NOT apply for file adapter.

AnonymousMay 14, 2012 at 10:33 PM
very helpful
Gaurav SinghJune 6, 2012 at 7:06 AM
Is there any tutorial which describes how to setup Oracle JCA Adapter for JMS in a clustered
Francis IpJune 20, 2012 at 11:59 AM