Skip to main content Skip to complementary content
Close announcements banner

Creating a Route Resource and calling it in the Route

Procedure

  1. From the repository tree view, right-click the Resources node and select Create Resource from the context menu.
  2. The New Route Resource wizard opens. In the Name field, type in a name for the Resource, for example, SetRepeatCount. Click Finish to close the wizard.
  3. Enter repeat.count=2 in the design workspace to set the repeat count.
  4. Press Ctrl+S to save your Route Resource.
  5. Right-click the Route from the repository tree view and select Manage Route Resources from the context menu.
    The Manage Route Resources wizard is opened.
  6. Click Add and select SetRepeatCount from the Resources tree view in the dialog. Click OK.
    The SetRepeatCount Route Resource is added in the table.
  7. Click OK to close the wizard.
    For more information about creating and using Route Resources, see Using Route Resources.
  8. Click the Spring tab on the lower half of the design workspace of the Route.
  9. Enter the following code in this view to call the Route Resource you just created.
    <bean id="properties" class="org.apache.camel.component.properties.PropertiesComponent">   
        <property name="location" value="classpath:SetRepeatCount.properties"/>  
    </bean>
    For more information about using Spring configuration in a Route, see Using Spring configuration.

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 – let us know how we can improve!