Wednesday, February 13, 2013

Start Mode of Message Flows and Applications in Message Broker 8.0

In previous versions of message broker, If we deploy message flow  it starts running and we can’t deploy a messsage flow/application in stopped state.
In some scenario, we may require some flows needs to be in stopped state after deployment and start the flow manually when required. Messsage Broker v8 provide an option to deploy the message flow in stopped state.
Messsage Broker v8 has the capability to configure and control the runstate of the message flow or application with help of new Start Mode property.

Friday, February 8, 2013

New mqsipackagebar command in Message Broker 8.0.0.1

mqsipackagebar command is a new command introduced in Message Broker v8.0.0.1 and it is shipped with runtime.

mqsipackagebar is used to create bar file on a machine which don’t have Message Broker installed.

WMB 8.0.0.1 introduces the ability to deploy message flows without needing to compile them into *.cmf files and the same feature is used by the mqsipackagebar command.

Resources that you add to a BAR file by using the mqsipackagebar command are not compiled when they are added and this command adds only deployable resources to the BAR file.
Whatever resources we add through this command to the bar file are not complied which means *.msgflows are added to bar file as *.msgflows and not *.cmfs.

But still *.mset,*java files are not deployable resources in MB 8.0.0.1. So if we need to add these resources to the bar file then these resources should be complied as *.dictionary,*.xsdzip,*.jar

There is also an option in the command to include non-deployable resources but these resources will not be deployed to the execution group.
Few options in toolkit and mqsicreatebar commands are added to facilitate this command.

In MBToolkit 8.0.0.1, the default option is not to compile the message flows into .cmf files and generates the mqsipackagebar command for the bar file we created.

Usage:
1. Can create bar file on any machine and message broker installation is not required. But few configuration is required to run this command. For configuration set up, please visit the link.
2. Adds the *.msgflow, *.esql, *.subflow to the bar file without compiling.
3. As it is not compiling the deployable resources like msgflow, we can recover the code with the help of bar file at any time.
4. Can create bar file with both deployable objects(.msgflow) and non-deployable objects(.zip)

Restrictions:
1. Can’t have both *.cmf and *.msgflow of a message flow in the same bar
2. *.mset and *.java are not deployable resource and these types of resources needs to be compiled prior to using this command.
    If we want to compile message sets and Java projects, we can go with the below options
          Toolkit provides the option to complie the resources like .mset to .dictnory and .java to .jar
           mqsicreatebar command is updated to complie the resources like .mset to .dictnory and .java to .jar
               mqsicreatebar -data workspace -compileOnly
3. Will not do strict validation on the resource we add to the bar file and is less powerful when compare mqsicreatebar.
4. Should convert all subflows with .msgflow extension to .subflow extension.
     MB toolkit 8.0.0.1 has option to convert the subflows with .msgflow extension to .subflow extension.

Starting Broker (8.0.0.0) from MB (8.0.0.1)

Assumptions:
Toolkit: 8.0.0.1
Broker: 8.0.0.0 & 8.0.0.1
MBX:  8.0.0.1

Toolkit and MBX displays both the versions of Broker which are currently available in the system under Brokers view.

We can check the version of each broker using Toolkit



Or using MBX


Or using command console




We can administrate Broker (8.0.0.0) using WMB toolkit (8.0.0.1) or MBX 8.0.0.1 or Command console 8.0.0.1. But the issue in using MB 8.0.0.1 is when we start the Broker (8.0.0.0) using WMB 8.0.0.1

If we try to start broker (8.0.0.0) from WMB toolkit (8.0.0.1), it will show us dialog and if we give OK then it will start the broker using mqsiprofile.cmd(8.0.0.1) and switch level of the broker (8.0.0.0) to broker (8.0.0.1)


And if we try to start broker (8.0.0.0) from Command console (8.0.0.1), it will switch level of the broker (8.0.0.0) to broker (8.0.0.1) without any warning.




This is the easiest way of switching the fix level but if we want to maintain the broker level then the best option is to start the broker (8.0.0.0) using Command Console 8.0.0.0.
If we need to roll back the broker version to older version then restart the broker using older version command console.

To avoid this type issues, we should administrate each broker with their version of Toolkit, MBX and command console.

Deployment methods in Message Broker

There are two deployment methods in Message Broker
  1. Delta or Incremental Deployment
  2. Complete Deployment
Delta or Incremental deployment:
Deploying bar file without clearing currently deployed resources in the execution group. The bar file will add or modify the resources but it will not clear the execution group.

How to do it:

1. WMB Toolkit
Drag a message flow or a broker archive (BAR) file from the Broker Development view onto an execution group to deploy it. Alternatively, right-click an execution group to select a message flow or BAR file to deploy to the selected execution group.
Testclient:
Test client is used to deploy and test the code sequentially in WMBT and it is not used only for deployment.
Check the box as per the screenshot and start deploying and testing the flow.
Windows -> Preferences->Broker Development-> Message Broker Test Client->Check the box  ”Add or modify(but not clear) what has already been deployed on the execution group”.



2. WMB Explorer
Uncheck the box as per the screenshot and deploy the bar file

Windows -> Preferences->WebSphere Message Broker Explorer-> Uncheck the box “Empty the contents of the execution group before deployment”.


3. CommandConsole( must not specify –m parameter)
Use mqsideploy command without –m option
mqsideploy MB8BROKER -e default -a mybar.bar -w 600


