Skip to main content Skip to complementary content

Configuring the components and connections

Procedure

  1. Double-click the cFile component, which is labeled Source, to display its Basic settings view in the Component tab.
  2. In the Path field, specify the file path to the message source.
    From the Encoding list, select the encoding type of your source files, and leave all the other parameters as they are.
  3. Double-click the cIdempotentComsumer component, which is labeled Deduplicator, to display its Basic settings view in the Component tab.
  4. From the Repository Type list, select between Memory and File to specify where the message identifiers will be stored before the deduplication process. For this scenario, select File.
    In the File store field, specify the location of the file storing message identifiers.
    In the Expression field, enter an expression to filter the messages. In this scenario, enter the following expression to filter the messages according to the person node of the XML files: xpath("/people/person"), and leave all the other parameters as they are. Alternatively, you can select the Use language check box, select XPath from the Language list, and enter "/people/person" in the Predicate field.
  5. Double-click the cProcessor component labeled Unique to display its Basic settings view in the Component tab.
  6. In the Code area, customize the code to display the file name of the message that passes the deduplication:
    System.out.println("Message consumed on Unique: "+
    exchange.getIn().getHeader("CamelFileName"));
  7. Repeat these steps to configure the other cProcessor component, which is labeled All, to display the file names of all the messages coming from the source:
    System.out.println("Message consumed on All: "+
    exchange.getIn().getHeader("CamelFileName"));
  8. Press Ctrl+S to save your Route.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!