Showing posts with label message broker. Show all posts
Showing posts with label message broker. Show all posts

Dec 20, 2009

Websphere Message Broker Fixpack installation - Do backup before it

It is nice to know that IBM invested some thinking in the broker fix pack installation process, or maybe not.
The installation most of the time works fine, the problem is if something go wrong and you want to rollback the installation process.

The problem is that the only fix pack that you can uninstall are those of the toolkit. You can't uninstall any runtime fix packs.
If for some reason the broker or config manager fail to start post the fixpack installation than you probably would need to reinstall all server components.
With my great fixpack installation I encountered a nice feature, the installation massed up the jre library thus the components failed to start. I succeeded to fix it by copy the jre library from other working server.

It's very strange, really.

So before you install I suggest to backup the server, make a snapshot/image.

Aug 4, 2009

SOI with WMB

It's is very strange thing but I think that IBM missed a very important feature in websphere message broker design, the Infrastructure assets.
Each organization has its own assets which its develops and customize for their use.
In the SOA approach you build infrastructure services and application for reuse.
The reuse option in WMB can be achieved by the subflow ability.
Subflow is a regular message flow with small difference, It starts from Input node, logic inbound port and not physical one. ( Like direct ports in Biztalk).
You than can drag your subflow to the your message flow, it would be represented by single node.
What really happens there is an inline copy of the subflow to the message flow during the bar compilation. Thus you getting different copy of your subflow during each bar compilation.
It's like they didn't hear about REFERENCE in IBM.
So now for example you developed a logging subflow, or generic error handler. You put the subflow in all your projects.
Now if you make change in your subflow you need to recompile all of your message flows projects!
And here is the problem.
Every time you make change in your infrastructure you need to recompile all your projects.
This is a major development issue.

Some Tips to ease on this issue:

- Develop as many as you can of your infrastructure in java. thus won't need to
recompile your projects.
- Use scripting abilities of the webpshere message broker to recompile/redeploy the projects.
http://www.ibm.com/developerworks/websphere/library/techarticles/0706_spriet/0706_spriet.html

Working now on different approach to solved this, will post more details on it soon.
Hope to achieve the right agility with websphere message broker.

Mar 11, 2009

Error Handling in Websphere Message Broker V6/V6.1

A major issue in the WMB message flows is the error handling.
I saw many production message flows which loose messages meaning loose business information.

WMB platform give the developer freedom and variety of the error handling but it is very important to understand how it works.

So let's begin.

You can divide the broker elements in two categories under transactional objects and non transactional. On the transactional objects the engine makes checkpoints before entering each node. Thus if exception thrown in the entered node the object that you will get will be without any changes made in the node. If you need the changed object details you need to catch it in the node (java/esql try catch code). The non transactional elements save their state and the engine don't do any rollback on them.

Transactional Objects (those who have the Input/Output prefix):

  • Body - Root
  • LocalEnvironment

Non transactional :

  • Environment
  • ExceptionList

Node's Failure Terminal

Each node has a failure terminal. Message will route to this terminal only if there was an exception in the node and the failure terminal is connected otherwise the exception will be propagated to the previous up the flow. If an error occurred downstream it won't be routed to the node's failure terminal. I don't recommend using this pattern except maybe when calling sync service like.

When developing sub flows remember to connect all the terminal of the sub flow, because during the deployment of the flow the compiler will neglect the unconnected terminals, thus if failure occurred in the sub flow and you didn't connect it the failure won't be propagated to the main flow and thus you will lose track of the error.

Try Catch pattern and Catch terminal

My suggestion is to use this pattern; you get it implicit on the input nodes, by choosing the transaction mode.
Don't forget to throw exception at the end of the catch handling if you working under transaction otherwise no rollback will be executed because the whole transaction handled successfully.
If you developing synchronized service construct indicative reply message for the caller.
Very important if you putting dump messages for logging by the MQOutput set it to non transaction mode, if not your dump message will also be roll backed by the engine and you won't see your message in the queue.
Put your tryCatch node on common business parts, divide your flows wisely.

Trace Nodes

Nice function giving you the ability to dump your trace to log files, trace or custom files. You can dump whatever you want, ${Root}, and use the ESQL function like CURRENT_DATE.
The major improvement in 6.1 version is that now you don't need to delete the trace nodes after the development you can just disable them by this command :

mqsichangetrace –n [on off]


MQInput Node error handling flow when working under transaction (otherwise the message will be discarded) and the error occurred beyond the MQInput node.

  1. If catch terminal connected the exception will be propagated there. Remember to throw custom exception for the Roll back process in which all action against external sources like DB or MQ queues will be back-out.
    It is also a good place for compensation process if needed.

    The message will be rolled back to input queue and the back out count will be raised by one.

  2. If failure terminal connected the and the back-out count of the message equals treshold property the message will routed there if not it will be routed to the Back-out queue (property on the input queue) and if it not set then it tries to put it on the Qmgr back out queue.
    if no back out queue exist it will try to put the message on the Qmgr DLQ.
    If error occurred beyond the failure terminal then the engine will try to resend the message twice the treshold number ( new in version 6.1) and then try to put it on the Qmgr Back out Queue and if not then on the Qmgr DLQ.
    If no success yet then the message will loop infinitely thus become a poison message and manual interfering is needed.


Treshhold

MQ
gives you set of properties by which you can handle back out messages. You can set on the queue the back out number and the back out queue name. the MQInput node will route the message implicitly if the treshold is reached.