问题
What exactly is the transport scope in Property mediators in WSO2 esb?
Is it thread safe? That is, if the scope is marked as transport, is this local to the current execution of the proxy ?
There does not seem to be enough documentation on this.
回答1:
Bellow information is extracted from the WSO2 ESB document itself and it has been documented. It is noting to do with the thread safe but more towards integration config level scope.
Scope
The scope at which the property will be set or removed from. Possible values are as follows.
Synapse: This is the default scope. The properties set in this scope last as long as the transaction (request-response) exists.
Transport: The properties set in this scope will be considered transport headers. For example, if it is required to send an HTTP header named 'CustomHeader' with an outgoing request, you can use the property mediator configuration with this scope.
Axis2: Properties set in this scope have a shorter life span than those set in the Synapse scope. They are mainly used for passing parameters to the underlying Axis2 engine
axis2-client: This is similar to the Synapse scope. The difference between the two scopes is that the axis2-client scope can be accessed inside the mediate() method of a mediator via a customs mediator created using the Class mediator. See axis2-client for further information.
Operation: This scope is used to retrieve a property in the operation context level. See XPath Extension Functions for a detailed explanation of each scope.
回答2:
When you specify a property in transport scope, the property is considered as a transport header. For example, you can use transport scope to retrieve an HTTP header in an HTTP request. Similarly you can also set a custom HTTP header in the response using a property with transport scope.
The properties are local to the the proxy.
See "Scope" in Property Mediator (WSO2 ESB Docs).
来源:https://stackoverflow.com/questions/34269918/what-exactly-is-the-transport-scope-in-property-mediators-in-wso2-esb