JBoss hornetq SVN: r9111 - trunk/tests/src/org/hornetq/tests/integration/discovery.
by do-not-reply@jboss.org
Author: timfox
Date: 2010-04-14 08:09:00 -0400 (Wed, 14 Apr 2010)
New Revision: 9111
Modified:
trunk/tests/src/org/hornetq/tests/integration/discovery/DiscoveryTest.java
Log:
added test for local bind address
Modified: trunk/tests/src/org/hornetq/tests/integration/discovery/DiscoveryTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/discovery/DiscoveryTest.java 2010-04-14 11:54:24 UTC (rev 9110)
+++ trunk/tests/src/org/hornetq/tests/integration/discovery/DiscoveryTest.java 2010-04-14 12:09:00 UTC (rev 9111)
@@ -14,6 +14,8 @@
package org.hornetq.tests.integration.discovery;
import java.net.InetAddress;
+import java.net.NetworkInterface;
+import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;
@@ -116,7 +118,98 @@
dg.stop();
}
+
+ public void testSimpleBroadcastSpecificNIC() throws Exception
+ {
+ final InetAddress groupAddress = InetAddress.getByName(DiscoveryTest.address1);
+ final int groupPort = 6745;
+ final int timeout = 500;
+ final String nodeID = RandomUtil.randomString();
+
+ //We need to choose a real NIC on the local machine - note this will silently pass if the machine
+ //has no usable NIC!
+
+ NetworkInterface ni = null;
+ Enumeration<NetworkInterface> networkInterfaces = NetworkInterface.getNetworkInterfaces();
+ while (networkInterfaces.hasMoreElements())
+ {
+ NetworkInterface networkInterface = networkInterfaces.nextElement();
+ if (networkInterface.isLoopback() || networkInterface.isVirtual() || !networkInterface.isUp() ||
+ !networkInterface.supportsMulticast())
+ {
+ continue;
+ }
+
+ ni = networkInterface;
+
+ break;
+
+ }
+
+ if (ni == null)
+ {
+ log.warn("Can't find NIC");
+
+ return;
+ }
+
+ InetAddress localAddress = ni.getInetAddresses().nextElement();
+
+ log.info("Local address is " + localAddress);
+
+ BroadcastGroup bg = new BroadcastGroupImpl(nodeID,
+ RandomUtil.randomString(),
+ localAddress,
+ 6552,
+ groupAddress,
+ groupPort,
+ true);
+
+ bg.start();
+
+ TransportConfiguration live1 = generateTC();
+
+ TransportConfiguration backup1 = generateTC();
+
+ Pair<TransportConfiguration, TransportConfiguration> connectorPair = new Pair<TransportConfiguration, TransportConfiguration>(live1,
+ backup1);
+
+ bg.addConnectorPair(connectorPair);
+
+ DiscoveryGroup dg = new DiscoveryGroupImpl(RandomUtil.randomString(),
+ RandomUtil.randomString(),
+ localAddress,
+ groupAddress,
+ groupPort,
+ timeout);
+
+ dg.start();
+
+ bg.broadcastConnectors();
+
+ boolean ok = dg.waitForBroadcast(1000);
+
+ Assert.assertTrue(ok);
+
+ Map<String, DiscoveryEntry> entryMap = dg.getDiscoveryEntryMap();
+
+ Assert.assertNotNull(entryMap);
+
+ Assert.assertEquals(1, entryMap.size());
+
+ DiscoveryEntry entry = entryMap.get(nodeID);
+
+ Assert.assertNotNull(entry);
+
+ Assert.assertEquals(connectorPair, entry.getConnectorPair());
+
+ bg.stop();
+
+ dg.stop();
+
+ }
+
public void testSimpleBroadcastWithStopStartDiscoveryGroup() throws Exception
{
final InetAddress groupAddress = InetAddress.getByName(DiscoveryTest.address1);
15 years, 8 months
JBoss hornetq SVN: r9110 - in trunk/src/main/org/hornetq/core: server/cluster/impl and 1 other directory.
by do-not-reply@jboss.org
Author: timfox
Date: 2010-04-14 07:54:24 -0400 (Wed, 14 Apr 2010)
New Revision: 9110
Modified:
trunk/src/main/org/hornetq/core/cluster/impl/DiscoveryGroupImpl.java
trunk/src/main/org/hornetq/core/server/cluster/impl/BroadcastGroupImpl.java
Log:
https://jira.jboss.org/jira/browse/HORNETQ-342
Modified: trunk/src/main/org/hornetq/core/cluster/impl/DiscoveryGroupImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/cluster/impl/DiscoveryGroupImpl.java 2010-04-14 09:07:05 UTC (rev 9109)
+++ trunk/src/main/org/hornetq/core/cluster/impl/DiscoveryGroupImpl.java 2010-04-14 11:54:24 UTC (rev 9110)
@@ -114,16 +114,12 @@
return;
}
- if (localBindAddress == null)
+ socket = new MulticastSocket(groupPort);
+
+ if (localBindAddress != null)
{
- socket = new MulticastSocket(groupPort);
+ socket.setInterface(localBindAddress);
}
- else
- {
- InetSocketAddress saddress = new InetSocketAddress(localBindAddress, groupPort);
-
- socket = new MulticastSocket(saddress);
- }
socket.joinGroup(groupAddress);
Modified: trunk/src/main/org/hornetq/core/server/cluster/impl/BroadcastGroupImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/server/cluster/impl/BroadcastGroupImpl.java 2010-04-14 09:07:05 UTC (rev 9109)
+++ trunk/src/main/org/hornetq/core/server/cluster/impl/BroadcastGroupImpl.java 2010-04-14 11:54:24 UTC (rev 9110)
@@ -119,6 +119,11 @@
}
else
{
+ if (localAddress != null)
+ {
+ log.warn("local-bind-address specified for broadcast group but no local-bind-port specified so socket will NOT be bound " +
+ "to a local address/port");
+ }
socket = new DatagramSocket();
}
15 years, 8 months
JBoss hornetq SVN: r9109 - in trunk: tests/src/org/hornetq/tests/integration/jms/bridge and 1 other directory.
by do-not-reply@jboss.org
Author: jmesnil
Date: 2010-04-14 05:07:05 -0400 (Wed, 14 Apr 2010)
New Revision: 9109
Modified:
trunk/src/main/org/hornetq/jms/bridge/impl/JMSBridgeImpl.java
trunk/tests/src/org/hornetq/tests/integration/jms/bridge/JMSBridgeReconnectionTest.java
Log:
https://jira.jboss.org/jira/browse/HORNETQ-287: cannot stop JMSBridge which is handling startup failure
* added check in JMSBridgeImple.setupJMSObjectsWithRetry to exit the infinite loop if the bridge is stopping
Modified: trunk/src/main/org/hornetq/jms/bridge/impl/JMSBridgeImpl.java
===================================================================
--- trunk/src/main/org/hornetq/jms/bridge/impl/JMSBridgeImpl.java 2010-04-13 15:16:44 UTC (rev 9108)
+++ trunk/src/main/org/hornetq/jms/bridge/impl/JMSBridgeImpl.java 2010-04-14 09:07:05 UTC (rev 9109)
@@ -108,6 +108,8 @@
private boolean started;
+ private boolean stopping = false;
+
private final LinkedList<Message> messages;
private ConnectionFactoryFactory sourceCff;
@@ -305,6 +307,8 @@
public synchronized void start() throws Exception
{
+ stopping = false;
+
if (started)
{
JMSBridgeImpl.log.warn("Attempt to start, but is already started");
@@ -386,6 +390,8 @@
public synchronized void stop() throws Exception
{
+ stopping = true;
+
if (!started)
{
JMSBridgeImpl.log.warn("Attempt to stop, but is already stopped");
@@ -1366,7 +1372,7 @@
int count = 0;
- while (true)
+ while (true && !stopping)
{
boolean ok = setupJMSObjects();
Modified: trunk/tests/src/org/hornetq/tests/integration/jms/bridge/JMSBridgeReconnectionTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/jms/bridge/JMSBridgeReconnectionTest.java 2010-04-13 15:16:44 UTC (rev 9108)
+++ trunk/tests/src/org/hornetq/tests/integration/jms/bridge/JMSBridgeReconnectionTest.java 2010-04-14 09:07:05 UTC (rev 9109)
@@ -12,6 +12,8 @@
*/
package org.hornetq.tests.integration.jms.bridge;
+import java.lang.management.ManagementFactory;
+
import junit.framework.Assert;
import org.hornetq.core.logging.Logger;
@@ -139,6 +141,54 @@
}
}
+ /**
+ * https://jira.jboss.org/jira/browse/HORNETQ-287
+ */
+ public void testStopBridgeWithFailureWhenStarted() throws Exception
+ {
+ jmsServer1.stop();
+
+ long failureRetryInterval = 500;
+
+ JMSBridgeImpl bridge = new JMSBridgeImpl(cff0,
+ cff1,
+ sourceQueueFactory,
+ targetQueueFactory,
+ null,
+ null,
+ null,
+ null,
+ null,
+ 500,
+ -1,
+ QualityOfServiceMode.DUPLICATES_OK,
+ 10,
+ -1,
+ null,
+ null,
+ false);
+ bridge.setTransactionManager(newTransactionManager());
+
+ bridge.start();
+ Assert.assertFalse(bridge.isStarted());
+ Assert.assertTrue(bridge.isFailed());
+
+ int numThreads = ManagementFactory.getThreadMXBean().getThreadCount();
+
+ bridge.stop();
+ Thread.sleep(failureRetryInterval * 2);
+
+ // the JMS Brigde failure handler thread must have been stopped at most 1 failureRetryInterval ms after the bridge is stopped
+ assertEquals(numThreads - 1, ManagementFactory.getThreadMXBean().getThreadCount());
+ Assert.assertFalse(bridge.isStarted());
+
+ // we restart and setup the server for the test's tearDown checks
+ jmsServer1.start();
+ createQueue("targetQueue", 1);
+ setUpAdministeredObjects();
+
+ }
+
/*
* Send some messages
* Crash the destination server
15 years, 8 months
JBoss hornetq SVN: r9108 - in trunk: src/main/org/hornetq/api/core/client and 20 other directories.
by do-not-reply@jboss.org
Author: timfox
Date: 2010-04-13 11:16:44 -0400 (Tue, 13 Apr 2010)
New Revision: 9108
Added:
trunk/tests/config/hornetq-jms-for-JMSServerDeployerTest2.xml
Modified:
trunk/src/config/common/schema/hornetq-configuration.xsd
trunk/src/main/org/hornetq/api/core/client/ClientSessionFactory.java
trunk/src/main/org/hornetq/api/jms/management/ConnectionFactoryControl.java
trunk/src/main/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java
trunk/src/main/org/hornetq/core/cluster/impl/DiscoveryGroupImpl.java
trunk/src/main/org/hornetq/core/config/DiscoveryGroupConfiguration.java
trunk/src/main/org/hornetq/core/deployers/impl/FileConfigurationParser.java
trunk/src/main/org/hornetq/core/server/cluster/impl/ClusterManagerImpl.java
trunk/src/main/org/hornetq/jms/client/HornetQConnectionFactory.java
trunk/src/main/org/hornetq/jms/management/impl/JMSConnectionFactoryControlImpl.java
trunk/src/main/org/hornetq/jms/server/JMSServerManager.java
trunk/src/main/org/hornetq/jms/server/config/ConnectionFactoryConfiguration.java
trunk/src/main/org/hornetq/jms/server/config/impl/ConnectionFactoryConfigurationImpl.java
trunk/src/main/org/hornetq/jms/server/impl/JMSServerConfigParserImpl.java
trunk/src/main/org/hornetq/jms/server/impl/JMSServerManagerImpl.java
trunk/tests/config/ConfigurationTest-full-config.xml
trunk/tests/src/org/hornetq/tests/integration/cluster/bridge/BridgeWithDiscoveryGroupStartTest.java
trunk/tests/src/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java
trunk/tests/src/org/hornetq/tests/integration/discovery/DiscoveryTest.java
trunk/tests/src/org/hornetq/tests/integration/jms/server/JMSServerDeployerTest.java
trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControlTest.java
trunk/tests/src/org/hornetq/tests/integration/management/ClusterConnectionControl2Test.java
trunk/tests/src/org/hornetq/tests/integration/management/DiscoveryGroupControlTest.java
trunk/tests/src/org/hornetq/tests/unit/core/config/impl/FileConfigurationTest.java
Log:
https://jira.jboss.org/jira/browse/HORNETQ-342
Modified: trunk/src/config/common/schema/hornetq-configuration.xsd
===================================================================
--- trunk/src/config/common/schema/hornetq-configuration.xsd 2010-04-13 14:46:35 UTC (rev 9107)
+++ trunk/src/config/common/schema/hornetq-configuration.xsd 2010-04-13 15:16:44 UTC (rev 9108)
@@ -228,6 +228,8 @@
<xsd:element name="discovery-group">
<xsd:complexType>
<xsd:sequence>
+ <xsd:element maxOccurs="1" minOccurs="0" ref="local-bind-address">
+ </xsd:element>
<xsd:element maxOccurs="1" minOccurs="1" ref="group-address">
</xsd:element>
<xsd:element maxOccurs="1" minOccurs="1" ref="group-port">
Modified: trunk/src/main/org/hornetq/api/core/client/ClientSessionFactory.java
===================================================================
--- trunk/src/main/org/hornetq/api/core/client/ClientSessionFactory.java 2010-04-13 14:46:35 UTC (rev 9107)
+++ trunk/src/main/org/hornetq/api/core/client/ClientSessionFactory.java 2010-04-13 15:16:44 UTC (rev 9108)
@@ -474,6 +474,22 @@
void setAckBatchSize(int ackBatchSize);
/**
+ * Returns the local bind address to which the multicast socket is bound for discovery.
+ *
+ * This is null if the multicast socket is not bound, or no discovery is being used
+ *
+ * @return the local bind address to which the multicast socket is bound for discovery
+ */
+ String getLocalBindAddress();
+
+ /**
+ * Sets the local bind address to which the multicast socket is bound for discovery.
+ *
+ * @param the local bind address
+ */
+ void setLocalBindAddress(String localBindAddress);
+
+ /**
* Returns the address to listen to discover which connectors this factory can use.
* The discovery address must be set to enable this factory to discover HornetQ servers.
*
Modified: trunk/src/main/org/hornetq/api/jms/management/ConnectionFactoryControl.java
===================================================================
--- trunk/src/main/org/hornetq/api/jms/management/ConnectionFactoryControl.java 2010-04-13 14:46:35 UTC (rev 9107)
+++ trunk/src/main/org/hornetq/api/jms/management/ConnectionFactoryControl.java 2010-04-13 15:16:44 UTC (rev 9108)
@@ -370,7 +370,17 @@
*/
void setStaticConnectors(List<Pair<TransportConfiguration, TransportConfiguration>> staticConnectors);
+ /**
+ * @see ClientSessionFactory#getLocalBindAddress()
+ */
+ String getLocalBindAddress();
+
/**
+ * @see ClientSessionFactory#setLocalBindAddress(String)
+ */
+ void setLocalBindAddress(String localBindAddress);
+
+ /**
* @see ClientSessionFactory#getDiscoveryAddress()
*/
String getDiscoveryAddress();
@@ -379,6 +389,8 @@
* @see ClientSessionFactory#setDiscoveryAddress(String)
*/
void setDiscoveryAddress(String discoveryAddress);
+
+
/**
* @see ClientSessionFactory#getDiscoveryPort()
Modified: trunk/src/main/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java 2010-04-13 14:46:35 UTC (rev 9107)
+++ trunk/src/main/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java 2010-04-13 15:16:44 UTC (rev 9108)
@@ -86,6 +86,8 @@
private List<Pair<TransportConfiguration, TransportConfiguration>> staticConnectors;
+ private String localBindAddress;
+
private String discoveryAddress;
private int discoveryPort;
@@ -219,9 +221,21 @@
if (discoveryAddress != null)
{
InetAddress groupAddress = InetAddress.getByName(discoveryAddress);
+
+ InetAddress lbAddress;
+
+ if (localBindAddress != null)
+ {
+ lbAddress = InetAddress.getByName(localBindAddress);
+ }
+ else
+ {
+ lbAddress = null;
+ }
discoveryGroup = new DiscoveryGroupImpl(UUIDGenerator.getInstance().generateStringUUID(),
discoveryAddress,
+ lbAddress,
groupAddress,
discoveryPort,
discoveryRefreshTimeout);
@@ -270,6 +284,8 @@
public ClientSessionFactoryImpl(final ClientSessionFactory other)
{
+ localBindAddress = other.getLocalBindAddress();
+
discoveryAddress = other.getDiscoveryAddress();
discoveryPort = other.getDiscoveryPort();
@@ -402,7 +418,18 @@
this.discoveryPort = discoveryPort;
}
+
+ public ClientSessionFactoryImpl(final String localBindAddress, final String discoveryAddress, final int discoveryPort)
+ {
+ this();
+
+ this.localBindAddress = localBindAddress;
+ this.discoveryAddress = discoveryAddress;
+
+ this.discoveryPort = discoveryPort;
+ }
+
public ClientSessionFactoryImpl(final List<Pair<TransportConfiguration, TransportConfiguration>> staticConnectors)
{
this();
@@ -724,7 +751,18 @@
checkWrite();
connectionLoadBalancingPolicyClassName = loadBalancingPolicyClassName;
}
+
+ public synchronized String getLocalBindAddress()
+ {
+ return localBindAddress;
+ }
+ public synchronized void setLocalBindAddress(final String localBindAddress)
+ {
+ checkWrite();
+ this.localBindAddress = localBindAddress;
+ }
+
public synchronized String getDiscoveryAddress()
{
return discoveryAddress;
Modified: trunk/src/main/org/hornetq/core/cluster/impl/DiscoveryGroupImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/cluster/impl/DiscoveryGroupImpl.java 2010-04-13 14:46:35 UTC (rev 9107)
+++ trunk/src/main/org/hornetq/core/cluster/impl/DiscoveryGroupImpl.java 2010-04-13 15:16:44 UTC (rev 9108)
@@ -16,6 +16,7 @@
import java.io.InterruptedIOException;
import java.net.DatagramPacket;
import java.net.InetAddress;
+import java.net.InetSocketAddress;
import java.net.MulticastSocket;
import java.util.ArrayList;
import java.util.HashMap;
@@ -70,6 +71,8 @@
private volatile boolean started;
private final String nodeID;
+
+ private final InetAddress localBindAddress;
private final InetAddress groupAddress;
@@ -81,6 +84,7 @@
public DiscoveryGroupImpl(final String nodeID,
final String name,
+ final InetAddress localBindAddress,
final InetAddress groupAddress,
final int groupPort,
final long timeout) throws Exception
@@ -90,6 +94,8 @@
this.name = name;
this.timeout = timeout;
+
+ this.localBindAddress = localBindAddress;
this.groupAddress = groupAddress;
@@ -108,7 +114,16 @@
return;
}
- socket = new MulticastSocket(groupPort);
+ if (localBindAddress == null)
+ {
+ socket = new MulticastSocket(groupPort);
+ }
+ else
+ {
+ InetSocketAddress saddress = new InetSocketAddress(localBindAddress, groupPort);
+
+ socket = new MulticastSocket(saddress);
+ }
socket.joinGroup(groupAddress);
@@ -125,8 +140,11 @@
if (notificationService != null)
{
TypedProperties props = new TypedProperties();
+
props.putSimpleStringProperty(new SimpleString("name"), new SimpleString(name));
+
Notification notification = new Notification(nodeID, NotificationType.DISCOVERY_GROUP_STARTED, props);
+
notificationService.sendNotification(notification);
}
}
Modified: trunk/src/main/org/hornetq/core/config/DiscoveryGroupConfiguration.java
===================================================================
--- trunk/src/main/org/hornetq/core/config/DiscoveryGroupConfiguration.java 2010-04-13 14:46:35 UTC (rev 9107)
+++ trunk/src/main/org/hornetq/core/config/DiscoveryGroupConfiguration.java 2010-04-13 15:16:44 UTC (rev 9108)
@@ -15,6 +15,8 @@
import java.io.Serializable;
+import org.hornetq.core.logging.Logger;
+
/**
* A DiscoveryGroupConfiguration
*
@@ -27,8 +29,13 @@
public class DiscoveryGroupConfiguration implements Serializable
{
private static final long serialVersionUID = 8657206421727863400L;
+
+ private static final Logger log = Logger.getLogger(DiscoveryGroupConfiguration.class);
+
private String name;
+
+ private String localBindAddress;
private String groupAddress;
@@ -37,12 +44,14 @@
private long refreshTimeout;
public DiscoveryGroupConfiguration(final String name,
+ final String localBindAddress,
final String groupAddress,
final int groupPort,
final long refreshTimeout)
{
this.name = name;
this.groupAddress = groupAddress;
+ this.localBindAddress = localBindAddress;
this.groupPort = groupPort;
this.refreshTimeout = refreshTimeout;
}
@@ -51,6 +60,11 @@
{
return name;
}
+
+ public String getLocalBindAddress()
+ {
+ return localBindAddress;
+ }
public String getGroupAddress()
{
@@ -74,6 +88,14 @@
{
this.name = name;
}
+
+ /**
+ * @param localBindAddress the localBindAddress to set
+ */
+ public void setLocalBindAdress(final String localBindAddress)
+ {
+ this.localBindAddress = localBindAddress;
+ }
/**
* @param groupAddress the groupAddress to set
Modified: trunk/src/main/org/hornetq/core/deployers/impl/FileConfigurationParser.java
===================================================================
--- trunk/src/main/org/hornetq/core/deployers/impl/FileConfigurationParser.java 2010-04-13 14:46:35 UTC (rev 9107)
+++ trunk/src/main/org/hornetq/core/deployers/impl/FileConfigurationParser.java 2010-04-13 15:16:44 UTC (rev 9108)
@@ -894,6 +894,8 @@
{
String name = e.getAttribute("name");
+ String localBindAddress = XMLConfigurationUtil.getString(e, "local-bind-address", null, Validators.NO_CHECK);
+
String groupAddress = XMLConfigurationUtil.getString(e, "group-address", null, Validators.NOT_NULL_OR_EMPTY);
int groupPort = XMLConfigurationUtil.getInteger(e, "group-port", -1, Validators.MINUS_ONE_OR_GT_ZERO);
@@ -904,6 +906,7 @@
Validators.GT_ZERO);
DiscoveryGroupConfiguration config = new DiscoveryGroupConfiguration(name,
+ localBindAddress,
groupAddress,
groupPort,
refreshTimeout);
Modified: trunk/src/main/org/hornetq/core/server/cluster/impl/ClusterManagerImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/server/cluster/impl/ClusterManagerImpl.java 2010-04-13 14:46:35 UTC (rev 9107)
+++ trunk/src/main/org/hornetq/core/server/cluster/impl/ClusterManagerImpl.java 2010-04-13 15:16:44 UTC (rev 9108)
@@ -331,9 +331,23 @@
}
InetAddress groupAddress = InetAddress.getByName(config.getGroupAddress());
+
+ InetAddress localBindAddress;
+
+ if (config.getLocalBindAddress() != null)
+ {
+ localBindAddress = InetAddress.getByName(config.getLocalBindAddress());
+ }
+ else
+ {
+ localBindAddress = null;
+ }
+ log.info("local bind address " + localBindAddress);
+
DiscoveryGroup group = new DiscoveryGroupImpl(nodeUUID.toString(),
config.getName(),
+ localBindAddress,
groupAddress,
config.getGroupPort(),
config.getRefreshTimeout());
Modified: trunk/src/main/org/hornetq/jms/client/HornetQConnectionFactory.java
===================================================================
--- trunk/src/main/org/hornetq/jms/client/HornetQConnectionFactory.java 2010-04-13 14:46:35 UTC (rev 9107)
+++ trunk/src/main/org/hornetq/jms/client/HornetQConnectionFactory.java 2010-04-13 15:16:44 UTC (rev 9108)
@@ -209,7 +209,18 @@
checkWrite();
sessionFactory.setStaticConnectors(staticConnectors);
}
+
+ public synchronized String getLocalBindAddress()
+ {
+ return sessionFactory.getLocalBindAddress();
+ }
+ public synchronized void setLocalBindAddress(final String localBindAddress)
+ {
+ checkWrite();
+ sessionFactory.setLocalBindAddress(localBindAddress);
+ }
+
public synchronized String getDiscoveryAddress()
{
return sessionFactory.getDiscoveryAddress();
Modified: trunk/src/main/org/hornetq/jms/management/impl/JMSConnectionFactoryControlImpl.java
===================================================================
--- trunk/src/main/org/hornetq/jms/management/impl/JMSConnectionFactoryControlImpl.java 2010-04-13 14:46:35 UTC (rev 9107)
+++ trunk/src/main/org/hornetq/jms/management/impl/JMSConnectionFactoryControlImpl.java 2010-04-13 15:16:44 UTC (rev 9108)
@@ -297,7 +297,17 @@
{
cf.setStaticConnectors(staticConnectors);
}
+
+ public String getLocalBindAddress()
+ {
+ return cf.getLocalBindAddress();
+ }
+ public void setLocalBindAddress(String localBindAddress)
+ {
+ cf.setLocalBindAddress(localBindAddress);
+ }
+
public String getDiscoveryAddress()
{
return cf.getDiscoveryAddress();
Modified: trunk/src/main/org/hornetq/jms/server/JMSServerManager.java
===================================================================
--- trunk/src/main/org/hornetq/jms/server/JMSServerManager.java 2010-04-13 14:46:35 UTC (rev 9107)
+++ trunk/src/main/org/hornetq/jms/server/JMSServerManager.java 2010-04-13 15:16:44 UTC (rev 9108)
@@ -223,6 +223,7 @@
String ... jndiBindings) throws Exception;
void createConnectionFactory(String name,
+ String localBindAdress,
String discoveryAddress,
int discoveryPort,
String clientID,
Modified: trunk/src/main/org/hornetq/jms/server/config/ConnectionFactoryConfiguration.java
===================================================================
--- trunk/src/main/org/hornetq/jms/server/config/ConnectionFactoryConfiguration.java 2010-04-13 14:46:35 UTC (rev 9107)
+++ trunk/src/main/org/hornetq/jms/server/config/ConnectionFactoryConfiguration.java 2010-04-13 15:16:44 UTC (rev 9108)
@@ -34,6 +34,10 @@
String[] getBindings();
void setBindings(String[] bindings);
+
+ String getLocalBindAddress();
+
+ void setLocalBindAddress(String localBindAddress);
String getDiscoveryAddress();
Modified: trunk/src/main/org/hornetq/jms/server/config/impl/ConnectionFactoryConfigurationImpl.java
===================================================================
--- trunk/src/main/org/hornetq/jms/server/config/impl/ConnectionFactoryConfigurationImpl.java 2010-04-13 14:46:35 UTC (rev 9107)
+++ trunk/src/main/org/hornetq/jms/server/config/impl/ConnectionFactoryConfigurationImpl.java 2010-04-13 15:16:44 UTC (rev 9108)
@@ -42,6 +42,8 @@
private String[] bindings;
private String discoveryGroupName;
+
+ private String localBindAddress;
private String discoveryAddress;
@@ -129,6 +131,18 @@
this.discoveryAddress = discoveryAddress;
this.discoveryPort = discoveryPort;
}
+
+ public ConnectionFactoryConfigurationImpl(final String name,
+ final String localBindAddress,
+ final String discoveryAddress,
+ final int discoveryPort,
+ final String... bindings)
+ {
+ this(name, bindings);
+ this.localBindAddress = localBindAddress;
+ this.discoveryAddress = discoveryAddress;
+ this.discoveryPort = discoveryPort;
+ }
public ConnectionFactoryConfigurationImpl(final String name,
final TransportConfiguration liveConfig,
@@ -179,7 +193,17 @@
{
return name;
}
+
+ public String getLocalBindAddress()
+ {
+ return localBindAddress;
+ }
+ public void setLocalBindAddress(final String localBindAddress)
+ {
+ this.localBindAddress = localBindAddress;
+ }
+
public String getDiscoveryAddress()
{
return discoveryAddress;
@@ -553,6 +577,8 @@
discoveryGroupName = BufferHelper.readNullableSimpleStringAsString(buffer);
+ localBindAddress = BufferHelper.readNullableSimpleStringAsString(buffer);
+
discoveryAddress = BufferHelper.readNullableSimpleStringAsString(buffer);
discoveryPort = buffer.readInt();
@@ -642,6 +668,8 @@
BufferHelper.writeAsNullableSimpleString(buffer, discoveryGroupName);
+ BufferHelper.writeAsNullableSimpleString(buffer, localBindAddress);
+
BufferHelper.writeAsNullableSimpleString(buffer, discoveryAddress);
buffer.writeInt(discoveryPort);
@@ -746,6 +774,8 @@
BufferHelper.sizeOfNullableSimpleString(discoveryGroupName) +
+ BufferHelper.sizeOfNullableSimpleString(localBindAddress)+
+
BufferHelper.sizeOfNullableSimpleString(discoveryAddress)+
DataConstants.SIZE_INT + // discoveryPort
Modified: trunk/src/main/org/hornetq/jms/server/impl/JMSServerConfigParserImpl.java
===================================================================
--- trunk/src/main/org/hornetq/jms/server/impl/JMSServerConfigParserImpl.java 2010-04-13 14:46:35 UTC (rev 9107)
+++ trunk/src/main/org/hornetq/jms/server/impl/JMSServerConfigParserImpl.java 2010-04-13 15:16:44 UTC (rev 9108)
@@ -366,6 +366,7 @@
if (discoveryGroupName != null)
{
+ log.info("discovery group name is " + discoveryGroupName);
cfConfig = new ConnectionFactoryConfigurationImpl(name, strbindings);
cfConfig.setInitialWaitTimeout(discoveryInitialWaitTimeout);
cfConfig.setDiscoveryGroupName(discoveryGroupName);
Modified: trunk/src/main/org/hornetq/jms/server/impl/JMSServerManagerImpl.java
===================================================================
--- trunk/src/main/org/hornetq/jms/server/impl/JMSServerManagerImpl.java 2010-04-13 14:46:35 UTC (rev 9107)
+++ trunk/src/main/org/hornetq/jms/server/impl/JMSServerManagerImpl.java 2010-04-13 15:16:44 UTC (rev 9108)
@@ -767,6 +767,7 @@
}
public synchronized void createConnectionFactory(final String name,
+ final String localBindAddress,
final String discoveryAddress,
final int discoveryPort,
final String clientID,
@@ -801,11 +802,15 @@
final String groupId,
final String... jndiBindings) throws Exception
{
+ log.info("calling create cf " + discoveryRefreshTimeout + " lba " + localBindAddress);
+
+
checkInitialised();
HornetQConnectionFactory cf = connectionFactories.get(name);
if (cf == null)
{
ConnectionFactoryConfiguration configuration = new ConnectionFactoryConfigurationImpl(name,
+ localBindAddress,
discoveryAddress,
discoveryPort);
configuration.setClientID(clientID);
@@ -903,6 +908,7 @@
}
private HornetQConnectionFactory internalCreateConnectionFactory(final String name,
+ final String localBindAddress,
final String discoveryAddress,
final int discoveryPort,
final String clientID,
@@ -942,6 +948,7 @@
{
cf = (HornetQConnectionFactory)HornetQJMSClient.createConnectionFactory(discoveryAddress, discoveryPort);
cf.setClientID(clientID);
+ cf.setLocalBindAddress(localBindAddress);
cf.setDiscoveryRefreshTimeout(discoveryRefreshTimeout);
cf.setClientFailureCheckPeriod(clientFailureCheckPeriod);
cf.setConnectionTTL(connectionTTL);
@@ -1141,6 +1148,7 @@
if (cfConfig.getDiscoveryAddress() != null)
{
cf = internalCreateConnectionFactory(cfConfig.getName(),
+ cfConfig.getLocalBindAddress(),
cfConfig.getDiscoveryAddress(),
cfConfig.getDiscoveryPort(),
cfConfig.getClientID(),
@@ -1416,8 +1424,10 @@
"' deployed.");
}
+ cfConfig.setLocalBindAddress(discoveryGroupConfiguration.getLocalBindAddress());
cfConfig.setDiscoveryAddress(discoveryGroupConfiguration.getGroupAddress());
cfConfig.setDiscoveryPort(discoveryGroupConfiguration.getGroupPort());
+ cfConfig.setDiscoveryRefreshTimeout(discoveryGroupConfiguration.getRefreshTimeout());
}
}
Modified: trunk/tests/config/ConfigurationTest-full-config.xml
===================================================================
--- trunk/tests/config/ConfigurationTest-full-config.xml 2010-04-13 14:46:35 UTC (rev 9107)
+++ trunk/tests/config/ConfigurationTest-full-config.xml 2010-04-13 15:16:44 UTC (rev 9108)
@@ -104,11 +104,13 @@
</broadcast-groups>
<discovery-groups>
<discovery-group name="dg1">
+ <local-bind-address>172.16.8.10</local-bind-address>
<group-address>192.168.0.120</group-address>
<group-port>11999</group-port>
<refresh-timeout>12345</refresh-timeout>
</discovery-group>
<discovery-group name="dg2">
+ <local-bind-address>172.16.8.11</local-bind-address>
<group-address>192.168.0.121</group-address>
<group-port>12999</group-port>
<refresh-timeout>23456</refresh-timeout>
Added: trunk/tests/config/hornetq-jms-for-JMSServerDeployerTest2.xml
===================================================================
--- trunk/tests/config/hornetq-jms-for-JMSServerDeployerTest2.xml (rev 0)
+++ trunk/tests/config/hornetq-jms-for-JMSServerDeployerTest2.xml 2010-04-13 15:16:44 UTC (rev 9108)
@@ -0,0 +1,53 @@
+<configuration xmlns="urn:hornetq"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:hornetq ../../src/schemas/hornetq-jms.xsd ">
+
+ <connection-factory name="fullConfigurationConnectionFactory">
+ <entries>
+ <entry name="/fullConfigurationConnectionFactory"/>
+ <entry name="/acme/fullConfigurationConnectionFactory"/>
+ <entry name="java:/xyz/tfullConfigurationConnectionFactory"/>
+ <entry name="java:/connectionfactories/acme/fullConfigurationConnectionFactory"/>
+ </entries>
+ <connectors>
+ <connector-ref connector-name="netty"/>
+ </connectors>
+ <discovery-group-ref discovery-group-name="mygroup"/>
+ <client-failure-check-period>1234</client-failure-check-period>
+ <call-timeout>5678</call-timeout>
+ <consumer-window-size>12345</consumer-window-size>
+ <consumer-max-rate>6789</consumer-max-rate>
+ <confirmation-window-size>123456</confirmation-window-size>
+ <producer-window-size>7712652</producer-window-size>
+ <producer-max-rate>789</producer-max-rate>
+ <min-large-message-size>12</min-large-message-size>
+ <client-id>TestClientID</client-id>
+ <dups-ok-batch-size>3456</dups-ok-batch-size>
+ <transaction-batch-size>4567</transaction-batch-size>
+ <block-on-acknowledge>true</block-on-acknowledge>
+ <block-on-non-durable-send>false</block-on-non-durable-send>
+ <block-on-durable-send>true</block-on-durable-send>
+ <auto-group-id>false</auto-group-id>
+ <pre-acknowledge>true</pre-acknowledge>
+ <connection-ttl>2345</connection-ttl>
+ <discovery-initial-wait-timeout>678</discovery-initial-wait-timeout>
+ <failover-on-server-shutdown>false</failover-on-server-shutdown>
+ <connection-load-balancing-policy-class-name>FooClass</connection-load-balancing-policy-class-name>
+ <reconnect-attempts>34</reconnect-attempts>
+ <retry-interval>5</retry-interval>
+ <retry-interval-multiplier>6.0</retry-interval-multiplier>
+ <max-retry-interval>300</max-retry-interval>
+ <cache-large-message-client>true</cache-large-message-client>
+ </connection-factory>
+
+ <queue name="fullConfigurationQueue">
+ <entry name="/fullConfigurationQueue"/>
+ <entry name="/queue/fullConfigurationQueue"/>
+ </queue>
+
+ <topic name="fullConfigurationTopic">
+ <entry name="/fullConfigurationTopic"/>
+ <entry name="/topic/fullConfigurationTopic"/>
+ </topic>
+
+</configuration>
\ No newline at end of file
Modified: trunk/tests/src/org/hornetq/tests/integration/cluster/bridge/BridgeWithDiscoveryGroupStartTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/cluster/bridge/BridgeWithDiscoveryGroupStartTest.java 2010-04-13 14:46:35 UTC (rev 9107)
+++ trunk/tests/src/org/hornetq/tests/integration/cluster/bridge/BridgeWithDiscoveryGroupStartTest.java 2010-04-13 15:16:44 UTC (rev 9108)
@@ -96,7 +96,7 @@
server0.getConfiguration().getBroadcastGroupConfigurations().add(bcConfig);
- DiscoveryGroupConfiguration dcConfig = new DiscoveryGroupConfiguration("dg1", groupAddress, port, 5000);
+ DiscoveryGroupConfiguration dcConfig = new DiscoveryGroupConfiguration("dg1", null, groupAddress, port, 5000);
server0.getConfiguration().getDiscoveryGroupConfigurations().put(dcConfig.getName(), dcConfig);
Modified: trunk/tests/src/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java 2010-04-13 14:46:35 UTC (rev 9107)
+++ trunk/tests/src/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java 2010-04-13 15:16:44 UTC (rev 9108)
@@ -1406,12 +1406,12 @@
-1,
groupAddress,
port,
- 250,
+ 1000,
connectorPairs);
configuration.getBroadcastGroupConfigurations().add(bcConfig);
- DiscoveryGroupConfiguration dcConfig = new DiscoveryGroupConfiguration("dg1", groupAddress, port, 5000);
+ DiscoveryGroupConfiguration dcConfig = new DiscoveryGroupConfiguration("dg1", null, groupAddress, port, 5000);
configuration.getDiscoveryGroupConfigurations().put(dcConfig.getName(), dcConfig);
Modified: trunk/tests/src/org/hornetq/tests/integration/discovery/DiscoveryTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/discovery/DiscoveryTest.java 2010-04-13 14:46:35 UTC (rev 9107)
+++ trunk/tests/src/org/hornetq/tests/integration/discovery/DiscoveryTest.java 2010-04-13 15:16:44 UTC (rev 9108)
@@ -86,6 +86,7 @@
DiscoveryGroup dg = new DiscoveryGroupImpl(RandomUtil.randomString(),
RandomUtil.randomString(),
+ null,
groupAddress,
groupPort,
timeout);
@@ -145,6 +146,7 @@
DiscoveryGroup dg = new DiscoveryGroupImpl(RandomUtil.randomString(),
RandomUtil.randomString(),
+ null,
groupAddress,
groupPort,
timeout);
@@ -224,7 +226,7 @@
bg.addConnectorPair(connectorPair);
- DiscoveryGroup dg = new DiscoveryGroupImpl(nodeID, RandomUtil.randomString(), groupAddress, groupPort, timeout);
+ DiscoveryGroup dg = new DiscoveryGroupImpl(nodeID, RandomUtil.randomString(), null, groupAddress, groupPort, timeout);
dg.start();
@@ -317,6 +319,7 @@
DiscoveryGroup dg = new DiscoveryGroupImpl(RandomUtil.randomString(),
RandomUtil.randomString(),
+ null,
groupAddress,
port2,
timeout);
@@ -364,6 +367,7 @@
DiscoveryGroup dg = new DiscoveryGroupImpl(RandomUtil.randomString(),
RandomUtil.randomString(),
+ null,
groupAddress2,
port2,
timeout);
@@ -451,6 +455,7 @@
DiscoveryGroup dg1 = new DiscoveryGroupImpl(RandomUtil.randomString(),
RandomUtil.randomString(),
+ null,
groupAddress1,
groupPort1,
timeout);
@@ -458,6 +463,7 @@
DiscoveryGroup dg2 = new DiscoveryGroupImpl(RandomUtil.randomString(),
RandomUtil.randomString(),
+ null,
groupAddress2,
groupPort2,
timeout);
@@ -465,6 +471,7 @@
DiscoveryGroup dg3 = new DiscoveryGroupImpl(RandomUtil.randomString(),
RandomUtil.randomString(),
+ null,
groupAddress3,
groupPort3,
timeout);
@@ -539,6 +546,7 @@
DiscoveryGroup dg = new DiscoveryGroupImpl(RandomUtil.randomString(),
RandomUtil.randomString(),
+ null,
groupAddress,
groupPort,
timeout);
@@ -591,6 +599,7 @@
DiscoveryGroup dg = new DiscoveryGroupImpl(RandomUtil.randomString(),
RandomUtil.randomString(),
+ null,
groupAddress,
groupPort,
timeout);
@@ -688,6 +697,7 @@
DiscoveryGroup dg = new DiscoveryGroupImpl(RandomUtil.randomString(),
RandomUtil.randomString(),
+ null,
groupAddress,
groupPort,
timeout);
@@ -927,18 +937,21 @@
DiscoveryGroup dg1 = new DiscoveryGroupImpl(RandomUtil.randomString(),
RandomUtil.randomString(),
+ null,
groupAddress,
groupPort,
timeout);
DiscoveryGroup dg2 = new DiscoveryGroupImpl(RandomUtil.randomString(),
RandomUtil.randomString(),
+ null,
groupAddress,
groupPort,
timeout);
DiscoveryGroup dg3 = new DiscoveryGroupImpl(RandomUtil.randomString(),
RandomUtil.randomString(),
+ null,
groupAddress,
groupPort,
timeout);
@@ -995,6 +1008,7 @@
DiscoveryGroup dg = new DiscoveryGroupImpl(RandomUtil.randomString(),
RandomUtil.randomString(),
+ null,
groupAddress,
groupPort,
timeout);
Modified: trunk/tests/src/org/hornetq/tests/integration/jms/server/JMSServerDeployerTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/jms/server/JMSServerDeployerTest.java 2010-04-13 14:46:35 UTC (rev 9107)
+++ trunk/tests/src/org/hornetq/tests/integration/jms/server/JMSServerDeployerTest.java 2010-04-13 15:16:44 UTC (rev 9108)
@@ -23,6 +23,7 @@
import org.hornetq.api.core.TransportConfiguration;
import org.hornetq.core.config.Configuration;
+import org.hornetq.core.config.DiscoveryGroupConfiguration;
import org.hornetq.core.config.impl.ConfigurationImpl;
import org.hornetq.core.deployers.DeploymentManager;
import org.hornetq.core.deployers.impl.FileDeploymentManager;
@@ -239,7 +240,97 @@
Assert.assertEquals("fullConfigurationTopic", topic.getTopicName());
}
}
+
+ public void testDeployFullConfiguration2() throws Exception
+ {
+ JMSServerDeployer deployer = new JMSServerDeployer(jmsServer, deploymentManager, config);
+ String conf = "hornetq-jms-for-JMSServerDeployerTest2.xml";
+ URL confURL = Thread.currentThread().getContextClassLoader().getResource(conf);
+
+ String[] connectionFactoryBindings = new String[] { "/fullConfigurationConnectionFactory",
+ "/acme/fullConfigurationConnectionFactory",
+ "java:/xyz/tfullConfigurationConnectionFactory",
+ "java:/connectionfactories/acme/fullConfigurationConnectionFactory" };
+ String[] queueBindings = new String[] { "/fullConfigurationQueue", "/queue/fullConfigurationQueue" };
+ String[] topicBindings = new String[] { "/fullConfigurationTopic", "/topic/fullConfigurationTopic" };
+
+ for (String binding : connectionFactoryBindings)
+ {
+ UnitTestCase.checkNoBinding(context, binding);
+ }
+ for (String binding : queueBindings)
+ {
+ UnitTestCase.checkNoBinding(context, binding);
+ }
+ for (String binding : topicBindings)
+ {
+ UnitTestCase.checkNoBinding(context, binding);
+ }
+
+ deployer.deploy(confURL);
+
+ for (String binding : connectionFactoryBindings)
+ {
+ UnitTestCase.checkBinding(context, binding);
+ }
+ for (String binding : queueBindings)
+ {
+ UnitTestCase.checkBinding(context, binding);
+ }
+ for (String binding : topicBindings)
+ {
+ UnitTestCase.checkBinding(context, binding);
+ }
+
+ for (String binding : connectionFactoryBindings)
+ {
+ HornetQConnectionFactory cf = (HornetQConnectionFactory)context.lookup(binding);
+ Assert.assertNotNull(cf);
+ Assert.assertEquals(1234, cf.getClientFailureCheckPeriod());
+ Assert.assertEquals(5678, cf.getCallTimeout());
+ Assert.assertEquals(12345, cf.getConsumerWindowSize());
+ Assert.assertEquals(6789, cf.getConsumerMaxRate());
+ Assert.assertEquals(123456, cf.getConfirmationWindowSize());
+ Assert.assertEquals(7712652, cf.getProducerWindowSize());
+ Assert.assertEquals(789, cf.getProducerMaxRate());
+ Assert.assertEquals(12, cf.getMinLargeMessageSize());
+ Assert.assertEquals("TestClientID", cf.getClientID());
+ Assert.assertEquals(3456, cf.getDupsOKBatchSize());
+ Assert.assertEquals(4567, cf.getTransactionBatchSize());
+ Assert.assertEquals(true, cf.isBlockOnAcknowledge());
+ Assert.assertEquals(false, cf.isBlockOnNonDurableSend());
+ Assert.assertEquals(true, cf.isBlockOnDurableSend());
+ Assert.assertEquals(false, cf.isAutoGroup());
+ Assert.assertEquals(true, cf.isPreAcknowledge());
+ Assert.assertEquals(2345, cf.getConnectionTTL());
+ Assert.assertEquals(false, cf.isFailoverOnServerShutdown());
+ Assert.assertEquals(34, cf.getReconnectAttempts());
+ Assert.assertEquals(5, cf.getRetryInterval());
+ Assert.assertEquals(6.0, cf.getRetryIntervalMultiplier());
+ Assert.assertEquals(true, cf.isCacheLargeMessagesClient());
+
+ assertEquals("243.7.7.7", cf.getDiscoveryAddress());
+ assertEquals("172.16.8.10", cf.getLocalBindAddress());
+ assertEquals(12345, cf.getDiscoveryPort());
+ assertEquals(5000, cf.getDiscoveryRefreshTimeout());
+ }
+
+ for (String binding : queueBindings)
+ {
+ Queue queue = (Queue)context.lookup(binding);
+ Assert.assertNotNull(queue);
+ Assert.assertEquals("fullConfigurationQueue", queue.getQueueName());
+ }
+
+ for (String binding : topicBindings)
+ {
+ Topic topic = (Topic)context.lookup(binding);
+ Assert.assertNotNull(topic);
+ Assert.assertEquals("fullConfigurationTopic", topic.getTopicName());
+ }
+ }
+
// Package protected ---------------------------------------------
// Protected -----------------------------------------------------
@@ -252,6 +343,11 @@
config = new ConfigurationImpl();
config.getConnectorConfigurations().put("netty",
new TransportConfiguration(NettyConnectorFactory.class.getName()));
+
+ DiscoveryGroupConfiguration dcg = new DiscoveryGroupConfiguration("mygroup", "172.16.8.10",
+ "243.7.7.7", 12345,
+ 5000);
+ config.getDiscoveryGroupConfigurations().put("mygroup", dcg);
HornetQServer server = createServer(false, config);
deploymentManager = new FileDeploymentManager(config.getFileDeployerScanPeriod());
Modified: trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControlTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControlTest.java 2010-04-13 14:46:35 UTC (rev 9107)
+++ trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControlTest.java 2010-04-13 15:16:44 UTC (rev 9108)
@@ -14,6 +14,13 @@
package org.hornetq.tests.integration.jms.server.management;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
import javax.jms.Connection;
import javax.jms.ConnectionFactory;
import javax.jms.Queue;
@@ -53,9 +60,6 @@
import org.hornetq.tests.util.RandomUtil;
import org.hornetq.tests.util.UnitTestCase;
-import java.util.*;
-import java.util.concurrent.ConcurrentHashMap;
-
/**
* A JMSServerControlTest
*
@@ -509,6 +513,7 @@
conf.getDiscoveryGroupConfigurations()
.put("discovery",
new DiscoveryGroupConfiguration("discovery",
+ null,
"231.7.7.7",
discoveryPort,
ConfigurationImpl.DEFAULT_BROADCAST_REFRESH_TIMEOUT));
Modified: trunk/tests/src/org/hornetq/tests/integration/management/ClusterConnectionControl2Test.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/management/ClusterConnectionControl2Test.java 2010-04-13 14:46:35 UTC (rev 9107)
+++ trunk/tests/src/org/hornetq/tests/integration/management/ClusterConnectionControl2Test.java 2010-04-13 15:16:44 UTC (rev 9108)
@@ -148,6 +148,7 @@
250,
connectorInfos);
DiscoveryGroupConfiguration discoveryGroupConfig = new DiscoveryGroupConfiguration(discoveryName,
+ null,
groupAddress,
groupPort,
HornetQClient.DEFAULT_DISCOVERY_REFRESH_TIMEOUT);
Modified: trunk/tests/src/org/hornetq/tests/integration/management/DiscoveryGroupControlTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/management/DiscoveryGroupControlTest.java 2010-04-13 14:46:35 UTC (rev 9107)
+++ trunk/tests/src/org/hornetq/tests/integration/management/DiscoveryGroupControlTest.java 2010-04-13 15:16:44 UTC (rev 9108)
@@ -52,6 +52,7 @@
public void testAttributes() throws Exception
{
DiscoveryGroupConfiguration discoveryGroupConfig = new DiscoveryGroupConfiguration(RandomUtil.randomString(),
+ null,
"231.7.7.7",
2000,
RandomUtil.randomPositiveLong());
@@ -76,6 +77,7 @@
public void testStartStop() throws Exception
{
DiscoveryGroupConfiguration discoveryGroupConfig = new DiscoveryGroupConfiguration(RandomUtil.randomString(),
+ null,
"231.7.7.7",
2000,
RandomUtil.randomPositiveLong());
Modified: trunk/tests/src/org/hornetq/tests/unit/core/config/impl/FileConfigurationTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/unit/core/config/impl/FileConfigurationTest.java 2010-04-13 14:46:35 UTC (rev 9107)
+++ trunk/tests/src/org/hornetq/tests/unit/core/config/impl/FileConfigurationTest.java 2010-04-13 15:16:44 UTC (rev 9108)
@@ -164,12 +164,14 @@
DiscoveryGroupConfiguration dc = conf.getDiscoveryGroupConfigurations().get("dg1");
Assert.assertEquals("dg1", dc.getName());
Assert.assertEquals("192.168.0.120", dc.getGroupAddress());
+ assertEquals("172.16.8.10", dc.getLocalBindAddress());
Assert.assertEquals(11999, dc.getGroupPort());
Assert.assertEquals(12345, dc.getRefreshTimeout());
dc = conf.getDiscoveryGroupConfigurations().get("dg2");
Assert.assertEquals("dg2", dc.getName());
Assert.assertEquals("192.168.0.121", dc.getGroupAddress());
+ assertEquals("172.16.8.11", dc.getLocalBindAddress());
Assert.assertEquals(12999, dc.getGroupPort());
Assert.assertEquals(23456, dc.getRefreshTimeout());
15 years, 8 months
JBoss hornetq SVN: r9107 - branches/HnetQ_323_cn/docs/user-manual/zh.
by do-not-reply@jboss.org
Author: gaohoward
Date: 2010-04-13 10:46:35 -0400 (Tue, 13 Apr 2010)
New Revision: 9107
Modified:
branches/HnetQ_323_cn/docs/user-manual/zh/management.xml
Log:
save
Modified: branches/HnetQ_323_cn/docs/user-manual/zh/management.xml
===================================================================
--- branches/HnetQ_323_cn/docs/user-manual/zh/management.xml 2010-04-13 13:05:44 UTC (rev 9106)
+++ branches/HnetQ_323_cn/docs/user-manual/zh/management.xml 2010-04-13 14:46:35 UTC (rev 9107)
@@ -261,185 +261,141 @@
</section>
</section>
<section>
- <title>JMS Management API</title>
- <para>HornetQ defines a JMS Management API to manage JMS <emphasis>administrated
- objects</emphasis> (i.e. JMS queues, topics and connection factories).</para>
+ <title>JMS管理接口</title>
+ <para>HornetQ定义了一套JMS管理接口来管理JMS的<emphasis>可管理的对象</emphasis>
+ (例如JMS队列,话题及连接工厂)。</para>
<section>
- <title>JMS Server Management</title>
- <para>JMS Resources (connection factories and destinations) can be created using the
- <literal>JMSServerControl</literal> class (with the ObjectName <literal
- >org.hornetq:module=JMS,type=Server</literal> or the resource name <literal
- >jms.server</literal>).</para>
+ <title>JMS服务器管理</title>
+ <para><literal>JMSServerControl</literal>类(ObjectName <literal
+ >org.hornetq:module=JMS,type=Server</literal> 或资源名<literal
+ >jms.server</literal>)用来创建JMS资源(连接工厂和目标)。</para>
<itemizedlist>
<listitem>
- <para>Listing, creating, destroying connection factories</para>
- <para>Names of the deployed connection factories can be retrieved by the <literal
- >getConnectionFactoryNames()</literal> method.</para>
- <para>JMS connection factories can be created or destroyed using the <literal
- >createConnectionFactory()</literal> methods or <literal
- >destroyConnectionFactory()</literal> methods. These connection factories
- are bound to JNDI so that JMS clients can look them up. If a graphical console
- is used to create the connection factories, the transport parameters are
- specified in the text fied input as a comma-separated list of key=value (e.g.
- <literal>key1=10, key2="value", key3=false</literal>). If there are multiple
- transports defined, you need to enclose the key/value pairs between curly
- braces. For example <literal>{key=10}, {key=20}</literal>. In that case, the
- first <literal>key</literal> will be associated to the first transport
- configuration and the second <literal>key</literal> will be associated to the
- second transport configuration (see <xref linkend="configuring-transports"/>
- for a list of the transport parameters)</para>
+ <para>列表、创建、删除连接工厂</para>
+ <para>使用<literal>getConnectionFactoryNames()</literal> 方法可以列出部署的连接工厂的
+ 名字。</para>
+ <para>用<literal>createConnectionFactory()</literal>方法和<literal
+ >destroyConnectionFactory()</literal>方法能创建和删除JMS连接工厂。
+ 这些连接工厂都与JNDI绑定以便于客户端来查找。如果是在图形介面下创建连接工厂,在广本框内输入
+ 有关的传输参数时可使用一组用逗号隔开的键-值对(例如<literal>key1=10, key2="value", key3=false</literal>)。
+ 如果需要定义多个传输,你需要将每个传输的参数对用大括号括起来,例如<literal>{key=10}, {key=20}</literal>。
+ 第一个<literal>key</literal>属于第一个传输配置,第二个<literal>key</literal>属于第二个传输配置。
+ (有关传输的各种参数参见<xref linkend="configuring-transports"/>)。</para>
</listitem>
<listitem>
- <para>Listing, creating, destroying queues</para>
- <para>Names of the deployed JMS queues can be retrieved by the <literal
- >getQueueNames()</literal> method.</para>
- <para>JMS queues can be created or destroyed using the <literal
- >createQueue()</literal> methods or <literal>destroyQueue()</literal>
- methods. These queues are bound to JNDI so that JMS clients can look them
- up</para>
+ <para>列表、创建与删除队列</para>
+ <para><literal>getQueueNames()</literal>方法可以获得部署的JMS队列的名字列表。</para>
+ <para>JMS队列可以用<literal>createQueue()</literal>方法创建,用<literal>destroyQueue()</literal>方法删除。
+ 创建的队列都绑定到JNDI以便JMS客户端可以查找。</para>
</listitem>
<listitem>
- <para>Listing, creating/destroying topics</para>
- <para>Names of the deployed topics can be retrieved by the <literal
- >getTopicNames()</literal> method.</para>
- <para>JMS topics can be created or destroyed using the <literal
- >createTopic()</literal> or <literal>destroyTopic()</literal> methods. These
- topics are bound to JNDI so that JMS clients can look them up</para>
+ <para>列表、创建与删除话题(topic)</para>
+ <para><literal>getTopicNames()</literal>方法可以获得部署的JMS话题名字。</para>
+ <para>JMS话题可以用<literal>createTopic()</literal>方法来创建,用<literal>destroyTopic()</literal>方法来删除。
+ 创建的话题都绑定到JNDI以便客户端查找。</para>
</listitem>
<listitem>
- <para>Listing and closing remote connections</para>
- <para>JMS Clients remote addresses can be retrieved using <literal
- >listRemoteAddresses()</literal>. It is also possible to close the
- connections associated with a remote address using the <literal
- >closeConnectionsForAddress()</literal> method.</para>
- <para>Alternatively, connection IDs can be listed using <literal
- >listConnectionIDs()</literal> and all the sessions for a given connection
- ID can be listed using <literal>listSessions()</literal>.</para>
+ <para>远程连接的列表与关闭</para>
+ <para>用<literal>listRemoteAddresses()</literal>方法可以获得JMS客户端的远程地址。
+ 还可以用<literal>closeConnectionsForAddress()</literal>方法关闭与某个远程地址相关联的连接。</para>
+ <para>另外,<literal>listConnectionIDs()</literal>方法可以列出连接的ID,
+ 而<literal>listSessions()</literal>方法可以列出一个给定的连接ID的所有会话(session)。</para>
</listitem>
</itemizedlist>
</section>
<section>
- <title>JMS ConnectionFactory Management</title>
- <para>JMS Connection Factories can be managed using the <literal
- >ConnectionFactoryControl</literal> class (with the ObjectName <literal
- >org.hornetq:module=JMS,type=ConnectionFactory,name="<the connection factory
- name>"</literal> or the resource name <literal>jms.connectionfactory.<the
- connection factory name></literal>).</para>
+ <title>JMS连接工厂的管理</title>
+ <para>使用类(ObjectName <literal>org.hornetq:module=JMS,type=ConnectionFactory,
+ name="<连接工厂名>"</literal>或者资源名<literal>jms.connectionfactory.<
+ 连接工厂名></literal>)可以管理JMS的连接工厂。</para>
<itemizedlist>
<listitem>
- <para>Retrieving connection factory attributes</para>
- <para>The <literal>ConnectionFactoryControl</literal> exposes JMS
- ConnectionFactory configuration through its attributes (e.g. <literal
- >getConsumerWindowSize()</literal> to retrieve the consumer window size for
- flow control, <literal>isBlockOnNonDurableSend()</literal> to know wether the
- producers created from the connection factory will block or not when sending
- non-durable messages, etc.)</para>
+ <para>获得连接工厂的属性</para>
+ <para><literal>ConnectionFactoryControl</literal>类可以用来获得连接工厂的属性(
+ 例如<literal>getConsumerWindowSize()</literal>方法可以获得接收者流控制的窗口大小,
+ <literal>isBlockOnNonDurableSend()</literal>方法可以知道从这个连接工厂创建的发送
+ 者是否采用阻塞方式发送非持久的消息,等等)。</para>
</listitem>
</itemizedlist>
</section>
<section>
- <title>JMS Queue Management</title>
- <para>JMS queues can be managed using the <literal>JMSQueueControl</literal> class (with
- the ObjectName <literal>org.hornetq:module=JMS,type=Queue,name="<the queue
- name>"</literal> or the resource name <literal>jms.queue.<the queue
- name></literal>). </para>
- <para><emphasis>The management operations on a JMS queue are very similar to the
- operations on a core queue. </emphasis></para>
+ <title>JMS队列管理</title>
+ <para>使用<literal>JMSQueueControl</literal>类(ObjectName <literal>org.hornetq:module=JMS,
+ type=Queue,name="<队列名>"</literal>或资源名 <literal>jms.queue.<队列名
+ ></literal>可以管理JMS队列。</para>
+ <para><emphasis>JMS队列的管理操作与核心队列的管理十分相似。</emphasis></para>
<itemizedlist>
<listitem>
- <para>Expiring, sending to a dead letter address and moving messages</para>
- <para>Messages can be expired from a queue by using the <literal
- >expireMessages()</literal> method. If an expiry address is defined,
- messages will be be sent to it, otherwise they are discarded. The queue's
- expiry address can be set with the <literal>setExpiryAddress()</literal>
- method.</para>
- <para>Messages can also be sent to a dead letter address with the <literal
- >sendMessagesToDeadLetterAddress()</literal> method. It returns the number
- of messages which are sent to the dead letter address. If a dead letter address
- is not defined, message are removed from the queue and discarded. The queue's
- dead letter address can be set with the <literal
- >setDeadLetterAddress()</literal> method.</para>
- <para>Messages can also be moved from a queue to another queue by using the
- <literal>moveMessages()</literal> method.</para>
+ <para>过期,发送到死信地址和移动消息</para>
+ <para>可以使用<literal>expireMessages()</literal>方法将队列中的消息设成过期消息。
+ 如果配置有过期地址,消息就会被发到过期地址。过期地址可以用
+ <literal>setExpiryAddress()</literal>方法来设定。</para>
+ <para>使用<literal>sendMessagesToDeadLetterAddress()</literal>方法可以将消息发送到死信地址。
+ 它返回发送到死信地址消息的数量。如果没有设定死信地址,那么消息会被丢弃。使用
+ <literal>setDeadLetterAddress()</literal>方法可以设定队列的死信地址。</para>
+ <para><literal>moveMessages()</literal>方法将消息从一个队列移动到另一个队列。</para>
</listitem>
<listitem>
- <para>Listing and removing messages</para>
- <para>Messages can be listed from a queue by using the <literal
- >listMessages()</literal> method which returns an array of <literal
- >Map</literal>, one <literal>Map</literal> for each message.</para>
- <para>Messages can also be removed from the queue by using the <literal
- >removeMessages()</literal> method which returns a <literal
- >boolean</literal> for the single message ID variant or the number of
- removed messages for the filter variant. The <literal
- >removeMessages()</literal> method takes a <literal>filter</literal>
- argument to remove only filtered messages. Setting the filter to an empty
- string will in effect remove all messages.</para>
+ <para>列表与删除消息</para>
+ <para>使用<literal>listMessages()</literal>方法可以列出一个队列中的所有消息。它返回的是一个
+ Map的数组。每一个Map对应一个消息。</para>
+ <para>使用<literal>removeMessages()</literal>方法可以从队列中删除消息。如果带的参数是消息ID,
+ 返回的是一个布尔常是;如果带的参数是一个过滤器,则返回删除的消息数。带有过滤器参数的<literal
+ >removeMessages()</literal>方法只删除过滤器选择的消息。如果些参数是一个空字符串,那么将
+ 删除所有的消息。</para>
</listitem>
<listitem>
- <para>Counting messages</para>
- <para>The number of messages in a queue is returned by the <literal
- >getMessageCount()</literal> method. Alternatively, the <literal
- >countMessages()</literal> will return the number of messages in the queue
- which <emphasis>match a given filter</emphasis></para>
+ <para>消息计数</para>
+ <para>使用<literal>getMessageCount()</literal>方法可以得到队列中的消息数。另外,方法
+ <literal>countMessages()</literal>可以得到队列中所有与<emphasis>过滤器</emphasis>相匹配的消息数。</para>
</listitem>
<listitem>
- <para>Changing message priority</para>
- <para>The message priority can be changed by using the <literal
- >changeMessagesPriority()</literal> method which returns a <literal
- >boolean</literal> for the single message ID variant or the number of
- updated messages for the filter variant.</para>
+ <para>修改消息的优先级</para>
+ <para>消息的优先级可以用<literal>changeMessagesPriority()</literal>方法修改。如果是带一个消
+ 息ID参数,它返回的是一个布尔常量;如果是带一个过滤器参数,则它返回的是优先级更新了的消息数。</para>
</listitem>
<listitem>
- <para>Message counters</para>
- <para>Message counters can be listed for a queue with the <literal
- >listMessageCounter()</literal> and <literal
- >listMessageCounterHistory()</literal> methods (see <xref
- linkend="management.message-counters"/>)</para>
+ <para>消息计数器</para>
+ <para><literal>listMessageCounter()</literal>方法和<literal >listMessageCounterHistory()</literal>
+ 方法可以用来列出队列中的所有消息计数器。(参见 <xref
+ linkend="management.message-counters"/>)。</para>
</listitem>
<listitem>
- <para>Retrieving the queue attributes</para>
- <para>The <literal>JMSQueueControl</literal> exposes JMS queue settings through
- its attributes (e.g. <literal>isTemporary()</literal> to know wether the queue
- is temporary or not, <literal>isDurable()</literal> to know wether the queue is
- durable or not, etc.)</para>
+ <para>获取队列的属性</para>
+ <para><literal>JMSQueueControl</literal>类可以用来获取JMS队列的设置参数(例如方法<literal>isTemporary()</literal>
+ 可以判断队列是否为临时的,方法<literal>isDurable()</literal>可以判断队列是否为持久的等等)。</para>
</listitem>
<listitem>
- <para>Pausing and resuming queues</para>
- <para>The <literal>JMSQueueControl</literal> can pause and resume the underlying
- queue. When the queue is paused it will continue to receive messages but will
- not deliver them. When resumed again it will deliver the enqueued messages, if
- any. </para>
+ <para>队列的暂停与恢复</para>
+ <para><literal>JMSQueueControl</literal>可以暂停一个队列或恢复一个队列。
+ 如果一个队列被暂停,它虽然可以继续接收消息但是不传递消息;
+ 当被恢复时,队列又会开始传递消息。</para>
</listitem>
</itemizedlist>
</section>
<section>
- <title>JMS Topic Management</title>
- <para>JMS Topics can be managed using the <literal>TopicControl</literal> class (with
- the ObjectName <literal>org.hornetq:module=JMS,type=Topic,name="<the topic
- name>"</literal> or the resource name <literal>jms.topic.<the topic
- name></literal>).</para>
+ <title>JMS话题(Topic)的管理</title>
+ <para>JMS话题的管理是通过<literal>TopicControl</literal>类(
+ the ObjectName <literal>org.hornetq:module=JMS,type=Topic,name="<话题名>"</literal>
+ 或资源名 <literal>jms.topic.<话题名></literal>)。</para>
<itemizedlist>
<listitem>
- <para>Listing subscriptions and messages</para>
- <para>JMS topics subscriptions can be listed using the <literal
- >listAllSubscriptions()</literal>, <literal
- >listDurableSubscriptions()</literal>, <literal
- >listNonDurableSubscriptions()</literal> methods. These methods return
- arrays of <literal>Object</literal> representing the subscriptions information
- (subscription name, client ID, durability, message count, etc.). It is also
- possible to list the JMS messages for a given subscription with the <literal
- >listMessagesForSubscription()</literal> method.</para>
+ <para>订阅和消息的列表</para>
+ <para><literal>listAllSubscriptions()</literal>、<literal
+ >listDurableSubscriptions()</literal>、 <literal
+ >listNonDurableSubscriptions()</literal>方法可以列出话题的不同订阅。
+ 这些方法都返回<literal>Object</literal>数组,表示订阅的细节(如订阅名,
+ 客户ID,持久性,消息计数等)。用<literal
+ >listMessagesForSubscription()</literal>方法可以列出一个订阅上的JMS消息。</para>
</listitem>
<listitem>
- <para>Dropping subscriptions</para>
- <para>Durable subscriptions can be dropped from the topic using the <literal
- >dropDurableSubscription()</literal> method.</para>
+ <para>删除订阅</para>
+ <para>持久性订阅可以使用<literal>dropDurableSubscription()</literal>方法来删除。</para>
</listitem>
<listitem>
- <para>Counting subscriptions messages</para>
- <para>The <literal>countMessagesForSubscription()</literal> method can be used to
- know the number of messages held for a given subscription (with an optional
- message selector to know the number of messages matching the selector)</para>
+ <para>订阅消息计数</para>
+ <para><literal>countMessagesForSubscription()</literal>方法可以得到一个订阅上面所持有
+ 的消息数(还可带一个消息选择器来得出有多少消息与之匹配)。</para>
</listitem>
</itemizedlist>
</section>
15 years, 8 months
JBoss hornetq SVN: r9106 - trunk.
by do-not-reply@jboss.org
Author: jmesnil
Date: 2010-04-13 09:05:44 -0400 (Tue, 13 Apr 2010)
New Revision: 9106
Modified:
trunk/build-hornetq.xml
trunk/build-maven.xml
Log:
https://jira.jboss.org/jira/browse/HORNETQ-344: Add hornetq sources.jar in maven repo
* ./build.sh jar target creates *-sources.jar
* ./build.sh -f build-maven.xml will install/upload the sources jar in addition to the binaries jar
Modified: trunk/build-hornetq.xml
===================================================================
--- trunk/build-hornetq.xml 2010-04-13 08:04:49 UTC (rev 9105)
+++ trunk/build-hornetq.xml 2010-04-13 13:05:44 UTC (rev 9106)
@@ -55,19 +55,29 @@
<!-- ======================================================================================== -->
<property name="core.jar.name" value="hornetq-core.jar"/>
+ <property name="core.sources.jar.name" value="hornetq-core-sources.jar"/>
<property name="jms.jar.name" value="hornetq-jms.jar"/>
+ <property name="jms.sources.jar.name" value="hornetq-jms-sources.jar"/>
<property name="jms.client.jar.name" value="hornetq-jms-client.jar"/>
+ <property name="jms.client.sources.jar.name" value="hornetq-jms-client-sources.jar"/>
<property name="jnp.client.jar.name" value="jnp-client.jar"/>
<property name="jboss.integration.jar.name" value="hornetq-jboss-as-integration.jar"/>
+ <property name="jboss.integration.sources.jar.name" value="hornetq-jboss-as-integration-sources.jar"/>
<property name="bootstrap.jar.name" value="hornetq-bootstrap.jar"/>
+ <property name="bootstrap.sources.jar.name" value="hornetq-bootstrap-sources.jar"/>
<property name="logging.jar.name" value="hornetq-logging.jar"/>
+ <property name="logging.sources.jar.name" value="hornetq-logging-sources.jar"/>
<property name="core.client.jar.name" value="hornetq-core-client.jar"/>
+ <property name="core.client.sources.jar.name" value="hornetq-core-client-sources.jar"/>
<property name="ra.jar.name" value="hornetq-ra.jar"/>
+ <property name="ra.sources.jar.name" value="hornetq-ra-sources.jar"/>
<property name="ra.rar.name" value="hornetq-ra.rar"/>
<property name="netty.jar.name" value="netty.jar"/>
<property name="mc.jar.name" value="jboss-mc.jar"/>
<property name="service.sar.name" value="hornetq-service.sar"/>
+ <property name="service.sources.sar.name" value="hornetq-service-sources.sar"/>
<property name="resources.jar.name" value="hornetq-resources.jar"/>
+ <property name="resources.sources.jar.name" value="hornetq-resources-sources.jar"/>
<!--source and build dirs-->
<property name="build.dir" value="build"/>
@@ -103,6 +113,7 @@
<property name="native.bin.dir" value="native/bin"/>
<property name="examples.dir" value="examples"/>
<property name="tools.dir" value="tools"/>
+ <property name="build.examples.dir" value="${build.dir}/examples"/>
<property name="build.distro.dir"
value="${build.dir}/${build.artifact}"/>
@@ -597,8 +608,12 @@
<!-- Jar Targets -->
<!-- ======================================================================================== -->
+ <target name="sources-jar" description="create jar files containing source code"
+ depends="jar-core-sources, jar-core-client-sources, jar-jms-sources, jar-jms-client-sources, jar-jboss-integration-sources, jar-jboss-service-sources, jar-bootstrap-sources, jar-logging-sources, jar-ra-sources, jar-resources-sources">
+ </target>
+
<target name="jar"
- depends="jar-core, jar-core-client, jar-jms, jar-jms-client, jar-jboss-integration, jar-jboss-service, jar-bootstrap, jar-logging, jar-ra, jar-mc, jar-jnp-client, jar-resources">
+ depends="jar-core, jar-core-client, jar-jms, jar-jms-client, jar-jboss-integration, jar-jboss-service, jar-bootstrap, jar-logging, jar-ra, jar-mc, jar-jnp-client, jar-resources, sources-jar">
</target>
<target name="jar-jnp-client" depends="init">
@@ -642,6 +657,27 @@
</jar>
</target>
+
+ <target name="jar-core-sources">
+ <jar jarfile="${build.jars.dir}/${core.sources.jar.name}">
+ <fileset dir="${src.main.dir}">
+ <include name="**/hornetq/*.java"/>
+ <include name="**/hornetq/api/*.java"/>
+ <include name="**/hornetq/api/core/**/*.java"/>
+ <include name="**/hornetq/core/**/*.java"/>
+ <include name="**/hornetq/spi/**/*.java"/>
+ <include name="**/hornetq/utils/**/*.java"/>
+ </fileset>
+ <fileset dir="${src.config.dir}/common">
+ <include name="**/*.xsd"/>
+ <exclude name="**/hornetq-jms.xsd"/>
+ </fileset>
+ <manifest>
+ <attribute name="HornetQ-Version" value="${hornetq.version.string}"/>
+ <attribute name="HornetQ-SVN-URL" value="${hornetq.version.svnurl}"/>
+ </manifest>
+ </jar>
+ </target>
<target name="jar-jms" depends="compile-jms">
@@ -653,7 +689,18 @@
</jar>
</target>
-
+
+ <target name="jar-jms-sources">
+ <jar jarfile="${build.jars.dir}/${jms.sources.jar.name}">
+ <fileset dir="${src.main.dir}">
+ <include name="**/jms/**/*.java"/>
+ </fileset>
+ <fileset dir="${src.config.dir}/common">
+ <include name="**/hornetq-jms.xsd"/>
+ </fileset>
+ </jar>
+ </target>
+
<target name="jar-jms-client" depends="compile-jms">
<jar jarfile="${build.jars.dir}/${jms.client.jar.name}">
@@ -663,7 +710,17 @@
</jar>
</target>
-
+
+ <target name="jar-jms-client-sources">
+ <jar jarfile="${build.jars.dir}/${jms.client.sources.jar.name}">
+ <fileset dir="${src.main.dir}">
+ <include name="org/hornetq/api/jms/**/*.*"/>
+ <include name="org/hornetq/jms/client/**/*.*"/>
+ <include name="org/hornetq/jms/referenceable/**/*.*"/>
+ </fileset>
+ </jar>
+ </target>
+
<target name="jar-jboss-integration" depends="compile-jboss-integration">
<jar jarfile="${build.jars.dir}/${jboss.integration.jar.name}">
@@ -672,6 +729,14 @@
</target>
+ <target name="jar-jboss-integration-sources">
+ <jar jarfile="${build.jars.dir}/${jboss.integration.sources.jar.name}">
+ <fileset dir="${src.main.dir}">
+ <include name="org/hornetq/integration/jboss/**/*.java"/>
+ </fileset>
+ </jar>
+ </target>
+
<!-- author: Lucas Amador -->
<target name="jar-jboss-service" depends="compile-jboss-service">
@@ -681,6 +746,14 @@
</target>
+ <target name="jar-jboss-service-sources">
+ <jar jarfile="${build.jars.dir}/${service.sources.sar.name}">
+ <fileset dir="${src.main.dir}">
+ <include name="org/hornetq/service/**/*.java"/>
+ </fileset>
+ </jar>
+ </target>
+
<target name="jar-bootstrap" depends="compile-bootstrap">
<jar jarfile="${build.jars.dir}/${bootstrap.jar.name}">
@@ -689,6 +762,14 @@
</target>
+ <target name="jar-bootstrap-sources">
+ <jar jarfile="${build.jars.dir}/${bootstrap.sources.jar.name}">
+ <fileset dir="${src.main.dir}">
+ <include name="org/hornetq/integration/bootstrap/**/*.java"/>
+ </fileset>
+ </jar>
+ </target>
+
<target name="jar-logging" depends="compile-logging">
<jar jarfile="${build.jars.dir}/${logging.jar.name}">
@@ -697,6 +778,14 @@
</target>
+ <target name="jar-logging-sources">
+ <jar jarfile="${build.jars.dir}/${logging.sources.jar.name}">
+ <fileset dir="${src.main.dir}">
+ <include name="org/hornetq/integration/logging/**/*.java"/>
+ </fileset>
+ </jar>
+ </target>
+
<target name="jar-core-client" depends="compile-core">
<jar jarfile="${build.jars.dir}/${core.client.jar.name}">
<fileset dir="${build.core.classes.dir}">
@@ -730,6 +819,38 @@
</target>
+ <target name="jar-core-client-sources">
+ <jar jarfile="${build.jars.dir}/${core.client.sources.jar.name}">
+ <fileset dir="${src.main.dir}">
+ <include name="hornetq-version.properties"/>
+ <include name="org/hornetq/api/**/*.*"/>
+ <include name="org/hornetq/*.*"/>
+ <include name="org/hornetq/core/buffers/**/*.*"/>
+ <include name="org/hornetq/core/client/**/*.*"/>
+ <include name="org/hornetq/core/filter/**/*.*"/>
+ <include name="org/hornetq/core/exception/**/*.*"/>
+ <include name="org/hornetq/core/remoting/impl/**/*.*"/>
+ <include name="org/hornetq/utils/**/*.*"/>
+ <include name="org/hornetq/core/cluster/**/*.*"/>
+ <include name="org/hornetq/core/list/**/*.*"/>
+ <include name="org/hornetq/core/logging/**/*.*"/>
+ <include name="org/hornetq/core/message/**/*.*"/>
+ <include name="org/hornetq/core/protocol/core/**/*.*"/>
+ <include name="org/hornetq/core/remoting/**/*.*"/>
+ <include name="org/hornetq/core/version/**/*.*"/>
+ <include name="org/hornetq/core/management/*.*"/>
+ <include name="org/hornetq/core/transaction/impl/XidImpl.java"/>
+ <include name="org/hornetq/spi/core/logging/*.*"/>
+ <include name="org/hornetq/spi/core/protocol/*.*"/>
+ <include name="org/hornetq/spi/core/remoting/*.*"/>
+
+ <!-- required by SessionSendMessage -->
+ <include name="org/hornetq/core/server/ServerMessage.java"/>
+ <include name="org/hornetq/core/journal/EncodingSupport.java"/>
+ </fileset>
+ </jar>
+ </target>
+
<target name="jar-ra" depends="jar-core-client, jar-jms-client, compile-ra">
<jar jarfile="${build.jars.dir}/${ra.jar.name}">
<fileset dir="${build.ra.classes.dir}">
@@ -744,8 +865,15 @@
</jar>
</target>
- <property name="build.examples.dir" value="${build.dir}/examples"/>
- <target name="jar-resources" depends="init">
+ <target name="jar-ra-sources">
+ <jar jarfile="${build.jars.dir}/${ra.sources.jar.name}">
+ <fileset dir="${src.main.dir}">
+ <include name="org/hornetq/ra/**/*"/>
+ </fileset>
+ </jar>
+ </target>
+
+ <target name="jar-resources" depends="init">
<jar jarfile="${build.jars.dir}/${resources.jar.name}">
<fileset dir=".">
<include name="examples/**"/>
@@ -763,6 +891,21 @@
</jar>
</target>
+ <target name="jar-resources-sources">
+ <jar jarfile="${build.jars.dir}/${resources.sources.jar.name}">
+ <fileset dir=".">
+ <include name="examples/**"/>
+ <exclude name="**/build"/>
+ <exclude name="**/data"/>
+ </fileset>
+ <fileset dir="${src.config.dir}">
+ <include name="jboss-as/**"/>
+ <include name="ra.xml"/>
+ <exclude name="**/build.xml"/>
+ </fileset>
+ </jar>
+ </target>
+
<!-- ======================================================================================== -->
<!-- Distribution targets -->
<!-- ======================================================================================== -->
Modified: trunk/build-maven.xml
===================================================================
--- trunk/build-maven.xml 2010-04-13 08:04:49 UTC (rev 9105)
+++ trunk/build-maven.xml 2010-04-13 13:05:44 UTC (rev 9106)
@@ -144,6 +144,7 @@
</target>
<target name="upload-local-target">
+ <!-- install the jar -->
<exec executable="mvn">
<arg value="install:install-file"/>
<arg value="-DgroupId=org.hornetq"/>
@@ -152,9 +153,20 @@
<arg value="-Dpackaging=jar"/>
<arg value="-Dfile=./build/jars/${artifact.id}.jar"/>
</exec>
+ <!-- install the sources jar -->
+ <exec executable="mvn">
+ <arg value="install:install-file"/>
+ <arg value="-DgroupId=org.hornetq"/>
+ <arg value="-DartifactId=${artifact.id}"/>
+ <arg value="-Dversion=${hornetq.version}"/>
+ <arg value="-Dpackaging=jar"/>
+ <arg value="-Dclassifier=sources"/>
+ <arg value="-Dfile=./build/jars/${artifact.id}-sources.jar"/>
+ </exec>
</target>
<target name="upload">
+ <!-- upload the jar -->
<exec executable="mvn">
<arg value="deploy:deploy-file"/>
<arg value="-e"/>
@@ -167,10 +179,24 @@
<arg value="-DrepositoryId=snapshots.jboss.org"/>
<arg value="-Durl=dav:https://snapshots.jboss.org/maven2"/>
</exec>
+ <!-- upload the corresponding sources jar -->
+ <exec executable="mvn">
+ <arg value="deploy:deploy-file"/>
+ <arg value="-e"/>
+ <arg value="-DgroupId=org.hornetq"/>
+ <arg value="-DartifactId=${artifact.id}"/>
+ <arg value="-Dversion=${hornetq.version}"/>
+ <arg value="-Dpackaging=${artifact.type}"/>
+ <arg value="-DgeneratePom=true"/>
+ <arg value="-Dclassifier=sources"/>
+ <arg value="-Dfile=${jars.dir}/${artifact.id}-sources.${artifact.type}"/>
+ <arg value="-DrepositoryId=snapshots.jboss.org"/>
+ <arg value="-Durl=dav:https://snapshots.jboss.org/maven2"/>
+ </exec>
</target>
<target name="updateMavenRepos">
- <fail unless="hornetq.repos" message="*** Please set the hornetq.repos property i.e. -Dhornetq.repos=foo ***"/>
+ <fail unless="hornetq.repos" message="*** Please set the absolute path to hornetq.repos property i.e. -Dhornetq.repos=foo ***"/>
<property name="dest.dir" value="${hornetq.repos}"/>
@@ -221,6 +247,7 @@
<artifactId>${artifact.id}</artifactId>${line.separator}
<version>${hornetq.version}</version>${line.separator}</project>"/>
+ <!-- deploy the jar -->
<exec executable="mvn">
<arg value="-e"/>
<arg value="deploy:deploy-file"/>
@@ -233,7 +260,20 @@
<arg value="-DrepositoryId=jboss-releases"/>
<arg value="-Durl=file:///${dest.dir}"/>
</exec>
-
+ <!-- deploy the sources jar -->
+ <exec executable="mvn">
+ <arg value="-e"/>
+ <arg value="deploy:deploy-file"/>
+ <arg value="-DpomFile=${temporary.pom}"/>
+ <arg value="-DgroupId=org.hornetq"/>
+ <arg value="-DartifactId=${artifact.id}"/>
+ <arg value="-Dversion=${hornetq.version}"/>
+ <arg value="-Dpackaging=jar"/>
+ <arg value="-Dclassifier=sources"/>
+ <arg value="-Dfile=./build/jars/${artifact.id}-sources.jar"/>
+ <arg value="-DrepositoryId=jboss-releases"/>
+ <arg value="-Durl=file:///${dest.dir}"/>
+ </exec>
<delete file="${temporary.pom}"/>
</target>
15 years, 8 months
JBoss hornetq SVN: r9105 - trunk/src/main/org/hornetq/core/cluster/impl.
by do-not-reply@jboss.org
Author: timfox
Date: 2010-04-13 04:04:49 -0400 (Tue, 13 Apr 2010)
New Revision: 9105
Modified:
trunk/src/main/org/hornetq/core/cluster/impl/DiscoveryGroupImpl.java
Log:
https://jira.jboss.org/jira/browse/HORNETQ-291
Modified: trunk/src/main/org/hornetq/core/cluster/impl/DiscoveryGroupImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/cluster/impl/DiscoveryGroupImpl.java 2010-04-13 06:53:59 UTC (rev 9104)
+++ trunk/src/main/org/hornetq/core/cluster/impl/DiscoveryGroupImpl.java 2010-04-13 08:04:49 UTC (rev 9105)
@@ -75,7 +75,7 @@
private final int groupPort;
- private final Map<String, UniqueIDEntry> uniqueIDMap = new HashMap<String, UniqueIDEntry>();
+ private final Map<String, String> uniqueIDMap = new HashMap<String, String>();
private NotificationService notificationService;
@@ -221,77 +221,29 @@
}
}
- private static class UniqueIDEntry
- {
- String uniqueID;
-
- boolean changed;
-
- UniqueIDEntry(final String uniqueID)
- {
- this.uniqueID = uniqueID;
- }
-
- boolean isChanged()
- {
- return changed;
- }
-
- void setChanged()
- {
- changed = true;
- }
-
- String getUniqueID()
- {
- return uniqueID;
- }
-
- void setUniqueID(final String uniqueID)
- {
- this.uniqueID = uniqueID;
- }
- }
-
/*
* This is a sanity check to catch any cases where two different nodes are broadcasting the same node id either
* due to misconfiguration or problems in failover
*/
- private boolean uniqueIDOK(final String originatingNodeID, final String uniqueID)
+ private void checkUniqueID(final String originatingNodeID, final String uniqueID)
{
- UniqueIDEntry entry = uniqueIDMap.get(originatingNodeID);
+ String currentUniqueID = uniqueIDMap.get(originatingNodeID);
- if (entry == null)
+ if (currentUniqueID == null)
{
- entry = new UniqueIDEntry(uniqueID);
-
- uniqueIDMap.put(originatingNodeID, entry);
-
- return true;
+ uniqueIDMap.put(originatingNodeID, uniqueID);
}
else
{
- if (entry.getUniqueID().equals(uniqueID))
- {
- return true;
+ if (!currentUniqueID.equals(uniqueID))
+ {
+ log.warn("There are more than one servers on the network broadcasting the same node id. " +
+ "You will see this message exactly once (per node) if a node is restarted, in which case it can be safely " +
+ "ignored. But if it is logged continuously it means you really do have more than one node on the same network " +
+ "active concurrently with the same node id. This could occur if you have a backup node active at the same time as " +
+ "its live node.");
+ uniqueIDMap.put(originatingNodeID, uniqueID);
}
- else
- {
- // We allow one change - this might occur if one node fails over onto its backup which
- // has same node id but different unique id
- if (!entry.isChanged())
- {
- entry.setChanged();
-
- entry.setUniqueID(uniqueID);
-
- return true;
- }
- else
- {
- return false;
- }
- }
}
}
@@ -333,13 +285,8 @@
String uniqueID = buffer.readString();
- if (!uniqueIDOK(originatingNodeID, uniqueID))
- {
- DiscoveryGroupImpl.log.warn("There seem to be more than one broadcasters on the network broadcasting the same node id");
-
- continue;
- }
-
+ checkUniqueID(originatingNodeID, uniqueID);
+
if (nodeID.equals(originatingNodeID))
{
// Ignore traffic from own node
@@ -349,7 +296,7 @@
int size = buffer.readInt();
boolean changed = false;
-
+
synchronized (this)
{
for (int i = 0; i < size; i++)
15 years, 8 months
JBoss hornetq SVN: r9104 - trunk/tests/src/org/hornetq/tests/integration/cluster/distribution.
by do-not-reply@jboss.org
Author: timfox
Date: 2010-04-13 02:53:59 -0400 (Tue, 13 Apr 2010)
New Revision: 9104
Modified:
trunk/tests/src/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java
Log:
increased timeout
Modified: trunk/tests/src/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java 2010-04-12 17:19:25 UTC (rev 9103)
+++ trunk/tests/src/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java 2010-04-13 06:53:59 UTC (rev 9104)
@@ -80,7 +80,7 @@
TransportConstants.DEFAULT_PORT + 8,
TransportConstants.DEFAULT_PORT + 9, };
- private static final long WAIT_TIMEOUT = 30000;
+ private static final long WAIT_TIMEOUT = 60000;
@Override
protected void setUp() throws Exception
15 years, 8 months
JBoss hornetq SVN: r9103 - in trunk/src/config/jboss-as: non-clustered and 1 other directory.
by do-not-reply@jboss.org
Author: timfox
Date: 2010-04-12 13:19:25 -0400 (Mon, 12 Apr 2010)
New Revision: 9103
Modified:
trunk/src/config/jboss-as/clustered/hornetq-configuration.xml
trunk/src/config/jboss-as/non-clustered/hornetq-configuration.xml
Log:
https://jira.jboss.org/jira/browse/HORNETQ-268
Modified: trunk/src/config/jboss-as/clustered/hornetq-configuration.xml
===================================================================
--- trunk/src/config/jboss-as/clustered/hornetq-configuration.xml 2010-04-12 15:56:08 UTC (rev 9102)
+++ trunk/src/config/jboss-as/clustered/hornetq-configuration.xml 2010-04-12 17:19:25 UTC (rev 9103)
@@ -32,6 +32,7 @@
<connector name="in-vm">
<factory-class>org.hornetq.core.remoting.impl.invm.InVMConnectorFactory</factory-class>
+ <param key="server-id" value="${hornetq.server-id:0}"/>
</connector>
</connectors>
Modified: trunk/src/config/jboss-as/non-clustered/hornetq-configuration.xml
===================================================================
--- trunk/src/config/jboss-as/non-clustered/hornetq-configuration.xml 2010-04-12 15:56:08 UTC (rev 9102)
+++ trunk/src/config/jboss-as/non-clustered/hornetq-configuration.xml 2010-04-12 17:19:25 UTC (rev 9103)
@@ -30,6 +30,7 @@
<connector name="in-vm">
<factory-class>org.hornetq.core.remoting.impl.invm.InVMConnectorFactory</factory-class>
+ <param key="server-id" value="${hornetq.server-id:0}"/>
</connector>
</connectors>
15 years, 8 months
JBoss hornetq SVN: r9102 - branches/HnetQ_323_cn/docs/user-manual/zh.
by do-not-reply@jboss.org
Author: gaohoward
Date: 2010-04-12 11:56:08 -0400 (Mon, 12 Apr 2010)
New Revision: 9102
Modified:
branches/HnetQ_323_cn/docs/user-manual/zh/management.xml
branches/HnetQ_323_cn/docs/user-manual/zh/pre-acknowledge.xml
Log:
save work
Modified: branches/HnetQ_323_cn/docs/user-manual/zh/management.xml
===================================================================
--- branches/HnetQ_323_cn/docs/user-manual/zh/management.xml 2010-04-12 15:39:30 UTC (rev 9101)
+++ branches/HnetQ_323_cn/docs/user-manual/zh/management.xml 2010-04-12 15:56:08 UTC (rev 9102)
@@ -17,290 +17,245 @@
<!-- permitted by applicable law. -->
<!-- ============================================================================= -->
<chapter id="management">
- <title>Management</title>
- <para>HornetQ has an extensive management API that allows a user to modify a server
- configuration, create new resources (e.g. JMS queues and topics), inspect these resources
- (e.g. how many messages are currently held in a queue) and interact with it (e.g. to remove
- messages from a queue). All the operations allows a client to <emphasis>manage</emphasis>
- HornetQ. It also allows clients to subscribe to management notifications.</para>
- <para>There are 3 ways to manage HornetQ:</para>
+ <title>管理</title>
+ <para>HornetQ拥有套丰富的管理接口。用户使用这些接口可以修改服务器配置、创建新的资源(如队列和
+ 话题)、检查这些资源(如队列中有多少消息)并进行管理(从队列中删除消息)。这样用户可以
+ <emphasis>管理</emphasis>HornetQ。另外,客户还可以订阅管理通知。</para>
+ <para>有三种方式管理HornetQ:</para>
<itemizedlist>
<listitem>
- <para>Using JMX -- JMX is the standard way to manage Java applications</para>
+ <para>使用JMX -- JMX是标准的Java应用程序管理方式。</para>
</listitem>
<listitem>
- <para>Using the core API -- management operations are sent to HornetQ server using
- <emphasis>core messages</emphasis></para>
+ <para>使用核心接口 -- 管理操作通过<emphasis>核心消息</emphasis>的方法发向HornetQ服
+ 务。</para>
</listitem>
<listitem>
- <para>Using the JMS API -- management operations are sent to HornetQ server using
- <emphasis>JMS messages</emphasis></para>
+ <para>使用JMS接口 -- 管理操作通过<emphasis>JMS消息</emphasis>的方式发向HornetQ服务器。</para>
</listitem>
</itemizedlist>
- <para>Although there are 3 different ways to manage HornetQ each API supports the same
- functionality. If it is possible to manage a resource using JMX it is also possible to achieve
- the same result using Core messages or JMS messages.</para>
- <para>This choice depends on your requirements, your application settings and your environment to
- decide which way suits you best.</para>
+ <para>虽然有三种方式,但它们提供相同的功能。使用JMX方法能完成的功能使用核心接口或JMS接口都可以完成。</para>
+ <para>根据不同的应用环境来选择最适当的方式。</para>
<section>
- <title>The Management API</title>
- <para>Regardless of the way you <emphasis>invoke</emphasis> management operations, the
- management API is the same.</para>
- <para>For each <emphasis>managed resource</emphasis>, there exists a Java interface describing
- what can be invoked for this type of resource.</para>
- <para>HornetQ exposes its managed resources in 2 packages:</para>
+ <title>管理接口API</title>
+ <para>不管使用哪种方式,管理接口都是一样的。</para>
+ <para>对于每个<emphasis>被管理的资源</emphasis>都有一个Java的接口提供可使用的操作。</para>
+ <para>HornetQ的管理接口分布在2个包中:</para>
<itemizedlist>
<listitem>
- <para><emphasis>Core</emphasis> resources are located in the <literal
- >org.hornetq.api.core.management</literal> package</para>
+ <para><emphasis>核心</emphasis>资源的管理接口在 <literal
+ >org.hornetq.api.core.management</literal>包中。</para>
</listitem>
<listitem>
- <para><emphasis>JMS</emphasis> resources are located in the <literal
- >org.hornetq.api.jms.management</literal> package</para>
+ <para><emphasis>JMS</emphasis>资源的管理接口在 <literal
+ >org.hornetq.api.jms.management</literal>包中。</para>
</listitem>
</itemizedlist>
- <para>The way to invoke a <emphasis>management operations</emphasis> depends whether JMX, core
- messages, or JMS messages are used.</para>
+ <para>调用<emphasis>管理操作</emphasis>的方法由所使用是方式是JMX、核心消息还是JMS
+ 消息来决定。</para>
<note>
- <para>A few management operations requires a <literal>filter</literal> parameter to chose
- which messages are involved by the operation. Passing <literal>null</literal> or an
- empty string means that the management operation will be performed on <emphasis>all
- messages</emphasis>.</para>
+ <para>一小部分的管理接口需要一个<literal>过滤器</literal>参数来选择需要的消息。
+ 如果要求<emphasis>所有的消息</emphasis>,传递该参数时使用<literal>
+ null</literal>或者一个空的字符串即可。</para>
</note>
<section>
- <title>Core Management API</title>
- <para>HornetQ defines a core management API to manage core resources. For full details of
- the API please consult the javadoc. In summary:</para>
+ <title>核心管理接口</title>
+ <para>HornetQ定义了一套对核心资源的管理接口。关于它们的详细说明请参见相应的javadoc。
+ 下面是对它们的概述:</para>
<section>
- <title>Core Server Management</title>
+ <title>核心服务器管理</title>
<itemizedlist>
<listitem>
- <para>Listing, creating, deploying and destroying queues</para>
- <para>A list of deployed core queues can be retrieved using the <literal
- >getQueueNames()</literal> method.</para>
- <para>Core queues can be created or destroyed using the management operations
- <literal>createQueue()</literal> or <literal>deployQueue()</literal> or
- <literal>destroyQueue()</literal>)on the <literal
- >HornetQServerControl</literal> (with the ObjectName <literal
- >org.hornetq:module=Core,type=Server</literal> or the resource name <literal
- >core.server</literal>)</para>
- <para><literal>createQueue</literal> will fail if the queue already exists while
- <literal>deployQueue</literal> will do nothing.</para>
+ <para>队列的列表、创建、部署与删除</para>
+ <para><literal>getQueueNames()</literal> method方法用来列出所有已经部署的队列。</para>
+ <para>在<literal>HornetQServerControl</literal> (ObjectName <literal
+ >org.hornetq:module=Core,type=Server</literal>或资源名<literal
+ >core.server</literal>)上有队列创建或删除的方法,它们是
+ <literal>createQueue()</literal>、<literal>deployQueue()</literal>和
+ <literal>destroyQueue()</literal>。</para>
+ <para>如果队列已经存在,那么<literal>createQueue</literal>方法调用会出错,而
+ <literal>deployQueue</literal>方法调用没有任何作用。</para>
</listitem>
<listitem>
- <para>Pausing and resuming Queues</para>
- <para>The <literal>QueueControl</literal> can pause and resume the underlying
- queue. When a queue is paused, it will receive messages but will not deliver
- them. When it's resumed, it'll begin delivering the queued messages, if any.
+ <para>暂停与恢复队列</para>
+ <para><literal>QueueControl</literal>可用来暂停与恢复队列。如果一个队列被暂停,它
+ 虽然可以继续接收消息但是不传递消息;当被恢复时,队列又会开始传递消息。
</para>
</listitem>
<listitem>
- <para>Listing and closing remote connections</para>
- <para>Client's remote addresses can be retrieved using <literal
- >listRemoteAddresses()</literal>. It is also possible to close the
- connections associated with a remote address using the <literal
- >closeConnectionsForAddress()</literal> method.</para>
- <para>Alternatively, connection IDs can be listed using <literal
- >listConnectionIDs()</literal> and all the sessions for a given connection
- ID can be listed using <literal>listSessions()</literal>.</para>
+ <para>远程连接的列表与关闭</para>
+ <para><literal>listRemoteAddresses()</literal>方法可以用来列出客户端的远程地址。
+ 还可以使用<literal>closeConnectionsForAddress()</literal>方法来关闭
+ 与该地址相关的远程连接。</para>
+ <para>另外,使用<literal>listConnectionIDs()</literal>方法可以列出连接ID,
+ 使用<literal>listSessions()</literal>方法可以列出与一个连接ID相关的所有
+ 会话(session)。</para>
</listitem>
<listitem>
- <para>Transaction heuristic operations</para>
- <para>In case of a server crash, when the server restarts, it it possible that
- some transaction requires manual intervention. The <literal
- >listPreparedTransactions()</literal> method lists the transactions which
- are in the prepared states (the transactions are represented as opaque Base64
- Strings.) To commit or rollback a given prepared transaction, the <literal
- >commitPreparedTransaction</literal>() or <literal
- >rollbackPreparedTransaction()</literal> method can be used to resolve
- heuristic transactions. Heuristically completed transactions can be listed
- using the <literal>listHeuristicCommittedTransactions()</literal> and <literal
- >listHeuristicRolledBackTransactions</literal> methods.</para>
+ <para>事务的手动操作(heuristic operations)</para>
+ <para>当服务器由于故障而重新启动时,可能造成一些事务没有完成而需要人工干预。
+ <literal>listPreparedTransactions()</literal>方法可以列出所有处于
+ 准备(prepared)状态的事务(事务是用Base64字符串的形式列出)。如果要提交或回滚,
+ 可以使用<literal>commitPreparedTransaction()</literal>方法或
+ <literal>rollbackPreparedTransaction()</literal>方法。采用启发式
+ (heuristic)完成的事务可以用<literal>listHeuristicCommittedTransactions()</literal>
+ 方法和<literal>listHeuristicRolledBackTransactions</literal>方法列出。</para>
</listitem>
<listitem>
- <para>Enabling and resetting Message counters</para>
- <para>Message counters can be enabled or disabled using the <literal
- >enableMessageCounters()</literal> or <literal
- >disableMessageCounters()</literal> method. To reset message counters, it is
- possible to invoke <literal>resetAllMessageCounters()</literal> and <literal
- >resetAllMessageCounterHistories()</literal> methods.</para>
+ <para>打开和重置消息计数器</para>
+ <para>消息计数器可以用<literal>enableMessageCounters()</literal>方法打开,用
+ <literal>disableMessageCounters()</literal>方法关闭。如果要重置消息计数器,
+ 可以使用<literal>resetAllMessageCounters()</literal>方法和
+ <literal>resetAllMessageCounterHistories()</literal>方法。</para>
</listitem>
<listitem>
- <para>Retrieving the server configuration and attributes</para>
- <para>The <literal>HornetQServerControl</literal> exposes HornetQ server
- configuration through all its attributes (e.g. <literal>getVersion()</literal>
- method to retrieve the server's version, etc.)</para>
+ <para>获得服务器的配置和属性</para>
+ <para><literal>HornetQServerControl</literal>提供了访问HornetQ服务器所有属性
+ 的方法(例如<literal>getVersion()</literal>方法可以得到服务器的版本,等等)。 </para>
</listitem>
</itemizedlist>
</section>
<section>
- <title>Core Address Management</title>
- <para>Core addresses can be managed using the <literal>AddressControl</literal> class
- (with the ObjectName <literal>org.hornetq:module=Core,type=Address,name="<the
- address name>"</literal> or the resource name <literal>core.address.<the
- address name></literal>). </para>
+ <title>核心地址的管理</title>
+ <para>核心地址可以通过<literal>AddressControl</literal>类进行访问(ObjectName
+ 是 <literal>org.hornetq:module=Core,type=Address,name="<the
+ address name>"</literal>或者资源名 <literal>core.address.<the
+ address name></literal>)。</para>
<itemizedlist>
<listitem>
- <para>Modifying roles and permissions for an address</para>
- <para>You can add or remove roles associated to a queue using the <literal
- >addRole()</literal> or. <literal>removeRole()</literal> methods. You can
- list all the roles associated to the queue with the <literal
- >getRoles()</literal> method</para>
+ <para>修改地址的角色和权限。</para>
+ <para>你可以使用<literal>addRole()</literal>方法或<literal>removeRole()</literal>
+ 方法添加或删除地址的角色。用<literal>getRoles()</literal>方法可以列出一个地址的所有角色。</para>
</listitem>
</itemizedlist>
</section>
<section>
- <title>Core Queue Management</title>
- <para>The bulk of the core management API deals with core queues. The <literal
- >QueueControl</literal> class defines the Core queue management operations (with
- the ObjectName <literal>org.hornetq:module=Core,type=Queue,address="<the bound
- address>",name="<the queue name>"</literal> or the resource name <literal
- >core.queue.<the queue name></literal>).</para>
- <para>Most of the management operations on queues take either a single message ID (e.g.
- to remove a single message) or a filter (e.g. to expire all messages with a given
- property.)</para>
+ <title>核心队列的管理</title>
+ <para>管理接口中的一大部分是管理核心队列的。<literal>QueueControl</literal>类定义了核心队列的管理
+ 接口(ObjectName <literal>org.hornetq:module=Core,type=Queue,address="<绑定地址
+ address>",name="<队列名>"</literal> 或资源名 <literal
+ >core.queue.<队列名></literal>)。</para>
+ <para>绝大部分的队列管理方法需要一个消息ID参数(如删除一个消息)或一个过滤器参数(如将具有某个
+ 属性值的所有消息设置为过期)。</para>
<itemizedlist>
<listitem>
- <para>Expiring, sending to a dead letter address and moving messages</para>
- <para>Messages can be expired from a queue by using the <literal
- >expireMessages()</literal> method. If an expiry address is defined,
- messages will be be sent to it, otherwise they are discarded. The queue's
- expiry address can be set with the <literal>setExpiryAddress()</literal>
- method.</para>
- <para>Messages can also be sent to a dead letter address with the <literal
- >sendMessagesToDeadLetterAddress()</literal> method. It returns the number
- of messages which are sent to the dead letter address. If a dead letter address
- is not defined, message are removed from the queue and discarded. The queue's
- dead letter address can be set with the <literal
- >setDeadLetterAddress()</literal> method.</para>
- <para>Messages can also be moved from a queue to another queue by using the
- <literal>moveMessages()</literal> method.</para>
+ <para>消息的过期,发向死信地址及删除</para>
+ <para><literal>expireMessages()</literal>方法可以使消息过期。如果设置了一个过期地址,
+ 这些消息会被发到过期地址。否则这些消息会被丢弃。<literal>setExpiryAddress()</literal>
+ 方法可以用来设置队列的过期地址。</para>
+ <para>消息可以用<literal>sendMessagesToDeadLetterAddress()</literal>方法发送到
+ 一个死信地址。它返回发到这个死信地址的消息的数量。如果没有设置死信地址,那么消息就会从队列中
+ 删除。用<literal>setDeadLetterAddress()</literal>方法可以设置队列的死信地址。</para>
+ <para>消息还可以从一个队列转移到另一个队列。其方法是
+ <literal>moveMessages()</literal>。</para>
</listitem>
<listitem>
- <para>Listing and removing messages</para>
- <para>Messages can be listed from a queue by using the <literal
- >listMessages()</literal> method which returns an array of <literal
- >Map</literal>, one <literal>Map</literal> for each message.</para>
- <para>Messages can also be removed from the queue by using the <literal
- >removeMessages()</literal> method which returns a <literal
- >boolean</literal> for the single message ID variant or the number of
- removed messages for the filter variant. The <literal
- >removeMessages()</literal> method takes a <literal>filter</literal>
- argument to remove only filtered messages. Setting the filter to an empty
- string will in effect remove all messages.</para>
+ <para>消息的列表与删除</para>
+ <para>用<literal>listMessages()</literal>方法可以列出一个队列中的所有消息。这个方法
+ 返回的是一个<literal>Map</literal>的数组。每一个Map对应一个消息。</para>
+ <para>消息可以用<literal>removeMessages()</literal>方法删除。如果是使用消息ID,
+ 返回的是一个布尔常量;如果是用过滤器,则返回的
+ 是删除的消息数量。在使用过滤器来删除过滤的消息时,如果传入一个空字符串则表示要删除
+ 所有的消息。</para>
</listitem>
<listitem>
- <para>Counting messages</para>
- <para>The number of messages in a queue is returned by the <literal
- >getMessageCount()</literal> method. Alternatively, the <literal
- >countMessages()</literal> will return the number of messages in the queue
- which <emphasis>match a given filter</emphasis></para>
+ <para>消息计数</para>
+ <para>一个队列中的消息数可以用<literal>getMessageCount()</literal>方法获得。
+ 此外,<literal>countMessages()</literal>方法可以返回队列中与一
+ 个<emphasis>过滤器</emphasis>匹配的消息数量。</para>
</listitem>
<listitem>
- <para>Changing message priority</para>
- <para>The message priority can be changed by using the <literal
- >changeMessagesPriority()</literal> method which returns a <literal
- >boolean</literal> for the single message ID variant or the number of
- updated messages for the filter variant.</para>
+ <para>修改消息的优先级</para>
+ <para>用<literal>changeMessagesPriority()</literal>方法可以改变消息的优先级。
+ 该方法如果带一个消息ID参数,返回一个布尔常量;如果带一个过滤器参数,返回优先级
+ 被更新的消息的数量。</para>
</listitem>
<listitem>
- <para>Message counters</para>
- <para>Message counters can be listed for a queue with the <literal
- >listMessageCounter()</literal> and <literal
- >listMessageCounterHistory()</literal> methods (see <xref
- linkend="management.message-counters"/>). The message counters can also be
- reset for a single queue using the <literal>resetMessageCounter()</literal>
- method.</para>
+ <para>消息计数器</para>
+ <para>用<literal>listMessageCounter()方法和<literal>
+ listMessageCounterHistory()</literal>方法可以列出一个队列的消息计数器。
+ (参见 <xref linkend="management.message-counters"/>)。消息计数器还可以
+ 用<literal>resetMessageCounter()</literal>方法重置。</para>
</listitem>
<listitem>
- <para>Retrieving the queue attributes</para>
- <para>The <literal>QueueControl</literal> exposes Core queue settings through its
- attributes (e.g. <literal>getFilter()</literal> to retrieve the queue's filter
- if it was created with one, <literal>isDurable()</literal> to know whether the
- queue is durable or not, etc.)</para>
+ <para>获得队列的属性</para>
+ <para>通过<literal>QueueControl</literal>可以获得核心队列的属性(例如用
+ <literal>getFilter()</literal>方法可以得到队列的
+ 过滤器,<literal>isDurable()</literal>方法可以知道队列是否是持久的队列等等)。</para>
</listitem>
<listitem>
- <para>Pausing and resuming Queues</para>
- <para>The <literal>QueueControl</literal> can pause and resume the underlying
- queue. When a queue is paused, it will receive messages but will not deliver
- them. When it's resume, it'll begin delivering the queued messages, if any.
- </para>
+ <para>暂停和恢复队列</para>
+ <literal>QueueControl</literal>可用来暂停与恢复队列。如果一个队列被暂停,它
+ 虽然可以继续接收消息但是不传递消息;当被恢复时,队列又会开始传递消息。<para>
</listitem>
</itemizedlist>
</section>
<section>
- <title>Other Core Resources Management</title>
- <para>HornetQ allows to start and stop its remote resources (acceptors, diverts,
- bridges, etc.) so that a server can be taken off line for a given period of time
- without stopping it completely (e.g. if other management operations must be performed
- such as resolving heuristic transactions). These resources are:</para>
+ <title>其它核心资源的管理</title>
+ <para>HornetQ允许用户启动或停止其远程资源(接收器,转发器,桥,等等)。这样可以使服务器暂停工作
+ 而不需要完全停止服务器(比如可以临时对服务器进行一些离线操作,像对一些事务的处理)。这些资源有:</para>
<itemizedlist>
<listitem>
- <para>Acceptors</para>
- <para>They can be started or stopped using the <literal>start()</literal> or.
- <literal>stop()</literal> method on the <literal>AcceptorControl</literal>
- class (with the ObjectName <literal
- >org.hornetq:module=Core,type=Acceptor,name="<the acceptor
- name>"</literal> or the resource name <literal>core.acceptor.<the
- address name></literal>). The acceptors parameters can be retrieved using
- the <literal>AcceptorControl</literal> attributes (see <xref
- linkend="configuring-transports.acceptors"/>)</para>
+ <para>接收器</para>
+ <para>用<literal>AcceptorControl</literal>类(ObjectName <literal
+ >org.hornetq:module=Core,type=Acceptor,name="<接收器名
+ >"</literal> 或资源名 <literal>core.acceptor.<地址名
+ ></literal>)的<literal>start()</literal>方法启动,用<literal>
+ stop()</literal>方法停止。接收器的参数可以通过<literal>AcceptorControl</literal>
+ 的属性获得。(参见 <xref
+ linkend="configuring-transports.acceptors"/>)。</para>
</listitem>
<listitem>
- <para>Diverts</para>
- <para>They can be started or stopped using the <literal>start()</literal> or
- <literal>stop()</literal> method on the <literal>DivertControl</literal>
- class (with the ObjectName <literal
- >org.hornetq:module=Core,type=Divert,name=<the divert name></literal>
- or the resource name <literal>core.divert.<the divert name></literal>).
- Diverts parameters can be retrieved using the <literal>DivertControl</literal>
- attributes (see <xref linkend="diverts"/>)</para>
+ <para>转发器</para>
+ <para>用<literal>DivertControl</literal>(ObjectName是 <literal
+ >org.hornetq:module=Core,type=Divert,name=<转发器名></literal>
+ 或资源名<literal>core.divert.<转发器></literal>)类的
+ <literal>start()</literal>方法可以启动,用<literal>stop()</literal>方法可以停止。
+ 通过<literal>DivertControl</literal>还可以获得转发器的各种属性。(参见 <xref
+ linkend="diverts"/>)。</para>
</listitem>
<listitem>
- <para>Bridges</para>
- <para>They can be started or stopped using the <literal>start()</literal> (resp.
- <literal>stop()</literal>) method on the <literal>BridgeControl</literal>
- class (with the ObjectName <literal
- >org.hornetq:module=Core,type=Bridge,name="<the bridge
- name>"</literal> or the resource name <literal>core.bridge.<the bridge
- name></literal>). Bridges parameters can be retrieved using the <literal
- >BridgeControl</literal> attributes (see <xref linkend="core-bridges"
- />)</para>
+ <para>桥</para>
+ <para>桥可以通过<literal>BridgeControl</literal>类(ObjectName <literal
+ >org.hornetq:module=Core,type=Bridge,name="<桥的名字
+ >"</literal> 或资源名 <literal>core.bridge.<桥的名字
+ ></literal>)的<literal>start()</literal>
+ 方法启动,用<literal>stop()</literal>方法停止。它的属性可以通过
+ <literal>BridgeControl</literal>的属性获得(参见
+ <xref linkend="core-bridges"/>)。</para>
</listitem>
<listitem>
- <para>Broadcast groups</para>
- <para>They can be started or stopped using the <literal>start()</literal> or
- <literal>stop()</literal> method on the <literal
- >BroadcastGroupControl</literal> class (with the ObjectName <literal
- >org.hornetq:module=Core,type=BroadcastGroup,name="<the broadcast group
- name>"</literal> or the resource name <literal
- >core.broadcastgroup.<the broadcast group name></literal>). Broadcast
- groups parameters can be retrieved using the <literal
- >BroadcastGroupControl</literal> attributes (see <xref
- linkend="clusters.broadcast-groups"/>)</para>
+ <para>广播组</para>
+ <para>广播组可以通过<literal>BroadcastGroupControl</literal>类(ObjectName <literal
+ >org.hornetq:module=Core,type=BroadcastGroup,name="<广播组名
+ >"</literal> 或者资源名 <literal
+ >core.broadcastgroup.<广播组名></literal>)的<literal>
+ start()</literal>方法启动,用<literal>stop()</literal>方法停止。
+ 它的属性也可以通过<literal
+ >BroadcastGroupControl</literal>的属性获得(参见<xref
+ linkend="clusters.broadcast-groups"/>)。</para>
</listitem>
<listitem>
- <para>Discovery groups</para>
- <para>They can be started or stopped using the <literal>start()</literal> or
- <literal>stop()</literal> method on the <literal
- >DiscoveryGroupControl</literal> class (with the ObjectName <literal
- >org.hornetq:module=Core,type=DiscoveryGroup,name="<the discovery group
- name>"</literal> or the resource name <literal>core.discovery.<the
- discovery group name></literal>). Discovery groups parameters can be
- retrieved using the <literal>DiscoveryGroupControl</literal> attributes (see
- <xref linkend="clusters.discovery-groups"/>)</para>
+ <para>发现组</para>
+ <para>发现组可以通过<literal>DiscoveryGroupControl</literal>类
+ (ObjectName <literal>org.hornetq:module=Core,type=DiscoveryGroup,
+ name="<发现组名>"</literal> 或资源名<literal>core.discovery.<
+ 发现组名></literal>)的
+ <literal>start()</literal>方法启动,用<literal>stop()</literal>方法停止。
+ 它的参数可以通过<literal>DiscoveryGroupControl</literal>的属性获得(参见
+ <xref linkend="clusters.discovery-groups"/>)。</para>
</listitem>
<listitem>
- <para>Cluster connections</para>
- <para>They can be started or stopped using the <literal>start()</literal> or
- <literal>stop()</literal> method on the <literal
- >ClusterConnectionControl</literal> class (with the ObjectName <literal
- >org.hornetq:module=Core,type=ClusterConnection,name="<the cluster
- connection name>"</literal> or the resource name <literal
- >core.clusterconnection.<the cluster connection name></literal>).
- Cluster connections parameters can be retrieved using the <literal
- >ClusterConnectionControl</literal> attributes (see <xref
- linkend="clusters.cluster-connections"/>)</para>
+ <para>集群连接</para>
+ <para>集群连接可以通过<literal>ClusterConnectionControl</literal>类(
+ ObjectName <literal
+ >org.hornetq:module=Core,type=ClusterConnection,name="<集群连接名
+ >"</literal> 或资源名 <literal
+ >core.clusterconnection.<集群连接名></literal>)的<literal>
+ start()</literal>方法启动,用<literal>stop()</literal>方法停止。
+ 它的参数可以通过<literal
+ >ClusterConnectionControl</literal>的属性来获得(参见
+ <xref linkend="clusters.cluster-connections"/>)。</para>
</listitem>
</itemizedlist>
</section>
Modified: branches/HnetQ_323_cn/docs/user-manual/zh/pre-acknowledge.xml
===================================================================
--- branches/HnetQ_323_cn/docs/user-manual/zh/pre-acknowledge.xml 2010-04-12 15:39:30 UTC (rev 9101)
+++ branches/HnetQ_323_cn/docs/user-manual/zh/pre-acknowledge.xml 2010-04-12 15:56:08 UTC (rev 9102)
@@ -17,8 +17,8 @@
<!-- permitted by applicable law. -->
<!-- ============================================================================= -->
<chapter id="pre-acknowledge">
- <title>Pre-Acknowledge Mode</title>
- <para>JMS specifies 3 acknowledgement modes:</para>
+ <title>预先通知模式(pre-acknowledge)</title>
+ <para>JMS 规定了三种消息通知方式</para>
<itemizedlist>
<listitem>
<para><literal>AUTO_ACKNOWLEDGE</literal></para>
@@ -30,30 +30,22 @@
<para><literal>DUPS_OK_ACKNOWLEDGE</literal></para>
</listitem>
</itemizedlist>
- <para>However there is another case which is not supported by JMS: In some cases you can afford
- to lose messages in event of failure, so it would make sense to acknowledge the message on the
- server <emphasis>before</emphasis> delivering it to the client.</para>
- <para>This extra mode is supported by HornetQ and will call it
- <emphasis>pre-acknowledge</emphasis> mode.</para>
- <para>The disadvantage of acknowledging on the server before delivery is that the message will be
- lost if the system crashes <emphasis>after</emphasis> acknowledging the message on the server
- but <emphasis>before</emphasis> it is delivered to the client. In that case, the message is
- lost and will not be recovered when the system restart.</para>
- <para>Depending on your messaging case, <literal>pre-acknowledgement</literal> mode can avoid
- extra network traffic and CPU at the cost of coping with message loss.</para>
- <para>An example of a use case for pre-acknowledgement is for stock price update messages. With
- these messages it might be reasonable to lose a message in event of crash, since the next
- price update message will arrive soon, overriding the previous price. </para>
+ <para>还有一种情况JMS不支持:应用程序在出现故障时可以容忍消息丢失,这样可以在消息在传递给客户
+ 端<emphasis>之前</emphasis>就通知服务器。</para>
+ <para>HornetQ支持这种模式,称为<emphasis>pre-acknowledge</emphasis>。</para>
+ <para>这种模式的缺点是消息在通知后,如果系统出现故障时,消息可能丢失。并且在系统重启后该消息
+ 不能恢复。</para>
+ <para>使用<literal>pre-acknowledgement</literal>模式可以节省网络传输和CPU处理资源。</para>
+ <para>股票价格更新是一个适用于此模式的例子。如果因为服务器故障丢失了一些消息,等服务器重启后新的
+ 股票更新消息很快到达,以前丢失的过时的股票消息即使丢失也无关紧要。 </para>
<note>
- <para>Please note, that if you use pre-acknowledge mode, then you will lose transactional
- semantics for messages being consumed, since clearly they are being acknowledged first on
- the server, not when you commit the transaction. This may be stating the obvious but we
- like to be clear on these things to avoid confusion!</para>
+ <para>注意如果你使用pre-acknowledge模式,在接收消息端不能支持事务。因为这个模式不是在提交时
+ 通知消息,是在消息在传递之前就通知了。</para>
</note>
<section id="pre-acknowledge.configure">
- <title>Using PRE_ACKNOWLEDGE</title>
- <para>This can be configured in the <literal>hornetq-jms.xml</literal> file on the <literal
- >connection factory</literal> like this:</para>
+ <title>使用PRE_ACKNOWLEDGE</title>
+ <para>这个模式在<literal>hornetq-jms.xml</literal>文件中
+ 的<literal>connection factory</literal>下配置:</para>
<programlisting><connection-factory name="ConnectionFactory">
<connectors>
<connector-ref connector-name="netty-connector"/>
@@ -63,20 +55,18 @@
</entries>
<pre-acknowledge>true</pre-acknowledge>
</connection-factory></programlisting>
- <para>Alternatively, to use pre-acknowledgement mode using the JMS API, create a JMS Session
- with the <literal>HornetQSession.PRE_ACKNOWLEDGE</literal> constant.</para>
+ <para>另一个选择是使用JMS接口来设置pre-acknowledgement模式。只需要在创建JMS会话(session)
+ 时使用<literal>HornetQSession.PRE_ACKNOWLEDGE</literal>常数即可。</para>
<programlisting>
// messages will be acknowledge on the server *before* being delivered to the client
Session session = connection.createSession(false, HornetQSession.PRE_ACKNOWLEDGE);
</programlisting>
- <para>Or you can set pre-acknowledge directly on the <literal
- >HornetQConnectionFactory</literal> instance using the setter method.</para>
- <para>To use pre-acknowledgement mode using the core API you can set it directly on the
- <literal>ClientSessionFactory</literal> instance using the setter method.</para>
+ <para>你还可以直接在<literal>HornetQConnectionFactory</literal>实例上设置该模式。</para>
+ <para>另外,如果使用核心接口,则在<literal>ClientSessionFactory</literal>实例上直接
+ 设置该模式。</para>
</section>
<section>
- <title>Example</title>
- <para>See <xref linkend="examples.pre-acknowledge"/> for an example which shows how to use
- pre-acknowledgement mode with with JMS.</para>
+ <title>例子</title>
+ <para>参见<xref linkend="examples.pre-acknowledge"/>。这是一个使用JMS的例子。</para>
</section>
</chapter>
15 years, 8 months