A single connection factory provides ONE SINGLE connection to a RabbitMQ message broker via TCP.
It is recommended by the RabbitMQ documentation (v2.7) to use one single connection within a client and to use one channel for every client thread.
@author christian.bickThe following is taken from the JInterface javadocs that describe the valid node names that can be used. These naming constraints apply to the string values you pass into the node names in SimpleConnectionFactory's constructor.
About nodenames: Erlang nodenames consist of two components, an alivename and a hostname separated by '@'. Additionally, there are two nodename formats: short and long. Short names are of the form "alive@hostname", while long names are of the form "alive@host.fully.qualified.domainname". Erlang has special requirements regarding the use of the short and long formats, in particular they cannot be mixed freely in a network of communicating nodes, however Jinterface makes no distinction. See the Erlang documentation for more information about nodenames.
The constructors for the AbstractNode classes will create names exactly as you provide them as long as the name contains '@'. If the string you provide contains no '@', it will be treated as an alivename and the name of the local host will be appended, resulting in a shortname. Nodenames longer than 255 characters will be truncated without warning.
Upon initialization, this class attempts to read the file .erlang.cookie in the user's home directory, and uses the trimmed first line of the file as the default cookie by those constructors lacking a cookie argument. If for any reason the file cannot be found or read, the default cookie will be set to the empty string (""). The location of a user's home directory is determined using the system property "user.home", which may not be automatically set on all platforms.
@author Mark PollackYou can either pass in a specific JMS Connection directly or let this factory lazily create a Connection via a given target ConnectionFactory. In the latter case, this factory just works with JMS 1.1; use {@link SingleConnectionFactory102} for JMS 1.0.2.
Useful for testing and standalone environments in order to keep using the same Connection for multiple {@link org.springframework.jms.core.JmsTemplate}calls, without having a pooling ConnectionFactory underneath. This may span any number of transactions, even concurrently executing transactions.
Note that Spring's message listener containers support the use of a shared Connection within each listener container instance. Using SingleConnectionFactory in combination only really makes sense for sharing a single JMS Connection across multiple listener containers. @author Juergen Hoeller @author Mark Pollack @since 1.1 @see org.springframework.jms.core.JmsTemplate @see org.springframework.jms.listener.SimpleMessageListenerContainer @see org.springframework.jms.listener.DefaultMessageListenerContainer#setCacheLevel
|
|
|
|
|
|