This tutorial walks you through the process of tracing a message through a route.
In this tutorial you will:
run a route in the Fuse Integration perspective
enable tracing on your route
drop messages onto your route and track them through the route's nodes
To complete this tutorial you will need the simple-route
project
you updated in To Add a Content-Based Router.
To trace a message through your route:
Select Fuse Integration perspective as shown in Figure 11, “Fuse Integration perspective”).
> > > to open the![]() | Note |
---|---|
You can use the Open Perspective icon ( |
In Project Explorer, expand the
simple-route
project to expose the
src/main/resources/META-INF/spring/camel-context.xml
file.
Select camel-context.xml
file's context menu.
In Fuse JMX Navigator, expand Local Processes.
Double click Figure 12, “Route elements in Fuse JMX Navigator”).
to connect to the context and expand the elements of your route as shown inIn Fuse JMX Navigator, select from the node's context menu.
The tooling displays a graphical representation of your route in Diagram View.
In Diagram View, drag the nodes to rearrange them, so you can clearly see the route's flow paths.
![]() | Note |
---|---|
You will have to rearrange the nodes in Diagram View each time you select a different node in Fuse JMX Navigator. |
In Project Explorer, expand
simple-route/src/data
, so you can access the
message1.xml
and message2.xml
files as shown in
Figure 13, “Message files in simple-route project”.
Drag message1.xml
and drop it on
.../camel-1/Endpoints/file/src/data?noop=true
.
As the message traverses the route, the tooling traces and records its passage at each step and displays the results in Messages View.
Repeat Step 9, but this
time drag message2.xml
and drop it on .../camel-1/Endpoints/file/src/data?noop=true
.
In the bottom, right panel, switch from Console to Messages View.
In Fuse JMX Navigator, click to populate Messages View with the traces of each message.
As shown in Figure 14, “Fuse Integration perspective's message tracing components”, the tooling draws the route in Diagram View, tagging paths exiting a processing step with timing and performance metrics. Only the metric Total exchanges is displayed in the diagram. Hovering over the displayed metrics reveals additional metrics about message flow:
mean time the step took to process a message
maximum time the step took to process a message
minimum time the step took to process a message
In Messages View, click a message instance.
The associated step in the route is highlighted in Diagram View. You can step through the message instances to see how a particular message traversed the route and whether it was processed as expected at each step in the route.
The tooling displays the details about a message instance in the top half of the Properties panel and the contents of the message instance, including any headers, in the bottom half of the Properties panel. So, if your application sets headers at any step within a route, you can check whether they are set as expected.
![]() | Note |
---|---|
You can control columnar layout in all of the tooling's tables. Use the
drag method to temporarily rearrange tabular format. For example, drag a
column's border rule to expand or contract its width. To hide a column,
totally contract its borders. Drag the column header to relocate a column
within the table. If you want your arrangement to persist, use the |
When done, switch back to the Console and click the
button () in the upper, right side of its pane.
You can run the route with a JUnit test case, as described in To Test a Route with JUnit.
To learn more about message enrichment see:
the choice
, when
, and logEIP
Enterprise
Integration Patterns in Red Hat JBoss Fuse: Implementing Enterprise
Integration Patterns that comes with Red Hat JBoss Fuse.