Tuesday, December 27, 2011

Disabling debatching in Oracle JCA File Adapter

If in the JCA file adapter file you specify PublishSize=1, the file translator will
consider that every LINE (up to EOL) in your file is a MESSAGE.

Even if the Root Element of my message is a complexType made by a sequence of subtypes, the NXSDTranslator will dispatch a message to OSB PER EACH LINE, and the message will contain ONLY THE SUBTYPE, not the Root Element.

Even if you specify uniqueMessageSeparator="someweirdstring", it will keep doing the same trick.

In the log, you see:

jca.file.BatchIndex=1 (2, 3... up to the number of lines in the file)

(all the messages in the same Batch (=file) have the same jca.file.Batch property)

The only way to avoid this DEBATCHING (split a message in multiple submessages) is to explicitly set the PublishSize to a BLANK value (default is 1).

see doc here

PublishSize: This property indicates whether the file contains multiple messages and how many messages to publish to the BPEL process at a time. The parameter is of type int and is not mandatory. The default value is 1.

For example, if a certain file has 11 records and this parameter is set to 2, then the file will be processed 2 records at a time and the final record will be processed in the sixth iteration.

Pay attention to the JCA file, the PublishSize can be nested there.
Look in the nXSD file, there can be a nxsd:publishSize clause, set it to "" (an empty string)

In the logs, per each batch element you will see a separate invocation to the translator:

Invoking inbound translation for : PuO20111212_164122_1640.txt
InboundTranslatorDelegate:: Ordinary DOM Created
Completed inbound translation for : PuO20111212_164122_1640.txt

Classes to monitor:

(method xlator.translateFromNative(in, res, xlationCtx))

(ProcessorDelegate.process(FileInfo) and does a doXlate)


see also http://javatoolsforweblogic.googlecode.com/svn/trunk/nxsd/Translate.java for how to invoke the NXSDTranslatorImpl from CLI

No comments: