이 콘텐츠는 선택한 언어로 제공되지 않습니다.

Chapter 4. To Trace a Message Through a Route


Abstract

This tutorial walks you through the process of tracing a message through a route.

Goals

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

Prerequisites

To complete this tutorial you will need the simple-route project you updated in Chapter 3, To Add a Content-Based Router.

Procedure

To trace a message through your route:
  1. Select Window Open Perspective Other... Fuse Integration to open the Fuse Integration perspective as shown in Figure 4.1, “Fuse Integration perspective”).

    Figure 4.1. Fuse Integration perspective

    Note
    You can use the Open Perspective icon ( Open Perspective icon ) in the perspectives tab to access the list of available perspectives.
  2. In Project Explorer, expand the simple-route project to expose the src/main/resources/META-INF/spring/camel-context.xml file.
  3. Select Run As Local Camel Context (without tests) from the camel-context.xml file's context menu.
  4. In Fuse JMX Navigator, expand Local Processes.
  5. Double click Local Camel Context [id] to connect to the context and expand the elements of your route as shown in Figure 4.2, “Route elements in Fuse JMX Navigator”).

    Figure 4.2. Route elements in Fuse JMX Navigator

  6. In Fuse JMX Navigator, select Start Tracing from the camel-1 node's context menu.
    The tooling displays a graphical representation of your route in Diagram View.
  7. 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.
  8. In Project Explorer, expand simple-route/src/data, so you can access the message1.xml and message2.xml files as shown in Figure 4.3, “Message files in simple-route project”.

    Figure 4.3. Message files in simple-route project

  9. 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.
  10. Repeat Step 9, but this time drag message2.xml and drop it on .../camel-1/Endpoints/file/src/data?noop=true.
  11. In the bottom, right panel, switch from Console to Messages View.
  12. In Fuse JMX Navigator, click camel-1 to populate Messages View with the traces of each message.
    As shown in Figure 4.4, “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

    Figure 4.4. Fuse Integration perspective's message tracing components

  13. 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 View Menu Configure Columns... method instead. To access it, click the View Menu icon icon on the panel's menu bar.
  14. When done, switch back to the Console and click the stop button ( Stop icon ) in the upper, right side of its pane.

Next steps

You can run the route with a JUnit test case, as described in Chapter 5, To Test a Route with JUnit.

Further reading

To learn more about message enrichment see:
맨 위로 이동
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2025 Red Hat