LibraryToggle FramesPrintFeedback

To create the new route:

  1. Locate simple-route/src/main/resources/META-INF/spring in the Project Explorer.

  2. Delete the camel-context.xml file.

    We are going to replace this with our own route.

  3. Select simple-route/src/main/resources/META-INF/spring in the Project Explorer.

  4. Open the context menu.

  5. Select New|Camel XML File.

    The Camel XML File wizard, shown in Figure 1.4, opens.


    [Tip]Tip

    If the Camel XML File option is not in the menu, you can find it by selecting New|Other... to open the New wizard filter. The Camel XML File wizard is under Other.

  6. Enter /simple-route/src/main/resources/META-INF/spring in the Container: field.

    [Tip]Tip

    The Browse... button opens a dialog listing all of the active projects and folders from which you can choose.

  7. Enter camelContext.xml in the File Name: field.

  8. Select Spring from the Framework drop down list.

  9. Click Finish.

    The new file will open in the route editor as shown in Figure 1.5.


  10. Drag an Endpoint element (endpoint icon) from the pallet into the route square.

  11. Drag a second Endpoint element from the pallet into the route square.

  12. Select the first endpoint on the canvas.

    The property editor below the canvas will change to accept endpoint properties as shown in Figure 1.6.


  13. Enter file:src/data?noop=true in the Uri field.

  14. Select the second endpoint on the canvas.

  15. Enter file:target/messages/others in the Uri field.

  16. Click on the first endpoint and drag a connector to the second endpoint.

    When you release the cursor on the second endpoint a line will connect the two endpoints as shown in Figure 1.7.


  17. Select File|Save to save the route.

  18. Click the Source tab on the bottom of the editor canvas.

    You will see the XML for the route. The camelContext element will look like Example 1.1.


Comments powered by Disqus