Question

I have a wso2 esb 4.7.0 proxy with an inline endpoint and inline configurations like suspendOnFailure ormarkForSuspension.

The <markForSuspension><errorCodes>-1 (never suspend) is very important for all my endpoints. So far I need to copy/paste the whole configuration tags for each endpoint.

How can I change the default value for markForSuspension?

Then I would not have to give the whole configuration for each endpoint anymore.

<?xml version="1.0" encoding="UTF-8"?>
<proxy>
    <!-- .... -->
            <send>
                <endpoint>
                    <address uri="@@To@@">
                        <timeout>
                           <duration>30000</duration>
                           <responseAction>fault</responseAction>
                        </timeout>
                        <suspendOnFailure>
                            <errorCodes>-1</errorCodes>
                            <initialDuration>0</initialDuration>
                            <progressionFactor>1.0</progressionFactor>
                            <maximumDuration>0</maximumDuration>
                        </suspendOnFailure>
                        <markForSuspension>
                            <errorCodes>-1</errorCodes>
                        </markForSuspension>
                    </address>
                </endpoint>
            </send>
        </inSequence>
    </target>
</proxy>
Était-ce utile?

La solution

AFAIK, you cannot change the default values unless you modify the code (and recompile).

I would recommend you to create a template for you endpoint. See Sample 752

For example, you can try following configuration.

<proxy xmlns="http://ws.apache.org/ns/synapse"
       name="TestProxy"
       transports="http"
       statistics="enable"
       trace="disable"
       startOnLoad="true">
   <target>
      <inSequence>

            <send>

                <endpoint name="ep_name"
                    template="ep_template"
                    uri="@@To@@"/>

            </send>
      </inSequence>
      ...
   </target>
</proxy>

Following is the template for endpoint

<template xmlns="http://ws.apache.org/ns/synapse" name="ep_template">
   <endpoint name="$name">
      <address uri="$uri">
            <timeout>
               <duration>30000</duration>
               <responseAction>fault</responseAction>
            </timeout>
            <suspendOnFailure>
                <errorCodes>-1</errorCodes>
                <initialDuration>0</initialDuration>
                <progressionFactor>1.0</progressionFactor>
                <maximumDuration>0</maximumDuration>
            </suspendOnFailure>
            <markForSuspension>
                <errorCodes>-1</errorCodes>
            </markForSuspension>
      </address>
   </endpoint>
</template>

I hope this helps

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top