Skip to main content

By clicking Submit, you agree to the developerWorks terms of use.

The first time you sign into developerWorks, a profile is created for you. Select information in your developerWorks profile is displayed to the public, but you may edit the information at any time. Your first name, last name (unless you choose to hide them), and display name will accompany the content that you post.

All information submitted is secure.

  • Close [x]

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerworks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

By clicking Submit, you agree to the developerWorks terms of use.

All information submitted is secure.

  • Close [x]

Using Microsoft .NET in WebSphere Message Broker V8: Part 4: Using the .NETCompute node for exception handling

Ben Thompson (bthomps@uk.ibm.com), Consulting IT Specialist, IBM
Author photo
Ben Thompson is a Consulting IT Specialist working on the WebSphere Message Broker development team at the IBM Hursley Software Lab in the UK. He is currently working on the design and implementation of .NET support in Message Broker. In the past, he has worked for IBM Software Services for WebSphere designing and implementing WebSphere solutions for IBM customers worldwide. You can contact Ben at bthomps@uk.ibm.com.
(An IBM developerWorks Contributing Author)
Matthew Golby-Kirk (mgk@uk.ibm.com), Software Developer, IBM
Matthew Golby-Kirk photo
Matthew Golby-Kirk is a software developer working on the WebSphere Message Broker development team at the IBM Hursley Software Lab in the UK. He works on the design and implementation of the HTTP and Web services support, along with the ESQL language run time in WebSphere Message Broker. You can contact Matthew at mgk@uk.ibm.com.

Summary:  This series of four tutorials demonstrates the new support for Microsoft .NET in WebSphere Message Broker V8. Part 4 shows you how to use the .NETCompute node for exception handling, using a scenario that builds in complexity as additional exception conditions are deliberately produced and then handled. Readers should be familiar with either Microsoft .NET or WebSphere Message Broker, but need not be familiar with both.

View more content in this series

Date:  22 Feb 2012
Level:  Intermediate

Comments:  

Catching a real-life WebSphere MQ exception

  1. You can easily extend the previous example to show a more complex and realistic exception tree being caught and navigated. Up to this point, you have only considered artificial exceptions produced by a Throw node. Substitute an MQ Output node in the place of the Throw node, but do not configure its Queue name property. Rename the MQ Output node NO QUEUE. Resave the message flow, and you should see a yellow warning triangle on the corner of the node indicating that the Queue name has not been configured:

    Amended MyFlow with the MQ Output node named NO QUEUE
  2. As you have done a few times now, return to the open test client, right-click the Invoke Message Flow level in the hierarchy on the panel on the left, and select Re-run. The flow should be redeployed and the message sent to the input queue again. This time a new exception should be recorded in the output message written to the queue named DOTNET.EXCEPTIONS.CATCH. The red box below shows the beginning of the new exception. The full message is displayed in the listing that follows the image:

    Result of Test 4

    Listing 11. Output message describing the WebSphere MQ exception, caught after rollback to .NETCompute1
    
    <Message>
    <Field>( MB8BROKER.default ) An error occurred in node 'DotNetExceptions.NO QUEUE'
    when opening queue '' on queue manager ''. State = '-1' 'MQW101' '2085' ''   An    
    error occurred when a message flow node attempted to open a queue. The reason code 
    from the MQOPEN is displayed as the 3rd (native error) state. Check the WebSphere MQ 
    completion and reason codes in the WebSphere MQ Application Programming Reference
    to establish the cause of the error, taking any appropriate action. You may have to 
    restart the message broker after you have performed this recovery action.</Field>
    </Message>
    

  3. The exception generated in this example has more levels of nesting, and more inserts than the earlier simple Throw example. The broker exception list from this example, which the .NETCompute node navigates and then inflates to produce the above output message, is shown below:

    Exception List showing MQ Exception
    This image shows that the .NETCompute node's use of the method GetBaseException to walk down to the lowest exception in the tree hierarchy has navigated to the exception that contains the root cause of the problem. Typically for Message Broker, this will always be at the most nested part of the exception list. In this example, this root cause is Message Broker exception BIP2666. This example also demonstrates the real power of the FormattedMessage method that the Broker provides, as it reconstructs a human-readable message containing all required inserts.

6 of 10 | Previous | Next

Comments



Help: Update or add to My dW interests

What's this?

This little timesaver lets you update your My developerWorks profile with just one click! The general subject of this content (AIX and UNIX, Information Management, Lotus, Rational, Tivoli, WebSphere, Java, Linux, Open source, SOA and Web services, Web development, or XML) will be added to the interests section of your profile, if it's not there already. You only need to be logged in to My developerWorks.

And what's the point of adding your interests to your profile? That's how you find other users with the same interests as yours, and see what they're reading and contributing to the community. Your interests also help us recommend relevant developerWorks content to you.

View your My developerWorks profile

Return from help

Help: Remove from My dW interests

What's this?

Removing this interest does not alter your profile, but rather removes this piece of content from a list of all content for which you've indicated interest. In a future enhancement to My developerWorks, you'll be able to see a record of that content.

View your My developerWorks profile

Return from help

static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=WebSphere
ArticleID=795296
TutorialTitle=Using Microsoft .NET in WebSphere Message Broker V8: Part 4: Using the .NETCompute node for exception handling
publish-date=02222012
author1-email=bthomps@uk.ibm.com
author1-email-cc=
author2-email=mgk@uk.ibm.com
author2-email-cc=

Tags

Help
Use the search field to find all types of content in My developerWorks with that tag.

Use the slider bar to see more or fewer tags.

Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere).

My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Use the search field to find all types of content in My developerWorks with that tag. Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere). My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).