Wednesday, May 06, 2009

Plain Vanilla BPEL #2 (Adapters)

I noted some of the day1 bpel issues here, there are also some interesting gotchas on the adapter side. Adapters are a big area covering various issues over file/ftp, database/aq adapters, JMS and Apps Adapters.

ftp adapter - I had used an outbound ftp adapter w/o much issues, inbound ftp adapters in cluster environments have to be made singleton, refer to this

db adapter - db adapter one can do 4 types of things 1) call stored proc 2)execute Insert/Update, Delete, Select operations 3) poll database table 4) execute custom sql

While using select operation parameters can be passed using #parametername to the generated SQL. While using custom sql XSD is automatically generated as per the SQL.

aq adapter - aqs can be created of type multi-consumers, in such cases consumer name has to be used while creating adapters to send/receive messages.

I will add more as we go along.

update on May/28/09
In the mean time a lot of adapter issues have been found, so that needs a mention here. Firstly FileAdapter/FtpAdapter, we had some good challenge around getting append to work for FtpAdapter. The format of the file was based on nxsd. We tried a bunch of things around making sure the transformation is correct to nsxd, making sure ftpadapter configuration (messagecount=1, unique filename, opaque schema) are correct, but append just didn’t work. After further debugging it turned out the ftp server didn’t support append in that particular directory. So a good learning was to test the ftp server configurations by doing simple ftp operations like put/get/app etc. from the prompt and then test from the ftpadapter.

One other learning was the schema used in ftp adpater can be opaque or xsd. If it’s opaque, we need to send a base64 encoded string. And the following is code snippet to do that, make sure your MXL is converted to string by using getContentAsString()
String inString = (String)getVariableData("XMLString");
sun.misc.BASE64Encoder encoder = new sun.misc.BASE64Encoder();
String encodedStr=encoder.encode(inString.getBytes())

JMSAdpater, We had to connect weblogic JMSAdapter from OC4J and this blog had all that we need. And it worked. A good learning was we were using weblogic.jms.Connectionfactory which is a default connectionfactory, so we don’t see it in the admin console, so making the right configurations on oc4j-ra.xml and putting the right entries while creating the JMS Adapter wizard are the key points.

an erlier post on aq-jms on Weblogic.

Another day#1 issue is JCA port configuration in the adapter wsdl configuration is to use mcf (connection details as created by Jdev) or the JNDI url created in admin console. If you have both how will it behave? best thing we found is to use the one in server and not use mcf at all.


Update on Aug/19/09
DBAdapter if the mapping order is different in toplink mapping and XSLT, it throws cannot insert null error, the solution to that was to use detectomission to false in the dbadpater wsdl.

On another note, its possible to change the JNDI for outbound adapters, by using similar mechanism as per dynamic partner links, for dynamic partnerlinks here is a link.

On DBAdaper pooling, there is a distributedpolling setting for it to work in clusters.

FTPAdapter, one catch is the directory specified is relative to the user default directly after login.


update 1/7/2010
While creating nxsd for a file with header/detail structure, the file had lot of field length element separated by space, and using the wizard the lengths had to be specified, I noticed while using the ruler, you should not put the last position which is the length of the line or else it throws error. good reference here

No comments: