1. Proxies and Flow

router

Membrane API Gateway's main object.

The router is a Spring Lifecycle object: It is automatically started and stopped according to the Lifecycle of the Spring Context containing it. In Membrane's standard setup Membrane itself controls the creation of the Spring Context and its Lifecycle.

In this case, the router is hot deployable: It can monitor proxies.xml, the Spring configuration file, for changes and reinitialize the Spring Context, when a change is detected. Note that, during the Spring Context restart, the router object itself along with almost all other Membrane objects (interceptors, etc.) will be recreated.

Router must be a singleton with just one instance. Membrane should never have more than one router.


Can be used in:

Syntax

<router
	exchangeStore="string"
	hotDeploy="[true,false]"
	adjustHostHeader="[true,false]"
	indentMessage="[true,false]"
	adjustContentLength="[true,false]"
	trackExchange="[true,false]" />

Sample

<beans>
<router
  exchangeStore="memoryExchangeStore"
  adjustHostHeader="true"
  indentMessage="true"
  adjustContentLength="true" />
</beans>

Attributes

NameRequiredDefaultDescriptionExamples
exchangeStore false create a {@link LimitedMemoryExchangeStore} limited to the size of 1 MB.
Spring Bean ID of an {@link ExchangeStore}. The exchange store will be used by this router's components ({@link AdminConsoleInterceptor}, {@link ExchangeStoreInterceptor}, etc.) by default, if no other exchange store is explicitly set to be used by them.
-

Child Elements

ElementsDescriptionCardinality
configuration 0..1
httpClientConfig A 'global' (per router) <httpClientConfig>. This instance is used everywhere a HTTP Client is used. In every specific place, you should still be able to configure a local <httpClientConfig> (with higher precedence compared to this global instance). 0..1
transport Used to override the default 'transport' chain. The transport chain is the one global interceptor chain called *for every* incoming HTTP Exchanges. The transport chain uses to call 'down' to a specific , or similar. The default transport chain is shown in proxies-full-sample.xml . 0..1
global Sets a global chain that applies to all requests and responses. 0..1
internal 0..*
api 0..*
soapProxy 0..*

Other optional Child Elements

stompProxy, serviceProxy, sslProxy, proxy