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!

Sunday, November 25, 2012

The Importance of Guiding Principles

Whether speaking about enterprise architecture or design within a project, guiding principles are paramount to keeping your focus on what's important to guiding decisions.  Some examples of these would be software re-use over creation, and simplicity over flexibility to make things more maintainable.  It's important to establish what your guiding principles are prior to having multiple teams making decisions either based on uniform principles or using their own discretion.

This importance to me was illustrated clearly with a little-known rule in the NFL.  As a big NFL fan, you would expect with their use of instant replay and reviewing all scoring plays and turnovers, their guiding principle would be the correctness of ruling plays that directly affect the outcome of the game.  However, as reinforced by an ill-fated decision made recently by the coach of the Detroit, if you throw a challenge flag on one of these plays, it renders the play un-reviewable and your team gets penalized 15 yards.  I'm guessing the purpose of the rule is to ensure coaches don't try to become too demonstrative against the officials, but the end result is not getting the play called correctly in some cases.

Had they determined a guiding principle was to ensure plays are called accurately (e.g. accuracy over punishment), this rule would never have been ratified, which has now resulted in a situation the possibly changed the course of a game for a team.  Having a handful of these guiding principles, a small enough number that allows remembering them clearly across teams, will ensure your organization is uniformly making decisions that can impact projects going forward.

Friday, November 2, 2012

Using Spring Portlet MVC 3.0 in Oracle Webcenter Portal (Spaces)

You may find yourself in the same quandary as me.  I want to stand up a portal quickly at an Oracle shop(client), so Webcenter Portal is currently the defacto choice as the solution, and in this case Spaces has been chosen for its ease of setup and collaboration (including built-in integration with BPM).  However, the client is not an ADF development shop, but is familiar with another web development framework like Spring MVC. Since the only way to expose portlets in Webcenter Portal 11g is using WSRP (Web Services for Remote Portlets), it shouldn't really matter what framework you use to develop the portlet as long as it is deployed using WSRP you can register it with Webcenter Portal and use it as you desire.  Note that there are plenty of more informed blogs and websites that provide the argument whether to use Webcenter Portal: Framework vs. Webcenter Portal: Spaces, as well as whether to extend your portal using either WSRP Portlets or ADF task flows.  I will defer to those sites on providing you those decisions to make, but if you have selected WSRP Portlets, here's how you can use your favorite IDE to develop them and deploy them properly to Webcenter Portal: Spaces.  Doing the same with Framework would entail similar steps, you would need to create a WSRP connection to the portlet producer from within JDeveloper and add the portlet to your page through JDeveloper instead of the Spaces web application. As a quick overview, I tried determining how to WSRP enable my portlet for some time before I stumbled onto the documentation within Oracle's 11g docs describing how this can be done via script as a pre-deployment step for any JSR-286 compliant portlet.  This instruction is within the administrator's guide and not the developer's guide, which made me realize their intention of separation of roles for deployment.  So I will document how to get a portlet into Webcenter Portal in several steps based on role to be consistent with this intention:
  1. Developer creates JSR-168/286 compliant portlet using their IDE and whatever framework they want
  2. Developer packages portlet up as EAR file for deployment
  3. Deployer updates EAR file using provided script to expose JSR-286 portlet as WSRP Portlet Producer EAR, and adds weblogic.xml to embedded WAR to specify shared library to include (otherwise deployment FAILS)
  4. Deployer deploys WSRP .ear to Webcenter Portlet Producers server.
  5. Webcenter Portal: Spaces Administrator registers WSRP v2 portlet producer in Webcenter Portlet: Spaces using WSDL URL.
  6. Webcenter Portal: Spaces page designer adds portlet to desired page and sets any default configurations.