Thursday, 19 December 2013

WMB INSTALLATION AND THEIR PURPOSES




WebSphere MQ:


IBM® WebSphere® MQ can transport any type of data as messages, enabling businesses to build flexible, reusable architectures such as service-oriented architecture (SOA) environments. It works with a broad range of computing platforms, applications, web services and communications protocols for security-rich message delivery. WebSphere MQ provides a communications layer for visibility and control of the flow of messages and data inside and outside your organization.
WebSphere MQ provides:
  • Versatile messaging integration from mainframe to mobile that provides a single, robust messaging backbone for dynamic heterogeneous environments.
  • Message delivery with security-rich features that produce auditable results.
  • High-performance message transport to deliver data with improved speed and reliability.
  • Administrative features that simplify messaging management and reduce time spent using complex tools.
  • Open standards development tools that support extensibility and business growth.


IBM Integration Bus V9 :

                IBM Integration Bus is IBM's strategic integration product for Java, Microsoft .NET, and heterogeneous integration scenarios. It represents a significant evolution of the WebSphere Message Broker technology base, and includes new features such as policy-based workload management, business rules, and integration with Business Process Management (BPM) and Microsoft .NET. It also incorporates WebSphere Enterprise Service Bus (ESB) use cases, and WebSphere ESB capabilities will be folded into IBM Integration Bus over time, with conversion tools for initial use cases built-in from day one.



IBM Integration Toolkit :

Application developers work in separate instances of the IBM Integration Toolkit to develop resources associated with message flows. The IBM Integration Toolkit connects to one or more brokers to which the message flows are deployed.

When you start the IBM Integration Toolkit, a single window is displayed. This window is the IBM Integration Toolkit, which contains one or more perspectives.

A perspective is a collection of views and editors that you use to complete a specific task, or work with specific types of resource. The two significant perspectives in the IBM Integration Toolkit are the Integration Development perspective for application development, and the Debug perspective for debugging message flows. The first time that you start the IBM Integration Toolkit, the Integration Development perspective is displayed.

An additional stand-alone component, the IBM Integration Explorer, is supplied for advanced administrative users, and enables additional administration tasks that you cannot perform in the IBM Integration Toolkit.


IBM Integration Explorer :


The IBM Integration Explorer is an extension to the WebSphere® MQ Explorer.

To use the IBM Integration Explorer, you must start the WebSphere MQ Explorer. The IBM Integration Explorer adds the Integration Nodes folder and Broker Archive Files folder to the MQ Explorer - Navigator view:
  • Use the Integration Nodes folder to create, view, and modify integration nodes
  • Use the Broker Archive Files folder to import, view, and modify BAR files before deploying them to your integration nodes

The IBM Integration Explorer provides several QuickViews that you can use to view the properties of integration nodes and their resources. These QuickViews are automatically displayed when you click the resource in the Integration Nodes folder in the MQ Explorer - Navigator view. A QuickView is also available for viewing the details of BAR files that you have imported into the IBM Integration Explorer.

The following views and editors are provided for working with integration nodes in the IBM Integration Explorer:
Broker Archive editor
Use the Broker Archive editor to create and manage broker archive (BAR) files.
Broker Statistics and Broker Statistics Graph views
Use the Broker Statistics and Broker Statistics Graph views to view snapshot accounting and statistics data as it is produced by the broker.
Policy Sets and Policy Set Bindings editor
Use the Policy Sets and Policy Set Bindings editor to edit, save, import, and export policy sets or bindings.
Security Profiles editor
Use the Security Profiles editor to create a security profile for use with Lightweight Directory Access Protocol (LDAP) or Tivoli® Federated Identity Manager (TFIM).
DataPower® Security wizard
Use the DataPower Security wizard to configure an external DataPower appliance to handle the WS-Security Policy for your HTTP, HTTPS, and SOAP nodes within your message flow.
Administration Log view
Use the Administration Log view to view the results of deployment actions on integration nodes.
Activity Log view
Use the Activity Log view to view recent activities affecting your message flows, and related external resources.

Wednesday, 11 December 2013

SEQUENCE NODE