4. Message Broker API(CMP API)
Use deploy method with isIncremental argument “true

public DeployResult deploy(java.io.InputStream barStream,
java.lang.String barFileLabel,
boolean isIncremental,
long timeToWaitMs)

ExecutionGroupProxy eg = b.getExecutionGroupByName(“default”);
DeployResult dr = eg.deploy(“MyBAR.bar”, true, 30000);

Complete Deployment:
Deploying bar file after clearing all currently deployed resources in the execution group. The bar file will remove all the objects in the execution group then starts deploying .

1. WMB Toolkit – Test client
Drag a message flow or a broker archive (BAR) file from the Broker Development view onto an execution group will always to incremental deployment.
So, if complete deployment is required then only way is to use the test client.Test client is used to deploy and test the code in WMBT and it is not used only for deployment.
UnCheck the box as per the screenshot and start deploying and testing the flow.
Windows -> Preferences->Broker Development-> Message Broker Test Client->Uncheck the box  ”Add or modify(but not clear) what has already been deployed on the execution group”.



2. WMB Explorer
Check the box as per the screenshot and deploy the bar file

Windows -> Preferences->WebSphere Message Broker Explorer-> Check the box “Empty the contents of the execution group before deployment”.



3. CommandConsole( -m is mandatory)
Use mqsideploy command with –m option
mqsideploy MB8BROKER -e default -a mybar.bar -m -w 600

4. Message Broker API(CMP API)
Use deploy method with isIncremental argument “false
public DeployResult deploy(java.io.InputStream barStream,
java.lang.String barFileLabel,
boolean isIncremental,
long timeToWaitMs)
ExecutionGroupProxy eg = b.getExecutionGroupByName(“default”);
DeployResult dr = eg.deploy(“MyBAR.bar”, false, 30000);


Hello Message Broker JAVA API!!!

Prior to MB 8, Message Broker API (CMP API) is used to develop java applications to administrate Broker and its resources but we can’t develop or modify message flow applications.
In MB 8, we can develop/modify message flow applications using java and there is no need of Message Broker Toolkit to be installed in our machine that means from now onwards we can develop message in an environment which doesn’t support Message Broker Toolkit (Unix, z/OS)
We need only the jar file “ConfigManagerProxy.jar” and compatible JRE to develop message flow.
This post gives overview of how to create simple message flow using Message Broker Java API.
Configure our windows environment to develop java applications:
1. Add the jar file to CLASSPATH environment variable   
    set CLASSPATH = %install_dir%\classes\ConfigManagerProxy.jar
2. Verify using below command
    echo %CLASSPATH%

Important packages:
Package com.ibm.broker.config.appdev: This package has set of classes to create/modify/read/write/set properties of message flow
Package com.ibm.broker.config.appdev.nodes: This packages has set of classes of all built-in nodes
Create new message flow:
The below sample JAVA application shows how to create new message flow, add nodes, create connections, set properties and save the created message flow.

 


Compile and run the java code. The code will generate the message flow in the same directory where the .class resides.
Copy the message flow that is generated by this code in the Message broker toolkit and the flow design will be as below.

Load and Modify existing message flow:

The below sample JAVA code shows how to load , rename and save existing message flow.

File msgFlow  = new File(“LOAD_MSGFLOW.msgflow”);
MessageFlow mf1  = FlowRendererMSGFLOW.read(msgFlow);
String NewFlowName  = “LOADED_MSGFLOW_RENAMED”;
mf1.setName(NewFlowName);
FlowRendererMSGFLOW.write(mf1, “.”);

Is my BARfiles In-Sync with my code in WMB Toolkit?

We can easily identify whether the bar file in toolkit is In-Sync or Out-Of-Sync with the help of bar file icon.
– Bar file is In-Sync with the code.
– Bar file is Out-Of-Sync with the code.


Tuesday, February 5, 2013

MBExplorer 8.0.0.0 support for MQ 7.1/7.5

MB 8.0.0.0 doesn’t support MQ 7.1/MQ7.5 but we can use it with MQ 7.1/MQ7.5.
But MQExplorer doesn’t show “brokers” option and so we can’t administrate broker using MBX.
Below is the workaround to fix this issue
  1. Check the directory “<install_path>\WebSphere MQ\MQExplorer\eclipse\links”
  2. It should have a file “com.ibm.wmadmin.broker.explorer.link” and the content will be “path = <Install_path>/MBExplorer”  (e.g. “path=D:/IBM/MBExplorer”)
  3. If not, create the file and add the path of MBExplorer
  4. Restart WMQX

MQ 7.5 Infocenter in PDF

Difference between MRM and DFDL parser

MRM – Message Repository Manager (Supported only in Message Broker)
DFDL – Data Format Description Language (Introduced in MB 8.0 as a new Parser and Domain)

1. Standard:
MRM- Proprietary standard
DFDL- Open standard (like WSDL)

2. Usage:
MRM – Used only in message broker
DFDL – Can be used any product as it is Open standard and Message Broker is the 1st software product that supports DFDL in WebSphere family.

3. Testing message model:
MRM – Can’t test the modeling without deploying message set and flow that uses it
DFDL – Can be tested without deploying the messaging model (WMB8 toolkit has DFDL tester)

4. Performance:
Performance of DFDL parser is much better than MRM

5. Migration:
MRM – Can’t migrate or share message modeling to any other software products.
DFDL – Can migrate or share message modeling to any other software products.