Wednesday, November 16, 2011

OSB and rejectedMessageHandlers in JCA File Adapter

I am completing a previous post on the same topic.

By default, the JCA File Adapter will write bad files into $DOMAIN_HOME/jca/Read/rejectedMessages, renaming them to a filename like:

INVALID_MSG_154330703_Read_20111109_103658_0898.dat


If you specify in your JCA file the property PhysicalErrorArchiveDirectory=/path/to/my/errorDirectory, the bad files will be written here and not to the $DOMAIN_HOME/jca/Read/rejectedMessages directory.



To retry a "failed" file (only those who are not directly rejected by the Adapter, but for instance those who fail validation in the Proxy Service), you can specify in the JCA Transport Configuration of the Proxy Service:

jca.retry.count = "3"
jca.retry.interval = "40"


If you want to change the destination, there is a property rejectedMessageHandlers to be set (see oracle.tip.adapter.file. package). In SOA Suite you would set it in bpel.xml, in OSB it's a bit tricky:

edit the JCA Proxy Service, JCA Transport Configuration, Dynamic EndPoint Properties, add "rejectedMessageHandlers" with value "file://path/to/your/dir"


If you fail format, you will get this message:

Error JCA_FRAMEWORK_AND_ADAPTER BEA-000000 Unrecognized Rejection handler
Unrecognized Rejection handler
The Rejection handler C:/acme/po/rejected is not recognized.
Please use on of the existing Rejection handlers: file://, queue://, bpel:// or wsif://


so your options are a AQ queue (queue refers to AQ, not to JMS!), a BPEL process, a Web Service.



Here you have a series of possible formats for the destination:

http://download.oracle.com/docs/cd/B14099_19/integrate.1012/b14058/life_cycle.htm

it says that you can send the file to a JMS queue or a DB, not necessarily to a Directory... I haven't tested this.


Here the Oracle Integration File Adapter Datasheet , but it doesn't say much about error handler.

2 comments:

Yuan Meng said...

I am trying to understand how the dynamic endpoints properties work.

The console allows me to enter any name/value pair like "foo/bar". But how do i pick parameter "foo" inside my proxy?

thanks.

Pierluigi Vernetto said...

if I understand your question... those dynamic activation properties are set on the JCA adapter, so you are not able to get their value inside OSB.... I might be wrong though....