Many routing patterns rely on references to Java objects (beans) for configuration or for implementation details. You add the beans into the routing context file using the route editor's Source view.
To add beans to your routing context file:
Open your routing context file in the route editor.
Click the Source tab at the bottom of the route editor's canvas to switch to Source view, so you can edit the XML that defines the route.
Enter the bean elements needed by your route before
the camelContext element.
![]() | Note |
|---|---|
Use the |
For example:
<!-- Configure the Inbound SAP Connections --> <bean id="sap-configuration" class="org.fusesource.camel.component.sap.SapConnectionConfiguration" activation="eager"> <property name="destinationDataStore"> <map> <entry key="quickstartDest" value-ref="quickstartDestinationData" /> </map> </property> <property name="serverDataStore"> <map> <entry key="quickstartServer" value-ref="quickstartServerData" /> </map </property> </bean> ... <camelContext trace="false" id="sap-srfc-destination-fuse-context" xmlns="http://camel.apache.org/schema/blueprint"> <route id="sap-srfc-destination-fuse-route"> <from uri="file:work/camel-sap/input"/> <convertBodyTo type="java.lang.String"/> <log message="${body}" loggingLevel="INFO"/> <to uri="sap-srfc-destination:quickstartDest:BAPI_FLCUST_GETLIST"/> <log message="${body}" loggingLevel="INFO"/> </route> </camelContext>
Save your changes by selecting > on the menu bar.
Click the Design tab at the bottom of the route editor's canvas to return to Design view and the route diagram.
| The Source View |
| Adding global endpoints and data formats |
| Apache Camel Development Guide, Part IV Programming EIP Components |