camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "S. Ali Tokmen" <>
Subject Full implementation of the Registry / Repository service
Date Wed, 10 Dec 2008 08:11:57 GMT

I've been working on integrating a registry/repository support into 
CAMEL. The current implementation uses XML files, later it should also 
be linked with real-life repositories (Galaxy, OW2 Registry, ...). The 
implementation is now complete, and here's how I've done it:

    * To use the registry, I use the Spring camel-context XML file and
      map the "registry:" protocol to the lookup class:

      <!-- The registry component, configured as a File Registry -->
      <bean id="registry" class="test.FileRegistryComponent">
          <property name="file" value="registry.xml"/>
    * The file-based registry/repository is an XML file:

      <?xml version="1.0" encoding="UTF-8"?>
      <registry xmlns="custom:FileRegistry"
          xsi:schemaLocation="custom:FileRegistry FileRegistry.xsd">

      The XSD for the XML is attached.
    * Finally, you simply prefix your endpoint with "registry:" to point
      it to a registry/repository entry. For example, in DSL:

      from("registry:queue").process(new Processor() {
          public void process(Exchange e) {
              // Convert JMS message content into WS request
              final List<String> params = new ArrayList<String>();
              e.getIn().setHeader(CxfConstants.OPERATION_NAME, "hello");
              String body = e.getIn().getBody(String.class);

I'm attaching the registry/repository's Java implementation. Any 
comments are welcome.

PS: I know that based on the fact that I'm using an XSD schema I could 
have also used the JAXB APIs to match XML files to Java classes (tools 
automatically do it, so why bother!). If you think that's better, I 
could well switch to that as well.

PPS: When CAMEL 1.5.1 will be out, the parent class that's used for the 
registry will be RefComponent. The modification is minor, but neat.

Do you think this can be commited into the CAMEL examples?



S. Ali Tokmen

Office: +33 4 76 29 76 19
GSM:    +33 66 43 00 555

Bull, Architect of an Open World TM

View raw message