Search My Ramblings

Wednesday, August 21, 2013

Implementing a RESTful intercepting filter pattern within Oracle Service Bus

With a RESTful design for web services, you model your primary objects using a URI hierarchy, and leverage underlying HTTP (in most cases) methods to perform CRUD operations on these objects such as getting them, deleting them, and creating/updating them.  And while I am not espousing that HTTP methods map cleanly to CRUD operations, they do conceptually make it easier to speak about various CRUD operations on objects.  A common practice is to group objects under a functional umbrella URL hierarchy, which makes the object relationships more obvious and allows versioning across a group of RESTful services that share common functions.  However, in my experience trying to map this hierarchy cleanly in a service bus isn't always the easiest or most maintainable solution.

Wednesday, June 19, 2013

What does loose coupling really mean?

Specifically with integration, I commonly see references or hear the expression loose coupling.  Often the writer speaks about virtualization or abstracting the implementation of the services with something like an enterprise service bus.  However, that alone is not enough to capture the essence of loose coupling to me.

So what is loose coupling then?  Well, in integration I believe it means that 2 or more communicating systems do not communicate directly with each other (no direct binding to addresses, i.e. Enterprise Service Bus) and they use some intermediary component(s) that functionally represents the intention of the integration in both network protocol and data ontology.  That is, client systems communicate with a middle component or service that represents an enterprise proxy for the implementation of the actual service, and uses a canonical data format specific to that industry and purpose.  

For example, if developing an integration solution for human resource management, one might expect the canonical data format for the enterprise services tier would use an industry standard where possible, like HR-XML, to represent the data objects, attributes and relationships.  The services implementing these enterprise operations may be tied to a specific ERP implementation or written in .NET using a custom, scaled down XML format, but at an enterprise level the services utilize standards and separate the client from the implementation in both protocol, location and data format.


Agile Adoption Words of Wisdom

This is an excellent article about organizational change required to truly adopt an Agile methodology.  It isn't simply a development team methodology or toolset, but a organizational decision to change many aspects of how business gets done.

TechWell | Agile Is Not for Everyone (and That's OK)

Friday, May 31, 2013

Oracle SOA Suite 11g Composite Fails to Load After Restart

We had an issue at one site where a specific AQ-adapter initiated SOA composite was constantly failing to load properly, leaving the composite in an indeterminate state, where it couldn't be undeployed or redeployed.  This was perplexing since there were other composites subscribing to other AQ queues that were not experiencing this startup failure.  At first this was just chalked up to a poorly installed instance of SOA Suite, but after further examination the cause became crystal clear.

When I compared the source code of the failing process to other similar ones that weren't failing on server restarts, I could tell that the issue was related to how this particular composite was calling another SOA composite for error handling (which all of the SOA composites call).  In the failing composite, it was referencing the WSDL using a URL retrieved from the Enterprise Manager console for that composite, e.g. "http://{server}:{port}/soa-infra/services/{partition}/{compositeName}/{serviceName}?WSDL".  By referencing the WSDL this way, it requires the composite be running and loaded prior to this composite requesting it, since it's requesting the WSDL from the composite itself, and not just referring to the WSDL as a static document.  There is no determinate way to predict which order SOA composites will be loaded by the infrastructure, so doing it this was typically caused issues with the composite to where it would need to be recompiled as a different version and deployed again each time the server is restarted.

To solve this, there is a preferred way and an alternate way of the above solution.  The preferred way is to store common artifacts in the Metadata Store and reference them from your composites where possible, so utility composites like an error handler's WSDL would definitely fall in this category.  For this simple project, it was determined to instead reference the WSDL as a static document living in the infrastructure independent of the composite being loaded.  To do this, we changed the WSDL URL being referenced to http://{server}:{port}/soa-infra/services/{partition}/{compositeName}/{WSDLFilename}wsdl in the composite.xml in the import section, as well as the reference/ui:wsdlLocation attribute that references the service.  However, the previous format for the URL was left in the section in the same .  

To be clear, using MDS to store these common artifacts is a better solution, but for a down and dirty quick solution this is an alternate option.

Thursday, April 11, 2013

Oracle Fusion Middleware-Inserting large XML into XMLType columns

A couple of years ago I ran into this issue with Oracle SOA Suite 10g, and posted on this blog how to resolve it.  Which is great since I used basically the same solution in 11g and it works there as well, only it doesn't require any server changes at all.

If you're trying to save a large XML payload into an XMLType column type in an Oracle database table from a DbAdapter partner link (JCA Adapter in OSB), and receive the error:

ORA-01461: can bind a LONG value only for insert into a LONG column

 You should only need to edit the mappings.xml for that partner link, navigate to the column that is an XMLType in the database, and change the xsi:type from "direct-mapping" to "direct-xml-type-mapping".

Then recompile your SOA composite (or update the OSB mappings file) and redeploy and test.

It should now support larger-size XML payloads!