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 1: Using the .NETCompute node sample

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.
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.

Summary:  This series of four tutorials demonstrates the new support for Microsoft .NET in WebSphere Message Broker V8. Part 1 shows you how to use the .NETCompute node to filter, modify, and create messages, and provides a sample scenario along with explanatory C# code snippets. 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:  21 Dec 2011
Level:  Intermediate

Comments:  

Deploying to Message Broker

Having built an assembly file from the C# code, it is possible to drag and drop the assembly file from a Windows Explorer window directly onto a .NETCompute node in a message flow in order to associate the node with the code. This technique results in a hard-coded absolute location for the assembly, and it is useful when developing, testing, and hot swapping the .NET code that the Broker is executing. However, for production situations, a better approach is to define a Message Broker Configurable Service that specifies a .NETCompute node to locate the assembly file. This method is much more dynamic and better suited when moving a deployment between environments during development, test, and production. The diagram below shows that the same message flow can be used in multiple environments, with the configurable service in each environment defining the location of the assembly file, which may be at a different location on the file system for each environment.

Configurable services

Use this approach and define a configurable service using the following steps:

  1. Using a Windows Explorer window, make a copy of the assembly and debug files, which are named SampleDotNetProject.dll and SampleDotNetProject.pdb:

    Copy both files from the directory:  
    C:\student\DOTNET\lab_sample\visual studio 2010\Projects\
    SampleDotNetProject\SampleDotNetProject\bin\Debug
    
    To the directory:
    C:\student\DOTNET\lab_sample\AssemblyFile
    

  2. Define the required configurable service for the message flow using Message Broker Explorer, which is a graphical user interface for administering your brokers based on the Eclipse platform. Message Broker Explorer is an extension to WebSphere MQ Explorer.

    Open Message Broker Explorer: Select Start => IBM WebSphere Message Broker 8.0.0.0 => Message Broker Explorer. Right-click the Configurable Services folder for the runtime broker you are using and select New => Configurable Service.

    Message Broker Explorer
  3. Set the following parameters:

    Name: DotNetAppConfigService
    Type: DotNetDomain
    ApplicationBase: C:\student\DOTNET\lab_sample\AssemblyFile

    Click Finish.

    DotNetAppConfigService
  4. Return to the WebSphere Message Broker Toolkit and navigate to the properties of the .NETCompute node named Filter. Switch to the Advanced tab and set the AppDomain name to be DotNetAppConfigService:

    Advanced tab of .NETCompute
  5. Repeat the last step for the other two .NETCompute nodes in the message flow, named Modify and Create. Each of these nodes uses a class defined inside the same assembly, and each of the nodes will locate the assembly at runtime using the configurable service you defined above.
  6. The rest of the tutorial assumes that you have created a queue manager named MB8QMGR and a runtime broker named MB8BROKER, which are known as the Default Configuration. For more information, see Creating the Default Configuration in the Message Broker information center.
  7. The message flow requires the creation of two MQ queues, DOTNET.IN and DOTNET.OUT. Return to Message Broker Explorer and right-click the Queues folder underneath your Queue Manager (in the screenshot below the queue manager is named MB8QMGR) and choose New => Local Queue:

    New local queue wizard
  8. Specify the Name DOTNET.IN and click Finish:

    Create DOTNET.IN
  9. Repeat the last two steps to create a queue named DOTNET.OUT.
  10. Return to Message Broker Toolkit and open the BAR file named DotNet.bar, located inside DotNetApplication. Click Rebuild and Save:

    Build BAR file
  11. Deploy the BAR file DotNet.bar by dragging and dropping it onto the execution group:

    Deploy BAR file

The next section of the tutorial shows you how to test the scenario.

6 of 9 | 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=781973
TutorialTitle=Using Microsoft .NET in WebSphere Message Broker V8: Part 1: Using the .NETCompute node sample
publish-date=12212011
author1-email=mgk@uk.ibm.com
author1-email-cc=
author2-email=bthomps@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).