If you are migrating subflows from earlier versions of WebSphere® Message Broker,
you need to understand how to define a subflow created as a .msgflow file in WebSphere Message Broker Version 8.
You can add subflows created as a
.msgflow file into your message flows if either of the following statements
is true:
- The subflow that you want to add to a message flow is defined
in a library.
Applications and services can reference libraries.
Note: A library is a logical grouping of related code, data, or both that
typically contains reusable subflows, and other type of resources.
- The subflow that you want to add to a message flow is defined
in the same Message Broker project, application, or service as the
message flow.
During the development phase, in the WebSphere Message Broker Toolkit, you can
define a subflow once, and then reuse it in more than one message
flow.
- If you use a subflow in multiple message flows that are defined
in one or more Message Broker projects, you can define the subflow
within a library. This library can be referenced by any Message Broker
project that needs access to the resources it contains.
- If you use a subflow in multiple message flows that are defined
within the same Message Broker project, you can define the subflow
within the Message Broker project.
Note: When the WebSphere Message Broker run time encounters a subflow within
a message flow, it creates a copy of all the message flow nodes that
define that subflow. If the subflow is used more than once, it creates
a copy of all the message flow nodes that define the subflow every
time it occurs. This increases resource usage, which can affect your
overall message flow performance.
Types of subflows supported
In WebSphere Message Broker Version 8, you
can create a subflow as a .subflow file or as
a .msgflow file.
Note: If you have migrated
subflows from earlier versions of WebSphere Message Broker Version 8, you have subflows created
as .msgflow files.
Subflow content
You define subflow content
in the same way as you define message flow content, by adding, configuring,
and connecting message flow nodes.
A subflow can have one or
more input nodes, and zero, one or more output nodes.
- If you want to use a subflow as the first node in your message
flow, you need to add at least one Input node, such as the MQInput
node, and one generic Output node.
- If you want to use a subflow in the middle of a message flow,
you need to add at least one generic Input node. You only need to
add a generic Output node if you want to connect additional nodes
in the message flow after you add the subflow.
- If you want to use a subflow as the last node in a message flow,
you need to add at least one generic Input node, and at least one
Output node, such as the MQOutput node.
Subflows created as .msgflow files
are grouped in the folder named Message Flow within your application, service, or Message Broker project. The
following figure illustrates where you can find subflows created as .msgflow files:
For subflows created as a .msgflow file, WebSphere Message Broker creates
a blank flow to which you can add the message flow nodes that you
need.
Design considerations
When you define the
message flow nodes in a subflow created as a
.msgflow file, you should consider the following recommendations:
- Define subflows in libraries. Create references to a library from
your Message Broker projects to be able to reuse the common logic.
- Limit the number of nested subflows.
- Group logic that is defined in consecutive compute nodes into
one single compute node. This will improve performance, since the
number of nodes loaded at runtime will be reduced.
- Add a version to the subflow.
- Do not nest subflows of different types, that is, do not add a
subflow created as a .msgflow file into a subflow
created as a .subflow file or vice versa.
Development considerations
In WebSphere Message Broker releases earlier
than version 8, you create message flows and other resources within
Message flow projects.
Note: Message flow projects have been renamed
to Message Broker projects in WebSphere Message Broker Version 8.
You create reusable
logic as a message flow. You embed message flows into message flows.
Note: WebSphere Message
Broker releases earlier than version 8 only supported subflows created
as a .msgflow file. However, if you plan to develop
new integration solutions, you should create subflows created as a .subflow file. You should convert your subflows created
as .msgflow files into subflows created as .subflow files.