Databases Reference
In-Depth Information
Throttling the file and FTP adapter
The file and FTP adapters can consume a lot of resources when processing large
files (thousands of records) because they keep sending messages with batches of
records until the file is processed, while not waiting for the records to be processed.
This behavior can be altered by forcing them to wait until a message is processed
before sending another message. This is done by making the following changes to
the WSDL generated by the wizard. This changes the one-way read operation into a
two-way read operation that will not complete until a reply is generated by our code
in BPEL or the Service Bus.
Creating a dummy message type
Add a new message definition to the WSDL like the one in the following
code snippet:
<messagename="Dummy_msg">
<partxmlns:xsd="http://www.w3.org/2001/XMLSchema"
name="Dummy"type="xsd:string"/>
</message>
Adding an output message to the read operation
In the <portType> , add an <output> element to the read <operation> element.
<portTypename="Read_ptt">
<operationname="Read">
<inputmessage="tns:PayrollList_msg"/>
<outputmessage="tns:Dummy_msg"/>
</operation>
</portType>
In the <jca:operation> element, add an empty <output/> element.
Using the modified interface
The adapter will now have a two way interface and will need to receive a reply to
a message before it sends the next batch of records, thus throttling the throughput.
Note that no data needs to be sent in the reply message. This will limit the number
of active operations to the number of threads assigned to the file adapter.
 
Search WWH ::




Custom Search