This documentation is for WSO2 Enterprise Service Bus version 5.0.0. For the latest ESB, view the latest WSO2 Enterprise Integrator documentation.

All docs This doc
Skip to end of metadata
Go to start of metadata

The Respond Mediator stops the processing on the current message and sends the message back to the client as a response.


The respond token refers to a <respond> element, which is used to stop further processing of a message and send the message back to the client.


UI Configuration

As with other mediators, after adding the Respond mediator to a sequence, you can click its up and down arrows to move its location in the sequence.


Assume that you have a configuration that sends the request to the Stock Quote service and changes the response value when the symbol is WSO2 or CRF. Also assume that you want to temporarily change the configuration so that if the symbol is CRF, the ESB just sends the message back to the client without sending it to the Stock Quote service or performing any additional processing. To achieve this, you can add the Respond mediator at the beginning of the CRF case as shown below. All the configuration after the Respond mediator is ignored. As a result, the rest of the CRF case configuration is left intact, allowing you to revert to the original behavior in the future by removing the Respond mediator if required.

<definitions xmlns="">
  <sequence name="main">
      <switch source="//m0:getQuote/m0:request/m0:symbol" xmlns:m0="http://services.samples">
        <case regex="WSO2">
          <property name="symbol" value="Great stock - WSO2"/>
              <address uri="http://localhost:9000/services/SimpleStockQuoteService"/>
        <case regex="CRF">


          <property name="symbol" value="Are you sure? - CRF"/>
                <address uri="http://localhost:9000/services/SimpleStockQuoteService"/>
          <property name="symbol"
            expression="fn:concat('Normal Stock - ', //m0:getQuote/m0:request/m0:symbol)" 
  • No labels