Swiftlet Name
The Swiftlet name of the RoutingSwiftlet is sys$routing.
Default Socketfactory Class
Optional property that specifies the default socket factory that should be used if no other property is defined.
SwiftMQ includes a socket factory for plain sockets named com.swiftmq.net.PlainSocketFactory, and one for SSLv3 sockets named com.swiftmq.net.JSSESocketFactory.
The default value for this property is com.swiftmq.net.PlainSocketFactory.
Property definition:
swiftlet.sys$routing.socketfactory.class=<class name>
|
Example:
swiftlet.sys$routing.socketfactory.class=com.swiftmq.net.JSSESocketFactory
|
Connectors
Connectors are connections that are established from the local to a remote router.
Connector names are defined as a list of names. The names are only placeholders and can be of any value as they are not the router names for the destination router. For every defined connector, sub-properties can be defined as described in the following sections.
Property definition:
swiftlet.sys$routing.connectors.names=<name 1>,<name 2>,..,<name n>
|
Example:
swiftlet.sys$routing.connectors.names=router1,router2,router3,router4
|
Keep-Alive Interval
Specifies the interval in which keepalive messages are sent by this connector. These messages make sure that SwiftMQ detects half open socket connections and closes them accordingly. Keepalive messages are necessary in addition to connections, tunneled by HTTP, as, in general, HTTP proxies close socket connections by which no data is transported (idle connections).
If keepalive should be deactivated, e. g. to avoid permanent re-dial on dial-up connections, the value 0 is to be defined.
The default value to this property is 60000 (1 minute).
Property definition:
swiftlet.sys$routing.connectors.<name>.keepalive.interval=<long>
|
Example:
swiftlet.sys$routing.connectors.plainsocket.keepalive.interval=30000
|
Destination Host
Specifies the destination's DNS host name.
Property definition:
swiftlet.sys$routing.connectors.<name>.hostname=<hostname>
|
Example:
swiftlet.sys$routing.connectors.router1.hostname=gate.swiftmq.com
|
Destination Port
Specifies the destination's port number.
Property definition:
swiftlet.sys$routing.connectors.<name>.port=<integer>
|
Example:
swiftlet.sys$routing.connectors.router1.port=4101
|
Connector Line Compression
Optional property that specifies if messages (including headers) should be compressed before sending them to the line and decompressed after receiving them from the line. This is an ingenious mode for low-speed connections (e.g. via modem) transferring mostly uncompressed message bodies. Due to default messagebody compression, this case is rare.
The corresponding remote router must have the same setting for this property.
The default value for this property is false.
Property definition:
swiftlet.sys$routing.connectors.<name>.compression.enabled=<boolean>
|
Example:
swiftlet.sys$routing.connectors.router1.compression.enabled=true
|
Connector Socket Factory Class
Optional property that specifies the socket factory of the destination to be used. See Section Default Socket Factory for further details.
The corresponding remote router must have the same setting for this property.
The default value for this property is the default socket factory.
Property definition:
swiftlet.sys$routing.connectors.<name>.socketfactory.class=<classname>
|
Example:
swiftlet.sys$routing.connectors.router1.socketfactory.class=com.swiftmq.net.JSSESocketFactory
|
Connector Retry Time
Optional property that specifies the time in milliseconds to retry a connection if the attempt has failed or if the connection has been terminated. This guarantees that a routing connection will be re-established, if possible, within this time.
The default value for this property is 60000 (1 minute).
Property definition:
swiftlet.sys$routing.connectors.<name>.retrytime=<long>
|
Example:
swiftlet.sys$routing.connectors.router1.retrytime=360000
|
Listener
Listeners listens on a specific port for inbound routing connections.
Listeners are defined as a list of names. For every defined listener, sub-properties can be defined as described in the following sections.
Property definition:
swiftlet.sys$routing.listeners.names=<name 1>,<name 2>,..,<name n>
|
Example:
swiftlet.sys$routing.listeners.names=plainsocket,sslsocket
|
Keep-Alive Interval
Specifies the interval, in which keepalive messages are sent by this listener. These messages make sure that SwiftMQ detects half open socket connections and closes them accordingly. Keepalive messages are necessary in addition to connections, tunneled by HTTP, as, in general, HTTP proxies close socket connections by which no data is transported (idle connections).
If keepalive should be deactivated, e. g. to avoid permanent re-dial on dial-up connections, the value 0 is to be defined.
The default value to this property is 60000 (1 minute).
Property definition:
swiftlet.sys$routing.listeners.<name>.keepalive.interval=<long>
|
Example:
swiftlet.sys$routing.listeners.plainsocket.keepalive.interval=30000
|
Listener Port
Specifies the listener's port number.
Property definition:
swiftlet.sys$routing.listeners.<name>.port=<integer>
|
Example:
swiftlet.sys$routing.listeners.plainsocket.port=4000
|
Listener Line Compression
Optional property that specifies if messages (including headers) should be compressed before sending them to the line and decompressed after receiving them from the line. This is an ingenious mode for low-speed connections (i.e. via modem) transferring mostly uncompressed message bodies. Due to default messagebody compression, this case is rare.
The corresponding remote router must have the same setting for this property.
The default value for this property is false.
Property definition:
swiftlet.sys$routing.listeners.<name>.compression.enabled=<boolean>
|
Example:
swiftlet.sys$routing.listeners.plainsocket.compression.enabled=true
|
Listener Socketfactory Class
Optional property that specifies the socket factory this inbound listener should use. See Section Default Socket Factory for further details.
The corresponding remote router must have the same setting for this property.
The default value for this property is the default socket factory.
Property definition:
swiftlet.sys$routing.listeners.<name>.socketfactory.class=<classname>
|
Example:
swiftlet.sys$routing.listeners.sslsocket.socketfactory.class=com.swiftmq.net.JSSESocketFactory
|
Listener Host Access List
Optional property that specifies a list of host DNS hostnames to which the access to this inbound listener is restricted. Connections from hosts not included in this access list will be rejected.
The hostnames are SQL-Like predicates. Wildcards as %.swiftmq.com or secure.%.com can be specified.
The default value for this property is empty, so every host can be connected.
Property definition:
swiftlet.sys$routing.listeners.<name>.hostaccesslist.names=<host 1>,<host 2>,..,<host n>
|
Example:
swiftlet.sys$routing.listeners.sslsocket.hostaccesslist.names=secure.swiftmq.com,\ secure.iit.de,\ dev__33%.exchange.de
|
Static Routes
Optional property that defines static routes to remote routers. Without setting this property a remote router (with his resources) becomes available while receiving a route via direct or indirect connections. Without a route, a remote router is unknown. To avoid this, static routes can be defined and messages can be sent from producers to destinations regardless of their connection. If a connection is established later, the messages will then be delivered.
Property definition:
swiftlet.sys$routing.staticroute.routers.names=<routername 1>,<routername 2>,..,<routername n>
|
Example:
swiftlet.sys$routing.staticroute.routers.names=router1,router2,router3
|
Defining Route Filters
In a connected router network, each router is known. For example, if there is a network of 3 routers, namely R1, R2, R3, connected as a ring (R1->R2->R3->R1), then each of them gets the following routes:
Router | Destination Router | Route |
|
R1 | R2 | R2 R3, R2 |
|
R1 | R3 | R3 R2, R3 |
|
R2 | R1 | R1 R3, R1 |
|
R2 | R3 | R3 R1, R3 |
|
R3 | R1 | R1 R2, R1 |
|
R3 | R2 | R2 R1, R2 |
|
With this approach, each router is able to find the shortest way to a given destination, to choose alternate ways if a route was removed, and to apply a round-robin scheduling via all known routes to the destination.
But the bigger the network and the higher the number of possible routes, the higher the network traffic, due to route exchange. For example, imagine you have a 4x4 router network in one company (4 clusters of 4 routers, each cross connected = 16 routers) and you want to exchange JMS messages with another company over the internet via a SSL routing connection. Suppose this company also has a 4x4 network. If you now establish a router connection between these two networks, at first all routers will exchange their routing information! So it would really take some time before you would be able to access 32 routers.
To avoid this massive route exchange and to protect single routers or subnets against access, route filters can be defined.
Route filters must always be defined on the announcement side. They can be hop or destination based and of the include or exclude type. In this context a hop defines a router node to which other routers are connected and which announces routes to the outside. A destination is a single router. Possible filters are:
- Announce only routes to a single destination outside (include by destination)
- Announce only routes to a hop and all it’s connected routers (= a subnet) to outside (include by hop)
- Don't announce routes to a single destination outside (exclude by destination)
- Don't announce routes to a hop and all it’s connected routers (= a subnet) to outside (exclude by hop)
Example:
Say, there are 5 routers R1 to R5 connected in line (R1->R2->R3->R4->R5), where R1 is company A, and R2 to R5 is company B. The gateway of company B is R2.
- To allow access only to R5 from R1, an include by destination R5 filter must be defined at R2.
- To allow access to R3, R4, R5, an include by hop R3 must be defined at R2.
- To allow access to all routers, except R4, an exclude by destination R4 must be defined at R2.
- To allow access to all routers, except R4 and R5, an exclude by hop R4 must be defined at R2.
Router Names
Optional property that specifies a list of router names on which a filter should be declared. For every defined router name, sub-properties can be defined as described in the following sections.
Property definition:
swiftlet.sys$routing.filter.routers.names=<routername 1>,<routername 2>,..,<routername n>
|
Example:
swiftlet.sys$routing.filter.routers.names=router4,router5
|
Filter Type
Specifies the type of the filter. Valid types are:
Filter Type | Description |
|
include_by_hop | Announces all routes from the router that the filter is defined for, if it has a hop that is defined in the list of filter router names (see following section). All other routes from this router will be rejected. |
|
include_by_destination | Announces all routes from the router that the filter is defined for, if it has a destination that is defined in the list of filter router names (see next section). All other routes from this router will be rejected. |
|
exclude_by_hop | Rejects all routes from the router that the filter is defined for, if it has a hop that is defined in the list of filter router names (see next section). All other routes from this router will be announced. |
|
exclude_by_destination | Rejects all routes from the router that the filter is defined for, if it has a destination that is defined in the list of filter router names (see next section). All other routes from this router will be announced. |
|
Property definition:
swiftlet.sys$routing.filter.routers.<routername>.type=<type>
|
Example:
swiftlet.sys$routing.filter.routers.router2.type=exclude_by_hop
|
Filter Router Names
Specifies a list of router names. Every route from the router that the filter is defined for is checked against this list and an appropriate action depending on the filter type is taken.
Property definition:
swiftlet.sys$routing.filter.routers.<router>.routers.names=<routername 1>,..,<routername n>
|
Example:
swiftlet.sys$routing.filter.routers.<router2>.routers.names=router4,router5
|
Round Robin Scheduling
Optional property that specifies if round robin scheduling should be enabled.
SwiftMQ knows two modes of message routing: shortest way and round robin. Every router has an asynchronous message forwarder for every destination (remote router). This forwarder listens on a destination outbound queue where all messages for this destination are stored. The forwarder knows every connection that can route a message to this specific destination. Every such connection has a list of hop counts to this destination. In shortest way mode the forwarder picks up the connection with the minimum hop count and forwards the message to it. In the round robin mode a message count on each connection is increased by the forwarder and the connection with the minimum message count is picked up. This leads to a round robin message forwarding over all destination-connections.
The default value for this property is false which means shortest way. This is the most useful mode. Round robin is suggested if a higher troughput is needed.
The routing mode does not affect the failover handling.
Property definition:
swiftlet.sys$routing.roundrobin.enabled=<boolean>
|
Example:
swiftlet.sys$routing.roundrobin.enabled=true
|
Thread Names for Threadpool dispatch
The following threads are started by the RoutingSwiftlet. The thread names can be used to dispatch them to specific thread pools. For details please have a look at the ThreadpoolSwiftlet configuration.
Thread Name | Started When | Does What |
|
sys$routing:swiftlet | On Swiftlet startup | Routing Swiftlet; listens for inbound routes from other routers |
|
sys$routing:routeannounce | On Swiftlet startup | Route announcer; announces routes to remote routers |
|
sys$routing:connmgr | On Swiftlet startup | Connection manager; asynchronous clean up connections |
|
sys$routing:connsvc | On incoming and accepted connection | Connection service; distributes incoming messages to specific local queues or outbound queues for other routers |
|
sys$routing:conninbound | On incoming and accepted connection | Connection inbound reader |
|
sys$routing:connoutbound | On incoming and accepted connection | Connection outbound writer |
|
sys$routing:msgfwd | For every new destination | Messageforwarder; performs routing for a single destination incl. failover handling |
|