Chapter 14. Configuring the Transport

HornetQ has a fully pluggable and highly flexible transport layer. The transport layer defines its own Service Provider Interface (SPI) to simplify plugging in a new transport provider.
This chapter covers the concepts required to use and configure HornetQ transports.

14.1. Understanding Acceptors

Acceptors are defined in <JBOSS_HOME>/jboss-as/server/<PROFILE>/deploy/hornetq/hornetq-configuration.xml using the following directives.
<acceptor name="netty">
   <factory-class>
org.hornetq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>
   <param key="host"  value="${jboss.bind.address:localhost}"/>
   <param key="port"  value="${hornetq.remoting.netty.port:5445}"/>
</acceptor>
Acceptors are always defined inside an acceptors element. Multiple acceptors can be defined in one acceptors element. There is no upper limit to the number of acceptors per server.
Each acceptor defines a way in which connections can be made to the HornetQ server.
The above example defines an acceptor that uses Netty to listen for connections on port 5445.
The acceptor element contains a sub-element factory-class which defines the factory used to create acceptor instances. In this case Netty is used to listen for connections, so the Netty implementation of AcceptorFactory is being used. The factory-class element determines which pluggable transport listens.
The acceptor element can also be configured with zero or more param sub-elements. Each param element defines a key-value pair. These key-value pairs are used to configure the specific transport, the set of valid key-value pairs depends on the specific transport be used and are passed straight through to the underlying transport.
Examples of key-value pairs for a particular transport would be, say, to configure the IP address to bind to, or the port to listen at.