Accessing SwitchYard bean services from Camel route

Solution Verified - Updated -

Environment

  • Red Hat JBoss Fuse (Fuse)
    • 6.2
  • Red Hat JBoss Fuse Service Works (FSW)
    • 6.0
  • SwitchYard

Issue

  • In a SwitchYard project, I saw that it is possible to access a SwitchYard service of type Camel via the URL "switchyard://serviceName".
  • How can I configure a SwitchYard bean in a way that it could be used in a Camel component by adding generic endpoit with URL of "switchyard://mySwitchyardBean"?
  • Do I need to expose that bean? Can you provide a working example?

Resolution

Any SwitchYard components and references can be consumed from a SwitchYard Camel service using the endpoint 1"switchyard://..."1. The services to be consumed do not need to be exposed externally so long as the consuming services and consumed services are in the same SwitchYard application, that is, within the same switchyard.xml.

Refer to the following guide for more details:

The SwitchYard quickstarts have a plenty of examples for such kind of use cases. For instance, you may refer to the "rules-camel-cbr" quickstart.

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments