com.atlassian.confluence.content.render.xhtml.migration.exceptions.UnknownMacroMigrationException: The macro 'next_previous_links' is unknown.

Sample 451: Conditional URL Rewriting

Note that WSO2 EI is shipped with the following changes to what is mentioned in this documentation:

  • <PRODUCT_HOME>/repository/samples/ directory that includes all Integration profile samples is changed to <EI_HOME>/samples/service-bus/.
  • <PRODUCT_HOME>/repository/samples/resources/ directory that includes all artifacts related to the Integration profile samples is changed to <EI_HOME>/samples/service-bus/resources/.

Objective: Demonstrate the ability of the /wiki/spaces/EI6xx/pages/49612817 to evaluate conditions on messages and perform rewrites based on the results.

<definitions xmlns="http://ws.apache.org/ns/synapse">

    <sequence name="main">
        <in>
            <rewrite>
                <rewriterule>
                    <condition>
                        <and>
                            <equal type="url" source="host" value="localhost"/>
                            <not>
                                <equal type="url" source="protocol" value="https"/>
                            </not>
                        </and>
                    </condition>
                    <action fragment="protocol" value="https"/>
                    <action fragment="port" value="9002"/>
                </rewriterule>
            </rewrite>
            <send/>
        </in>
        <out>
            <send/>
        </out>
    </sequence>

</definitions>

Prerequisites:

  • Deploy the SimpleStockQuoteService in sample Axis2 server and start it on port 9000.
  • Create the above configuration and deploy it in the WSO2 EI profile, see Working with WSO2 Integration Studio.

Invoke the Axis2 client and send some requests to ESB with different address URL values. If the address URL value contains localhost as the hostname and https as the protocol prefix, ESB will route the message as it is. But if the hostname is localhost and the protocol is not https, Synapse will rewrite the URL by setting https as the protocol. The port number will also be set to the HTTPS port of the Axis2 server.

The condition evaluation feature is provided by the Synapse evaluator framework. Currently one can evaluate expressions on URL values, query parameters, transport headers, properties and SOAP envelope content using this framework. Hence URL rewriting can be done based on any of these aspects.

com.atlassian.confluence.content.render.xhtml.migration.exceptions.UnknownMacroMigrationException: The macro 'next_previous_links2' is unknown.