Sequence used to assign sequence number and sequncegroup id to message which is travelled from source to destination nodes.

    When we are going for sequence nodes 4 things we need to set
        1.sequence number path. Mandatory
        2.sequence group identifier. Optional(but useful with large messages)
        3.start of sequence. Mandatory
        4.end of sequence. Mandatory

(observe below properties figure).

STEP1:MESSAGE FLOW WITH MANDATORY PROPERTIES OF SEQUENCE NODE


FIGURE2:SEQUENCE NODE PROPERTIES
ERRORS:
Erro1:we nedd to specify following Red color rounded properties otherwise error will come.
If we doesn't specify the
    sequence number path,
    start sequence,
    end sequence.
Then error will come it wont deploy consider next figure for example

see red color blocks in the above figure cross option (i.e error ) came,so it is impossible to deploy in to the broker. Observe clearly their i didn't mention start sequence,end sequence.

Erro2: when we doesn't mention the incoming parser type in the sequence number path then error won't come but output will not come.see the below figure.(OBSERVE FIGURE 2 sequence number path )
Even if we add broker project to debug it will come again and again.

IMPORTANT NOTE: If we any internal error came message reverse back to sequence node failure terminal if node is connected otherwise it reverse back to mq input node failure terminal if node is connected otherwise it will be in mq input node.

OUTPUT: first observe FIGURE 2 where we given the sequence id also then observe the output

INPUT:
<DATA><Seqid>arun</Seqid><Seq>0</Seq><message>dd</message><Seqid>arun</Seqid><Seq>1</Seq><message>dd1</message></DATA>

Monday, 25 November 2013

Acessing Database using compute node with soap web services by takeing 'AGE as input giveing FNAME of that person as output

STEP1:CREATE NEW MESSAGE BROKER PROJECT.


STEP2:CREATE NEW MESSAGE FLOW.





STEP3:CREATE NEW MESSAGE DEFNITION .

Creation of message set definition need database information according to current scenario.here age and fname are columns of database.observe below figure carefully

Here AGE and FNAME are columns of table .accroding to scnerio AGE act as input and FNAME act as output based on this u created message defination.


NOTE:

1.BEFORE THIS YOU NEED TO CREATE DATA SOURCE AND YOU NEED TO CONFIGURE DATASOURCE WITH THE BROKER .

2.WHEN YOU ARE CREATING WSDL FILE--
'SELECT THE SOAP WEB SERVICE' in drop down.
'TICK THE XMLNSC PARSER'
because soap return object so its difficult to take input data even though input came it works only when we are copying Input as it is to Output.(SO TICK THE XMLNSC PARSER)


MESSAGE FLOW:

COMPUTE NODE FIGURE:



COMPUTE NODE CODE:

DECLARE ns NAMESPACE 'http://www.mir.net';


CREATE COMPUTE MODULE SOAP_COMPT_MSSG_FLOW_Compute
    CREATE FUNCTION Main() RETURNS BOOLEAN
    BEGIN
        -- CALL CopyMessageHeaders();
        -- CALL CopyEntireMessage();
       
        --DECLARE A INTEGER;
       
       
        --SET A=CAST(InputRoot.XMLNSC.ns:INPUT_AGEE.AGE AS INTEGER);
       
        --DECLARE B REFERENCE TO InputRoot.XMLNSC.ns:INPUT_AGEE;
SET OutputRoot.XMLNSC.ns:OUTPUT_FNAME.FNAME[]= PASSTHRU('SELECT FNAME FROM KING1 WHERE AGE = ?' TO Database.MBDB VALUES(CAST(InputRoot.XMLNSC.ns:INPUT_AGEE.AGE AS INTEGER)));

(OR)

SET A=CAST(InputRoot.XMLNSC.ns:INPUT_AGEE.AGE AS INTEGER);

