Friday, September 8, 2017

Exposing Servlet- and JAX-RS-based WebSphere Liberty REST APIs with Swagger

An amazing article Developing a Swagger-enabled REST API using WebSphere Developer Tools demonstrates how to expose a usual servlet as a REST API using a new feature of WebSphere Liberty called apiDiscovery-1.0.


I've rewritten a bit the code of the servlet taking the JSR 353/JSON-P API into account and eliminated all WebSphere-related code, so the demonstration project can be built using Apache Maven: just put the 'javax.json:javax.json-api:jar' dependency into your pom.xml.



Including a swagger.json or swagger.yaml file inside the corresponding META-INF folder is the easiest way to expose the documentation of web modules, but not the only one. If the web application does not provide a swagger.json or swagger.yaml file and the application contains JAX-RS annotated resources, the Swagger document would be automatically generated. As mentioned in the official documentation, the server configuration must have the apiDiscovery-1.0 feature and the jaxrs-1.1 or jaxrs-2.0 feature; for example:



The product scans all classes in the web application for JAX-RS and Swagger annotations, searching for classes with @Path, @Api, and @SwaggerDefinition annotations. The apiDiscovery-1.0 feature automatically generates a corresponding Swagger document and makes it available at the following URIs: http://host:port/context-root/swagger.json and http://host:port/context-root/swagger.yaml.

For example, if the following JAX-RS resource is deployed on the server:

Thursday, August 31, 2017

Oracle SOA Suite Performance Monitoring

Oracle Enterprise Manager Fusion Middleware Control Console (EM) - ensures runtime governance through composite application modelling and monitoring as well as comprehensive Service and infrastructure management functionality to help organizations maximize the return on investment. Let's consider capabilities for performance management provided by this instrument.

Monitoring performance of the Oracle SOA Suite runtime


The Request Processing tab uses three grid views to present performance information. The tab is available under the Monitoring -> Request Processing item of the context menu SOA -> soa-infra. The displayed information is layered by:

  • service engine (BPEL, BPMN, Mediator, Human Workflow, Business Rule, Spring):
    • average request processing time - synchronous
    • average request processing time - asynchronous
    • active request count
    • processed requst count
    • fault count
  • the summary about service infrastructure:
    • average request processing time - synchronous
    • average request processing time - asynchronous
    • active request count
    • processed request count
    • fault count
  • binding components:
    • web-service (WS) inbound
    • web-service (WS) outbound
    • Java EE Connector Architecture (J2CA) inbound
    • Java EE Connector Architecture (J2CA) outbound
    The following metrics are available:
    • average request processing time
    • processed request count
    • error count


Wednesday, August 23, 2017

Oracle WebLogic Cluster Causes Network Storm When a Problem Happens

Not every system administrator is aware of such WebLogic Server capability as Message Forwarding to Domain Logs. In addition to writing messages to the server log file, each server instance forwards a subset of its messages to a domain-wide log file. This domain-wide log file certainly helps to the system administrator understand the situation on a large domain, for instance, when several dozen servers belong to the domain, it is very helpful having all server logs sit in one place. But the convenience comes at a price.

If there are some problems caused by applications deployed on the server, the server log tends to get stuck by diagnostic messages and large stack traces. The problem is these messages and traces are being written not only to the server log file but also being forwarded to the administration server via the network and causes network storm. The administration server, as a result, might become inaccessible.

For a medium domain (4 - 8 WebLogic Server instances belong to) the idea just to disable the message forwarding capability can be considered. The Domain log broadcaster:, Severity level property value on the Environment -> Servers -> SERVER -> Logging -> General, Advanced page for every managed server must be set to Critical or higher.


Thursday, August 17, 2017

DevOps Strategy for Oracle Fusion Middleware

Let me share the main points of a successful DevOps strategy for that large monolith as the Oracle Fusion Middleware platform.

I see the following principles for the DevOps strategy:

1. The reference configuration must be specified and stabilized. The DevOps world offers a number of Infrastructure as Code instruments such as Ansible, Chef, Puppet, Terraform, etc. Some utilities call themselves as "Orchestrators" but in any case, any environment should be created over the reference configuration only. Also, the reference configuration must be covered by tests. The tests must ensure the configuration stay in the actual state and has no leaks.

2. There is a negative phenomenon in the world of large middleware - Configuration Drift. The drift may take different forms from not matched set of patches installed on the test and the production environments, till a little bit different configuration of JDBC connection pools or JTA transaction timeouts. It's almost impossible to eliminate the configuration drift at all, but using the right DevOps strategy we can minimize it and take the control.

