transport

Version

The transport receives messages from clients and invokes interceptors in the request and response flow. The interceptors that are engaged with the transport are global and are invoked for each message flowing through the router.

Syntax

<transport coreThreadPoolSize="integer"
socketTimeout="integer"
tcpNoDelay="[true,false]"
httpClientRetries="integer"
autoContinue100Expected="[true,false]"
printStackTrace="[true,false]">

<interceptors>
[interceptors]*
</interceptors>
</transport>
<transport coreThreadPoolSize="integer"
  socketTimeout="integer"
  tcpNoDelay="[true,false]"
  httpClientRetries="integer"
  autoContinue100Expected="[true,false]"
  printStackTrace="[true,false]">
  <interceptors>
	[interceptors]*
  </interceptors>
</transport>

Sample

<beans>
<transport coreThreadPoolSize="20">
<ruleMatching />
<dispatching />
<userFeature />

<transform xslt="strip.xslt" />
<wsdlRewriter />

<httpClient />
</transport>
</beans>
<beans>
  <transport coreThreadPoolSize="20">
	<ruleMatching />
	<dispatching />
	<userFeature />

	<transform xslt="strip.xslt" />
	<wsdlRewriter />

	<httpClient />
  </transport>
</beans>

Attributes

NameRequiredDefaultDescriptionExamples
backlogfalse50The backlog value passed to {@link java.net.ServerSocket#ServerSocket(int, int, InetAddress)}. The maximum length of the queue of incoming connections.-
concurrentConnectionLimitPerIpfalse-1 No LimitLimits the number of concurrent connections from one ip-
coreThreadPoolSizefalse20

Membrane uses a thread pool to allocate threads to incomming clients connections. The core thread pool size is the minimum number of threads that are created in advance to serve client requests.

5
forceSocketCloseOnHotDeployAfterfalse30000When proxies.xml is changed and <router hotDeploy="true">, the Spring Context is automatically refreshed, which restarts the {@link Router} object (=Membrane API Gateway). Before the context refresh, all open socket connections have to be closed. Exchange objects which are still running might delay this process. Setting forceSocketCloseOnHotDeployAfter to a non-zero number of milliseconds forces connections to be closed after this time.-
maxThreadPoolSizefalseno limitMaximum number of threads to handle incoming connections. (Membrane uses 1 thread per incoming connection.)300
printStackTracefalsefalseWhether the stack traces of exceptions thrown by interceptors should be returned in the HTTP response.-
reverseDNSfalsetrueWhether the remote address should automatically reverse-looked up for incoming connections.-
socketTimeoutfalse30000Socket timout in ms.-
tcpNoDelayfalsetrueWhether to use the "TCP no delay" option. (=A TCP/IP packet should be constructed as soon as any data has been written to the network buffer. With "TCP no delay" set to false, the network hardware waits a short period of time wether the software will write more data. When the packet constructed from the data in the buffer would exceed the MTU in size, the packet is always constructed and sent immediately.)-

Child Elements

ElementDescriptionCardinality
abortInterceptors are usually applied to requests and responses. In case of errors, interceptors can initiate the abort flow to safely shut down Membrane. By nesting interceptors into an Element you can limit their application to abort flows only.0..*
accessControlBlocks requests whose origin TCP/IP address (hostname or IP address) is not allowed to access the requested resource.0..*
accessLogWrites exchange metrics into a Log4j appender0..*
accountRegistrationAllows account registration (!Experimental!)0..*
acmeHttpChallengeSee the documentation of the <acme /> element for usage details.0..*
adminConsoleDisplays up-to-date statistics, recent exchanges and, by default, allows live modification of Membrane's configuration.0..*
apiKeySecures APIs by validating keys stored in either files or proxies.xml. Keys can be received from clients via HTTP headers or URL query parameters. Additional permission checks are possible through scope validation - scopes are loaded into an Exchange property and can be checked using the "hasScope()" SpEL function.0..*
balancerPerforms load-balancing between several nodes. Nodes sharing session state may be bundled into a cluster.0..*
basicAuthenticationBlocks requests which do not have the correct RFC 1945 basic authentication credentials (HTTP header "Authentication: Basic ....").0..*
beautifierBeautifies request and response bodies. Supported are the Formats: JSON, XML0..*
cacheDon't use, this does NOT implement valid HTTP caching.0..*
clamavDelegates virus checks to an external Virus Scanner.0..*
clusterNotificationReceives control messages to dynamically modify the configuration of a {@link LoadBalancingInterceptor}.0..*
dispatchingThis interceptor adds the destination specified in the target element to the list of destinations of the exchange object. It must be placed into the transport to make Service Proxies Work properly. It has to be placed after the ruleMatching interceptor. The ruleMatching interceptor looks up a service proxy for an incoming request and places it into the exchange object. The dispatching interceptor needs the service proxy to get information about the target.0..*
exchangeStoreAdds the current state of HTTP requests and responses to an "exchange store".0..*
formValidationUsing the formValidation interceptor you can validate the input of HTML forms.0..*
graphQLProtectionCheck GraphQL-over-HTTP requests, enforcing several limits and/or restrictions. This effectively helps to reduce the attack surface.0..*
groovyExecutes a Groovy script. The script can access and manipulate data from the request and response. Use this or the Javascript plugin to extend the functions of Membrane by scripting. See: example/groovy for working samples0..*
groovyTemplateUses the groovy template markup engine to produce HTML-based responses. <groovyTemplate><![CDATA[ html { head { title('Resource') } body { p('Hello from Membrane!') } } ]]></groovyTemplate>0..*
headerFilterRemoves message headers matching a list of patterns. The first matching child element will be acted upon by the filter.0..*
httpClientThe httpClient sends the request of an exchange to a Web Server using the HTTP protocol. Usually it will be globally used inside the transport. However, it is also possible to use it inside a proxy to give the proxy an individual configuration for its outgoing HTTP connection that is different from the global configuration in the transport.0..*
ifThe "if" interceptor supports conditional execution of a group of executors.0..*
indexThe index feature lists available proxys at a simple Web page. To use this feature just add a serviceProxy containing the index element. Of course you can protect the service proxy by using SSL or Username and Password.0..*
javascriptExecutes a Javascript. The script can access and manipulate data from the request and response. Use this or the Groovy plugin to extend the functions of Membrane by scripting. See the samples in examples/javascript.0..*
json2XmlIf enabled converts body content from json to xml.0..*
jsonPointerExtractorBased on JSON pointer. The interceptor takes values from JSON request body and puts them into Exchange object as properties. If the pointer is not found, an exception will be thrown (resulting in {@link Outcome#ABORT}).0..*
kubernetesValidationKubernetes Integration is still experimental.0..*
limitLimits the maximum length of a HTTP message body.0..*
logThe log feature logs request and response messages to the log4j framework. The messages will appear either on the console or in a log file depending on the configuration of the conf/log4j2.xml file.0..*
loginThe login interceptor can be used to restrict and secure end user access to an arbitrary web application.0..*
oauth2ResourceAllows only authorized HTTP requests to pass through. Unauthorized requests get a redirect to the authorization server as response.0..*
oauth2Resource2Allows only authorized HTTP requests to pass through. Unauthorized requests get a redirect to the authorization server as response.0..*
rateLimiterThe rateLimiter plugin limits the number of requests of a client in a period of time. As a default the client requests are grouped by client-Ip address and then counted. There are lots of possibilities to group the requests using the keyExpression. The requests can even be counted from different clients together.0..*
regExReplacerRuns a regular-expression-replacement on either the message body (default) or all header values.0..*
requestInterceptors are usually applied to requests and responses. By nesting interceptors into a Element you can limit their application to requests only.0..*
responseInterceptors are usually applied to requests and responses. By nesting interceptors into a Element you can limit their application to responses only.0..*
rest2SoapConverts REST requests into SOAP messages.0..*
returnTerminates the exchange flow. The returned response is determined in the following order:0..*
reverseProxyingRewrites the scheme, hostname and port in the "Location" header in HTTP responses, as well as in the "Destination" header in HTTP requests. The rewriting reflects the different schemes, hostnames and ports used to access Membrane vs. the target HTTP server.0..*
rewriterRewrites or redirects the path of incoming requests based on a mapping.0..*
shutdownShutdown interceptor.0..*
soap2RestConverts SOAP messages into REST requests.0..*
soapStackTraceFilterThe soapStackTraceFilter removes SOAP stack traces from message bodies.0..*
spdyAllow HTTP protocol upgrades to the SPDY protocol. After the upgrade, the connection's data packets are simply forwarded and not inspected.0..*
statisticsCSVWrites statistics (time, status code, hostname, URI, etc.) about exchanges passing through into a CSV file (one line per exchange).0..*
statisticsJDBCWrites statistics (time, status code, hostname, URI, etc.) about exchanges passing through into a database (one row per exchange).0..*
swaggerRewriterAllow Swagger proxying0..*
switchChanges an exchange's target based on a series of XPath expressions.0..*
tcpAllow HTTP protocol upgrades to the TCP protocol. After the upgrade, the connection's data packets are simply forwarded and not inspected.0..*
templateRenders the body content of a message from a template. The template can produce plain text, Json or XML. Variables in the template are substituted with values from the body, header, query parameters, etc. If the extension of a referenced template file is .xml it will use XMLTemplateEngine otherwise StreamingTemplateEngine. Have a look at the samples in examples/template.0..*
throttleThe throttle feature can slow down traffic to thwart denial of service attacks.0..*
transformThe transform feature applies an XSLT transformation to the content in the body of a message. After the transformation the body content is replaced with the result of the transformation.0..*
urlNormalizerReplaces "/./" in the request URI's path by "/".0..*
webServerServes static files based on the request's path.0..*
webSocketAllow HTTP protocol upgrades to the WebSocket protocol. After the upgrade, the connection's data packets are simply forwarded and not inspected.0..*
wsdlPublisherThe wsdlPublisher can be used to serve WSDL files (and attached XML Schema Documents), if your backend service does not already do so.0..*
wsdlRewriterThe wsdlRewriter rewrites endpoint addresses of services and XML Schema locations in WSDL documents.0..*
xml2JsonIf enabled converts body content from xml to json.0..*
xmlContentFilterThe xmlContentFilter removes certain XML elements from message bodies. The elements are described using an XPath expression.0..*
xmlProtectionProhibits XML documents to be passed through that look like XML attacks on older parsers. Too many attributes, too long element names are such indications. DTD definitions will simply be removed.0..*
xpathExtractorBased on xpath it takes values from xml in request and puts them in exchange as properties0..*

Can be used in