WebSphere Message Broker, Version 8.0.0.7 Operating Systems: AIX, HP-Itanium, Linux, Solaris, Windows, z/OS

See information about the latest product version

Loading an existing message flow into memory

Use the Message Broker Java™ API when developing message flow applications to load a message flow into memory. You can then access the message flow in your Java code.

You must load a message flow into memory to use it with the Message Broker Java API methods within your Java code. 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.
The following example shows how to load a message flow that is in the mqsi directory:
import java.io.File;
import java.io.IOException;
import com.ibm.broker.MessageBrokerAPIException;
import com.ibm.broker.config.appdev.MessageFlow;
import com.ibm.broker.config.appdev.FlowRendererMSGFLOW;

public class LoadMessageFlow {
    public static void main(String[] args) {
        File msgFlow = new File("../mqsi/main.msgflow");
        try {
            MessageFlow mf1 = FlowRendererMSGFLOW.read(msgFlow);
        } catch (IOException e) {
            // Add your own code here
            e.printStackTrace();
        } catch (MessageBrokerAPIException e) {
            // Add your own code here
            e.printStackTrace();
        }
    }
}	

Result:

You can now refer to the instance of the MessageFlow object in your Java code.
Notices | Trademarks | Downloads | Library | Support | Feedback

Copyright IBM Corporation 1999, 2016Copyright IBM Corporation 1999, 2016.

        
        Last updated:
        
        Last updated: 2016-05-23 14:47:55


Task topicTask topic | Version 8.0.0.7 | bc31540_