Portus Version 2018-08-24
 

Portus support of Message Oriented Middleware

Message Oriented Middleware (MOM) is a category of connectivity middleware that provide program-to-program communications by message passing.

MOM, because it generally supports multiple protocols, comprises an infrastructure that will support reliable and scalable high-performance distributed application networks. Most Message Oriented Middleware is implemented with queued message store-and-forward capability and it is this feature Portus supports.

In particular the systems supported by Portus are IBM WebSphere MQ and Software AG EntireX Broker.

Introduction

There are 2 ways to integrate a messaging sytem with Portus.

  1. To monitor for Portus specific requests, to process these and issue a response.
  2. To log Usage Governance Data.

Tutorials are available which demonstrate these 2 capabilites.

The first tutorial uses Portus to write usage governance data to a messaging system and a second Portus to process these and store them in a database. See here for details on this.

This tutorial uses a Java client to access the WSDL of a web service supporting MQ and call it using SOAP over MQ. See here for details on this.

Write Usage Governance data to a MOM system

Usage Governance data can be written to a WebSphere MQ queue or an Software AG EntireX server.
Note: It is outside the scope of this tutorial to detail exactly how these are set up so it is assumed that the chosen Messaging system is configured correctly.

In this tutorial we will be using 2 Portus servers. One will direct usage governance data collected to a message queue and the other will read from this queue and process the input. The end result is that the target of the usage governance web service will receive an add request complete with the data.

  1. In the Control Centre select the server for which usage governance data will be generated.
  2. Select the Governance tab in the Properties view.

    To turn data collection on the Information box must be selected. If required Input Data and Output Data may also be selected.

  3. The Messaging section allows one to enter the details required for None, MQ or EntireX :

    Select the radio button of MQ or EntireX and fill in as appropriate for you MOM installation. Note that the queue will be opened for output and later on in this tutorial will be opened as an input queue.

  4. Select the Save button.
  5. Stop the server and start it again. See here on how to do this.
  6. At this point Portus should have connected successfully to the manager and opened the output queue specified. Check the error log for any errors at this point.

    The default location of the Apache error_log is [SERVER_INST]/Apache22/logs/error_log replacing [SERVER_INST] with the location in which you have installed Portus.

  7. Issue a request to Portus e.g. a get request
  8. An add request, containing usage governance data pertaining to this request, should appear as an entry in the output queue.

    Use a search mechanism particular to your messaging system to check that this is the case. Note the syntax of this request is supported by the usage governance web service.

    If the latter has not yet been created, follow the steps outlined here to do so.

  9. In the Control Centre, select the second Portus server. Open the Messaging tab in the Properties view for the usagegovernance web service:

  10. Fill in the details for the messaging system you are using. Clearly, for MQ, the Input Q value has to be the value specified for Queue in step 3. For EntireX the details entered here should match those from 3.
    Note: The Broker Stub value will depend on the system from which EntireX is being called i.e. broker32.dll for Windows, broker.so for Linux etc.
  11. As per the hint, switch back to Service properties and select the Save button when complete.
  12. Portus will now make contact with the appropriate messaging system. Check the error log for messages.

    The default location of the Apache error_log is [SERVER_INST]/Apache22/logs/error_log replacing [SERVER_INST] with the location in which you have installed Portus.

  13. As soon as successful connections have been made, the input queue/service will be read and the message(s) processed.

    There are a couple of ways to check the status of this.

    • Query the database table directly..
    • Issue a list request on the usage governance web service.
    • Check the Output Q (MQ) or the EntireX server for responses to the add request to the usage governance web service.

SOAP over IBM MQ Series

Portus and IBM MQ Series can be used together to enable sending SOAP requests to an MQ queue and to receive a response from a queue.

These request are asynchronous so it means that multiple requests may be sent from the client even though Portus may not be running.

These requests are held on the queue until Portus reads and processes them. Likewise the responses will reside on a queue until such time that a client may request them.

Here is a top level view on the steps involved.

Details

This tutorial will make use of Java wrapper/stub classes to access a Portus web service.

Java wrapper/stub classes are generated using the Apache Axis2 feature WSDL2Java.

If you do not have it already, download and install the latest Axis2 kit.

The web service which we will be using is that generated by discovering the city table in the World database supplied by a MySQL installation. See MySQL Tutorials for details on how this is achieved.

Ensure that the MQ Manager to be used has been started and that an input and output queue created. Also ensure that a listener has been started.

  1. Select the world_dsn_city web service and open the Messaging tab. Select the MQ radio button and tab. Fill in the details appropriate to your MQ installation.

  2. As per the hint, switch back to Service properties and select the Save button when complete.
  3. Portus will now make contact with the appropriate messaging system. If an error occurs it will be highlighted as follows.

    Check the error_log to find the cause. The default location of the Apache error_log is [SERVER_INST]/Apache22/logs/error_log replacing [SERVER_INST] with the location in which you have installed Portus. Please correct and try again.

    If successful then carry on to next step.

  4. Switch to the Java perspective (Window -> Open Perspective -> Other... -> Java (default). For more information on this aspect of Eclipse see Getting started with Eclipse.
  5. Create a new Java-project naming it "SOAPMQTutorial".
  6. Right-click the "SOAPMQTutorial" project folder, select "Build Path", then "Add External Archives..."
  7. Add all .jar files from the axis2 "lib" directory to the project's Build-Path.
  8. Right-click the "SOAPMQTutorial" project folder, select "Build Path", then "Add External Archives..."
  9. Add all the .jar files from your MQ lib directory e.g. ..\IBM\WebSphere MQ\java\lib
  10. Open a command prompt (aka "DOS box"), change to the "SOAPMQTutorial\src" directory and run the following command:

    wsdl2java -uri http://<yourserver>:<yourport>/world_dsn_city?WSDL -o ..\ -p SoaGW
  11. The following items are generated from the Portus WSDL:

    • A "Stub" class implementing all types and operations ( ports / bindings ).
    • A CallbackHandler - a stub class (not used in this tutorial) providing hooks for client-side extensions to the generated result- and error handlers.
    • A Fault class.
  12. Get file SOAPEntireXTut.java and, when prompted, save in the ..\SOAPMQTutorial\src\SoaGW directory. Right-click on SOAPMQTutorial and select Refresh(F5). SOAPMQTut.java should appear in the explorer window.
  13. Get file mqTransports-0.1.jar and, when prompted, save it in a local directory.
  14. Right-click on SOAPMQTutorial and select Build Path -> Add External Archives...

    Navigate to where mqTransports-0.1.jar was saved and select Open to add it the project.

  15. Right-click on SOAPMQTut.java and select Run As -> Java Application:

  16. The output appears in the "Console" window:


Ostia
www.ostiasolutions.com
Copyright @ 2006-2018 Ostia Software Solutions Limited.