SET OutputRoot.XMLNSC.ns:OUTPUT_FNAME.FNAME[]= PASSTHRU('SELECT FNAME FROM KING1 WHERE AGE = ?' TO Database.MBDB VALUES(A);

       
    --SET OutputRoot.XMLNSC.ns:OUTPUT_FNAME.FNAME= PASSTHRU('SELECT FNAME FROM KING1 WHERE AGE = 25');
       
        RETURN TRUE;
    END;

    CREATE PROCEDURE CopyMessageHeaders() BEGIN
        DECLARE I INTEGER 1;
        DECLARE J INTEGER;
        SET J = CARDINALITY(InputRoot.*[]);
        WHILE I < J DO
            SET OutputRoot.*[I] = InputRoot.*[I];
            SET I = I + 1;
        END WHILE;
    END;

    CREATE PROCEDURE CopyEntireMessage() BEGIN
        SET OutputRoot = InputRoot;
    END;
END MODULE;




Thursday, 14 November 2013

Working with Timer Nodes

TIMER NODES PRESENT IN WMB ARE :
1.TIMER NOTIFICATION NODE,
2.TIMER CONTROL.

WE CAN USE TIMER NOTIFICATION NODE INDEPENDENTLY BUT WHEN WE USE TIMER CONTROL NODE  WE SHOULD USE TIMER NOTIFICATION NODE.

WE CAN USE  TIMER NOTIFICATION NODE WITH MULTIPLE TIMER CONTROL NODES.(i.e ONE  TIMER NOTIFICATION NODE AND ONE OR MORE TIMER CONTROL NODES.)

WHEN WE USE  TIMER NOTIFICATION WITH  TIMER CONTROL  "UNIQUE IDENTIFIER" SHOULD BE COMMON WHICH IS COMMON PROPERTY FOR TIMER NOTIFICATION AND  TIMER CONTROL NODES.

SAMPLE OF  TIMER NOTIFICATION SCENARIO
Properties for the nodes:-
MQInput,MQOutput  :-The properties for this nodes  are as usual.

TimeOutControl:-
TimeOutNotification:-
Set the operation mode as controlled to establish a connection between TimeOutControl and TimeOutNotification.

Compute Node:-

Input Message:-

<EmpDetails>
<TimeoutRequest>
 <Action>SET</Action>
 <Identifier>ThreeTimes</Identifier>
 <StartDate>TODAY</StartDate>
 <StartTime>NOW</StartTime>
 <Interval>5</Interval>
 <Count>3</Count>
 <IgnoreMissed>TRUE</IgnoreMissed>
 <AllowOverwrite>TRUE</AllowOverwrite>
</TimeoutRequest>
<Emp>
 <EmpName>EddieNorton</EmpName>
 <EmpID>9966</EmpID>
 <EmpAge>31</EmpAge>
 <EmpSex>M</EmpSex>
 <EmpDoj>05/26/1999</EmpDoj>
</Emp>
</EmpDetails>

This message can also be taken as the below but the main thing is that some of the tag names must be given with same tag names to make the Timer node to have its functionality in a proper way.
<EmpDetails>
<Emp>
 <Action>SET</Action>
 <Identifier>ThreeTimes</Identifier>
 <StartDate>TODAY</StartDate>
 <StartTime>NOW</StartTime>
 <Interval>5</Interval>
 <Count>3</Count>
 <IgnoreMissed>TRUE</IgnoreMissed>
 <AllowOverwrite>TRUE</AllowOverwrite>
 <EmpName>EddieNorton</EmpName>
 <EmpID>9966</EmpID>
 <EmpAge>31</EmpAge>
 <EmpSex>M</EmpSex>
 <EmpDoj>05/26/1999</EmpDoj>
</Emp>
</EmpDetails>
According to the above messages the message will be sent to the Output Queue for every  5 seconds and for 3 times.

Tuesday, 5 November 2013

IMPORTANT SNIPPETS FOR JAVA COMPUTE NODE

1)
create an ESQL module in the mqsi schema. The module is then assigned to a new Compute node by using the setComputeExpression() method:

File msgFlow = new File("main.msgflow");
MessageFlow mf1 = FlowRendererMSGFLOW.read(msgFlow);
ESQLModule module = new ESQLModule();
module.setBrokerSchema("mqsi");
module.setEsqlMain("MyESQLMain");
ComputeNode compNode = new ComputeNode();
compNode.setNodeName("My Compute Node");
compNode.setComputeExpression(module);
mf1.addNode(compNode);

2)
create an ESQL module in the default schema. The setBrokerSchema() method is not required.