3. The basic step to controlling configuration drift is to prohibit manual changes to the configuration. Sometimes there may appear urgent changes without which the platform just doesn't work at all, but this changes must be immediately reflected in the reference configuration.

4. In order to bring additional reliability to the infrastructure, a playback mechanism should be introduced. If a change moves the production environment to a broken state, the operational team would have a strong mechanism to return back as quickly as possible. Another way is to check out a stable version of the infrastructure from a source code management tool since the infrastructure is a code itself but for Oracle Fusion Middleware based platforms such as SOA Suite or WebCenter Portal, this process takes excessive periods of time.

5. The next step could be the automatization of diagnostic information gathering and utilities for automation such as Chef, Puppet, Ansible and others can really help us.

Your comments are welcome!

Would you like to give a 'Like'? Please follow me on Twitter!

Tuesday, August 1, 2017

How to Ensure Message Ordering on a Cluster Environment Using JCA Adapters in Oracle SOA Suite

The right configuration of Oracle SOA Suite JCA-adapters for ensuring message ordering on a cluster is presented in the article.

During an integration project especially if some involved information systems are legacy, a database is often employed. Oracle SOA Suite contains a number of adapters built on the JCA technology which provides the database polling capability. The examples are the DB- and AQ-adapters.

And sometimes the order messages are processing in must be the same as the messages were generated inside a source application and, therefore were written to the database. Let me illustrate the sentence by the following: an information system creates an object, e.g. a consumer's bill. Then the object is modified and in some time deleted at all (so, the bill was generated by mistake). Obviously, the message about the object removal cannot reach the destination before the message about the creation. Otherwise, data integrity could be compromised.

Tuesday, July 25, 2017

Building a Real Java EE + Oracle Coherence Application with Maven

There is an amazing Building a Real Application with Maven story published within a new book, Fusion Middleware Developing Applications Using Continuous Integration. The story tells of building a web-application which uses Oracle Coherence as a data store and a servlet as a data accessor. Apache Maven is used for compilation and building, the appropriate 'pom.xml' files are presented.

If we look deeply into the web-module's 'pom.xml' file, the following dependency (the gar-module) may be found:


A very interesting fact is there isn't any type declaration, so the gar-module is used as a usual 'jar' dependency. If a real application contains more gar-modules and dependencies, the best-practice for Maven users is to define the dependencies in the 'dependencyManagement' section inside the parent 'pom.xml' file. And the <type>gar</type> stanza must exist in this section since the dependency has to be used as the gar-type inside the ear-module's 'pom.xml' file.


Ok, we can say, let's define the dependencies inside the parent 'pom.xml' file and add the references on these dependencies into the 'pom.xml' files of the war- and ear-modules. Note! The 'groupId' and 'artifactId' attributes are modified.

Wednesday, July 12, 2017

How We Added a Spoon of Agility to a Large Oracle Service Bus Project

Several months ago I already shared how to ensure guaranteed delivery for 5.000.000 messages handled per day by Oracle Service Bus (OSB). In the case, OSB is heavy used to integrate a customer relationship management application (the CRM) in a solid environment with many regional billing systems, provisioning, ERP and ordering management system (OMS), etc. Also, the integration solution is deployed across four ex-standalone corporations, each of which has its own IT infrastructure, and this circumstance makes the project more and more interesting.

The common problem from a manager's point of view is to provide consistency among services deployed on the bus, the main client application (the CRM), and numerous 3rd party applications. Also, there is a time lag in development and end up to production these parts of the infrastructure. And the development team forever must have guaranteed stable and ready to deploy code of the service bus.

The situation is usual for almost all integration projects in the World. The releases of an enterprise service bus must be delivered in a reliable way, no one integration flow (neither the client -> service bus nor the service bus -> 3rd party application communication) must fail after the release is deployed to the production environment.

Let me explain the features of our project.
  1. A one pizza size development team, not more than 5 developers are there.

  2. Hovewer, the team has developed and delivered 13 services and 46 adapters to a wide range of enterprise applications. The services provide very different business logic - from just wrapping a stored procedure into a SOAP-based web service till a complex orchestration employing the Splig-Join component of Oracle Service Bus.

  3. SVN is utilized as a source code management tool.

  4. Oracle Service Bus out of the box provides no capability for service versioning, so it's impossible to expose numerous versions of the same service simultaneously. Although the main service client, CRM application, is developed by a team working for the same company, we are able to deliver releases of the service bus regardless of this capability.

  5. The development process is based on Agile. Sometimes it becomes a reason of inconsistent builds. In fact, this article is about how to eliminate the impact of any agile methodology on the consistency of the enterprise service bus.