Skip to content

Sequences and Endpoints as Local Registry Entries

This sample demonstrates how sequences and endpoints can be fetched from a local registry.

Synapse configurations

Following are the integration artifacts that we can used to implement this scenario. See the instructions on how to build and run this example.

<proxy name="MainProxy" startOnLoad="true" transports="http https" xmlns="">
            <property name="direction" scope="default" type="STRING" value="incoming"/>
            <sequence key="stockquote"/>
<sequence name="stockquote" trace="disable" xmlns="">
    <!-- log the message using the custom log level. illustrates custom properties for log -->
    <log level="custom">
        <property name="Text" value="Sending quote request"/>
        <property expression="get-property('direction')" name="direction"/>
    <!-- send message to real endpoint referenced by key "simple" endpoint definition -->
        <endpoint key="simple"/>
<endpoint name="simple" xmlns="">
    <address uri="http://localhost:9000/services/SimpleStockQuoteService"/>

Build and run

Create the artifacts:

  1. Set up WSO2 Integration Studio.
  2. Create an ESB Solution project
  3. Create the stockquote sequence and the simple endpoint as local entries with the configurations given above.
  4. Also, create the proxy service named MainProxy with the configuration given above.
  5. Deploy the artifacts in your Micro Integrator.

Set up the back-end service:

  1. Download the stockquote_service.jar.
  2. Open a terminal, navigate to the location of the downloaded service, and run it using the following command:

    java -jar stockquote_service.jar

Send a message to invoke the service and analyze the mediation log on the Micro Integrator's start-up console.

You will see that the sequence and the endpoint are fetched from the local entry and that the property named direction (which was set by the proxy service) is logged by the sequence.

INFO {org.apache.synapse.mediators.builtin.LogMediator} - Text = Sending quote request, direction = incoming