File msgFlow = new File("main.msgflow");
MessageFlow mf1 = FlowRendererMSGFLOW.read(msgFlow);
ESQLModule module = new ESQLModule();
module.setEsqlMain("MyESQLMain");
ComputeNode compNode = new ComputeNode();
compNode.setNodeName("My Compute Node");
compNode.setComputeExpression(module);
mf1.addNode(compNode);

3)
Discover an ESQL module from within an ESQL file by using the getEsqlModules() method. You can then use the ESQL module to set the compute expression on a Compute node by using the setComputeExpression() method.

File msgFlow = new File("main.msgflow");
MessageFlow mf1 = FlowRendererMSGFLOW.read(msgFlow);
File esql = new File("FileBatchProcessingSample_Branch.esql");
ESQLFile esqlFile = new ESQLFile(esql);
Vector<ESQLModule> esqlModules = esqlFile.getEsqlModules();
ComputeNode compNode = new ComputeNode();
compNode.setNodeName("My Compute Node");
compNode.setComputeExpression(esqlModules.get(0));
mf1.addNode(compNode);

4)
To load a message flow into memory, create a File object and use the read() method of the FlowRendererMSGFLOW, which makes the message flow available for your Java code. The read() method takes the message flow project containing the required message flow file and the relative path to the message flow file from this project.
File msgFlow = new File("../mqsi/main.msgflow");
MessageFlow mf1 = FlowRendererMSGFLOW.read(msgFlow);

5)
To rename a node, you must first access the required node. You can access the node by using the existing name of the node and the getNodeByName() method. You can then rename the node by using the setNodeName() method, which takes the new node name as a parameter.

For example:
File msgFlow = new File("main.msgflow");
MessageFlow mf1 = FlowRendererMSGFLOW.read(msgFlow);
Node mqinNode = mf1.getNodeByName("My Input Node");
mqinNode.setNodeName("New Input Node");

6)
Example to  show  how to add a new built-in node:

File msgFlow = new File("main.msgflow");
MessageFlow mf1 = FlowRendererMSGFLOW.read(msgFlow);
MQInputNode mqinNode = new MQInputNode();
mqinNode.setNodeName("My Input Node");
mqinNode.setQueueName("INPUTQ");
mf1.addNode(mqinNode);

Example to  show  how to add a new subflow node to a message flow:

  1. A new subflow node is created and assigned to object sfNode.
  2. The subflow node name is set to My Sub Flow Node.
  3. The subflow node is linked to the subflow message flow by using the setSubFlow() method.
  4. The new subflow node is added to the message flow held in object mf1.

The subflow can be stored in a .msgflow format:

  • File msgFlow = new File("main.msgflow");
    MessageFlow mf1 = FlowRendererMSGFLOW.read(msgFlow);
    File subFlow = new File("subflow.msgflow");
    MessageFlow sub1 = FlowRendererMSGFLOW.read(subFlow);
    SubFlowNode sfNode = new SubFlowNode();
    sfNode.setNodeName("My Sub Flow Node");
    sfNode.setSubFlow(sub1);
    mf1.addNode(sfNode);
The subflow can be stored in a .subflow format:

  • File msgFlow = new File("main.msgflow");
    MessageFlow mf1 = FlowRendererMSGFLOW.read(msgFlow);
    sFile subFlow = new File("subflow.subflow");
    MessageFlow sub1 = FlowRendererMSGFLOW.read(subFlow);
    SubFlowNode sfNode = new SubFlowNode();
    sfNode.setNodeName("My Sub Flow Node");
    sfNode.setSubFlow(sub1);
    mf1.addNode(sfNode);

7)
Set the position of a node on the canvas by using the setLocation() method of the node object. The following example sets the position of a new MQOutput node to coordinates x=300 pixels, y=100 pixels:

File msgFlow = new File("main.msgflow");
MessageFlow mf1 = FlowRendererMSGFLOW.read(msgFlow);
MQOutputNode mqoutNode = new MQOutputNode();
mqoutNode.setLocation(300, 100);

8)
Copy a built-in or subflow node by using the clone() method. In the following example, a new MQInput node mqinNode is created and properties on the node are set. A new MQInput node mqinNode1 is then created by copying mqinNode by using the clone() method. When the node is copied, the node properties are also copied:

File msgFlow = new File("main.msgflow");
MessageFlow mf1 = FlowRendererMSGFLOW.read(msgFlow);
MQInputNode mqinNode = new MQInputNode();
mqinNode.setNodeName("My Input Node");
mqinNode.setQueueName("INPUTQ");
MQInputNode mqinNode1 = (MQInputNode) mqinNode.clone();
mqinNode1.setNodeName("Copy of My Input Node");
mf1.addNode(mqinNode1);

9)
Remove a node you must first get the required node from the message flow object. In the following example, the getNodeByName() method is used to get the required node from message flow object mf1. The node is then removed by using the removeNode() method. When a node is removed, any connections to or from the node are also removed:

File msgFlow = new File("main.msgflow");
MessageFlow mf1 = FlowRendererMSGFLOW.read(msgFlow);
Node mqinNode = mf1.getNodeByName("My Input Node");
mf1.removeNode(mqinNode);

10)
Example  to shows how to connect two built-in nodes:

  • A MQInput node and a Collector node are created.
  • The getInputTerminal() method is used to create a dynamic Input terminal called NEWIN on the Collector node.
  • The Input terminal is connected to the Output terminal of the MQInput node by using the connect() method of the message flow object mf1.

File msgFlow = new File("main.msgflow");
MessageFlow mf1 = FlowRendererMSGFLOW.read(msgFlow);
MQInputNode mqinNode = new MQInputNode();
mqinNode.setNodeName("My Input Node");
mqinNode.setQueueName("INPUTQ");
CollectorNode colNode = new CollectorNode();
colNode.getInputTerminal("NEWIN");
mf1.connect(mqinNode.OUTPUT_TERMINAL_OUT, colNode.getInputTerminal("NEWIN"));

Example to show  how to connect a subflow node to a built-in node.

The main message flow, main.msgflow, and a Compute node in the main message flow are loaded into memory.
  • The subflow message flow, subflow.msgflow, and the subflow node in the main message flow are loaded into memory.
  • The setSubFlow() method of the subflow node is used to link the subflow message flow sub1 to the subflow node sfNode.
  • The getOutputTerminal() method is used to get the Process terminal of the subflow node. The connect() method of the message flow object is used to connect this terminal to the Input terminal of the Compute node.

File msgFlow = new File("main.msgflow");
MessageFlow mf1 = FlowRendererMSGFLOW.read(msgFlow);
ComputeNode compNode = (ComputeNode)mf1.getNodeByName("My Compute Node");
File subFlow = new File("subflow.msgflow");
MessageFlow sub1 = FlowRendererMSGFLOW.read(subFlow);
SubFlowNode sfNode = (SubFlowNode)mf1.getNodeByName("My Subflow Node");
sfNode.setSubFlow(sub1);
mf1.connect(sfNode.getOutputTerminal("Process"), compNode.INPUT_TERMINAL_IN);

11)
Example to  show  how to  add a user-defined node to a message flow and connect it to a built-in node:

  1. An MQInput node is created and added to the message flow.
  2. A user-defined node is created by using the GenericNode class and is added to the message flow object.
  3. The static output terminal of the MQInput is assigned to the variable outputTerminal.
  4. The input terminal of the user-defined node is assigned to the variable inputTerminal by using the getInputTerminal() method with the known terminal name In.
  5. The nodes are connected by using the connect() method.
  6. The final section of code shows that the input node is now available for use in the message flow, by using the getInputTerminals() method of the user-defined node instance.

File msgFlow = new File("main.msgflow");
MessageFlow mf1 = FlowRendererMSGFLOW.read(msgFlow);

MQInputNode mqinNode = new MQInputNode();
mqinNode.setNodeName("My Input Node");
mqinNode.setQueueName("IN");
mf1.addNode(mqinNode);

GenericNode myNode = new GenericNode("MyUserDefinedNode");
myNode.setNodeName("MyNode");
mf1.addNode(myNode);

OutputTerminal outputTerminal = mqinNode.OUTPUT_TERMINAL_OUT;
InputTerminal inputTerminal = myNode.getInputTerminal("In");
mf1.connect(outputTerminal, inputTerminal);

InputTerminal[] inputTerminals = myNode.getInputTerminals();
System.out.println("Input terminals on my node:");
for (int i = 0; i < inputTerminals.length; i++)
{
  InputTerminal inputTerminal = inputTerminals[i];
  System.out.println(inputTerminal.getName());
}

12)
Disconnect two nodes by using the disconnect() method of the message flow object. You must provide this method with the names of the terminal instances that you want to disconnect.

For example:
File msgFlow = new File("main.msgflow");
MessageFlow mf1 = FlowRendererMSGFLOW.read(msgFlow);
MQInputNode mqinNode = (MQInputNode)mf1.getNodeByName("My Input Node");
MQOutputNode mqoutNode = (MQOutputNode)mf1.getNodeByName("My Output Node");
mf1.disconnect(mqinNode.OUTPUT_TERMINAL_OUT, mqoutNode.INPUT_TERMINAL_IN);

13)
Example to  show how to create a UDP and add it to a message flow:

  1. A UDP called Property1 is created in parameter group Group1. The data type of the UDP is defined as a string and the UDP is given the default value Hello World!
  2. The UDP is then added to the message flow by using the addFlowProperty() method.

File msgFlow = new File("main.msgflow");
MessageFlow mf1 = FlowRendererMSGFLOW.read(msgFlow);
UserDefinedProperty udp = new UserDefinedProperty("Group1", "Property1", UserDefinedProperty.Usage.MANDATORY, UserDefinedProperty.Type.STRING, "Hello World!");
mf1.addFlowProperty(udp);

UDPs in a message flow are discovered by using the getFlowProperties() method on the message flow. The setName() method is then used to set the name of the first UDP to Property3:

File msgFlow = new File("main.msgflow");
MessageFlow mf1 = FlowRendererMSGFLOW.read(msgFlow);
Vector<FlowProperty> flowProperties = mf1.getFlowProperties();
flowProperties.get(0).setName("Property3");

14)
Rename a message flow by using the setName() method. In the following example, a message flow file called main.msgflow is renamed to mainGenerated.msgflow:

File msgFlow = new File("main.msgflow");
MessageFlow mf1 = FlowRendererMSGFLOW.read(msgFlow);
mf1.setName(mf1.getName()+"Generated");

15)
Add and update rows on the filter table of a Route node.
Adding a new row
The following example shows you how to add a new row to a filter table by using the createRow() method:
  1. The message flow and the Route node are loaded into memory.
  2. The filter table of the Route node is loaded into memory by using the getFilterTable() method of the RouteNode object.
  3. A new filter table row is created by using the createRow() method.
  4. The value of the filter pattern property on this new row is set to value="123" by using the setFilterPattern() method.
  5. The routing output terminal property is set to NEWOUT by using the setRoutingOutputTerminal() method.
  6. The new row is then added to the filter table by using the addRow() method.

File msgFlow = new File("main.msgflow");
MessageFlow mf1 = FlowRendererMSGFLOW.read(msgFlow);
RouteNode routeNode = (RouteNode)mf1.getNodeByName("My Route Node");
RouteNode.FilterTable filterTable = (RouteNode.FilterTable)routeNode.getFilterTable();
RouteNode.FilterTableRow newRow = filterTable.createRow();
newRow.setFilterPattern("value=\"123\"");
newRow.setRoutingOutputTerminal("NEWOUT");
filterTable.addRow(newRow);

Updating a row

The following example shows you how to update rows on the filter table of a Route node.
  1. The message flow, Route node, and filter table of the Route node are loaded into memory.
  2. The rows of the filter table are loaded into memory by using the getRows() method.
  3. The filter pattern property of the first row of the filter table is set to value2="456".
  4. The routing output terminal property of the first row of the filter table is set to NEWOUT2.

File msgFlow = new File("main.msgflow");
MessageFlow mf1 = FlowRendererMSGFLOW.read(msgFlow);
RouteNode routeNode = (RouteNode)mf1.getNodeByName("My Route Node");
RouteNode.FilterTable filterTable = (RouteNode.FilterTable)routeNode.getFilterTable();
Vector<RouteNode.FilterTableRow> filterTableRows = filterTable.getRows();
filterTableRows.get(0).setFilterPattern("value2=\"456\"");
filterTableRows.get(0).setRoutingOutputTerminal("NEWOUT2");