JBoss hornetq SVN: r9038 - trunk/src/main/org/hornetq/ra/inflow.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2010-03-31 19:19:43 -0400 (Wed, 31 Mar 2010)
New Revision: 9038
Modified:
trunk/src/main/org/hornetq/ra/inflow/HornetQActivation.java
Log:
Removing .info
Modified: trunk/src/main/org/hornetq/ra/inflow/HornetQActivation.java
===================================================================
--- trunk/src/main/org/hornetq/ra/inflow/HornetQActivation.java 2010-03-31 17:57:19 UTC (rev 9037)
+++ trunk/src/main/org/hornetq/ra/inflow/HornetQActivation.java 2010-03-31 23:19:43 UTC (rev 9038)
@@ -279,7 +279,7 @@
*/
protected synchronized void setup() throws Exception
{
- HornetQActivation.log.info("Setting up " + spec);
+ HornetQActivation.log.debug("Setting up " + spec);
setupCF();
@@ -307,7 +307,7 @@
}
}
- HornetQActivation.log.info("Setup complete " + this);
+ HornetQActivation.log.debug("Setup complete " + this);
}
/**
@@ -315,7 +315,7 @@
*/
protected synchronized void teardown()
{
- HornetQActivation.log.info("Tearing down " + spec);
+ HornetQActivation.log.debug("Tearing down " + spec);
for (HornetQMessageHandler handler : handlers)
{
@@ -326,7 +326,7 @@
factory.close();
factory = null;
}
- HornetQActivation.log.info("Tearing down complete " + this);
+ HornetQActivation.log.debug("Tearing down complete " + this);
}
protected void setupCF() throws Exception
14 years, 11 months
JBoss hornetq SVN: r9037 - in trunk: src/main/org/hornetq/core/filter/impl and 5 other directories.
by do-not-reply@jboss.org
Author: timfox
Date: 2010-03-31 13:57:19 -0400 (Wed, 31 Mar 2010)
New Revision: 9037
Modified:
trunk/src/main/org/hornetq/api/core/FilterConstants.java
trunk/src/main/org/hornetq/api/core/Message.java
trunk/src/main/org/hornetq/core/filter/impl/FilterImpl.java
trunk/src/main/org/hornetq/core/filter/impl/FilterParser.jj
trunk/src/main/org/hornetq/core/filter/impl/SimpleStringReader.java
trunk/src/main/org/hornetq/core/message/impl/MessageImpl.java
trunk/src/main/org/hornetq/core/server/impl/QueueImpl.java
trunk/src/main/org/hornetq/jms/client/HornetQMessage.java
trunk/src/main/org/hornetq/jms/client/HornetQMessageProducer.java
trunk/src/main/org/hornetq/jms/management/impl/JMSQueueControlImpl.java
trunk/tests/src/org/hornetq/tests/unit/core/postoffice/impl/BindingsImplTest.java
Log:
JMS message id optimisation
Modified: trunk/src/main/org/hornetq/api/core/FilterConstants.java
===================================================================
--- trunk/src/main/org/hornetq/api/core/FilterConstants.java 2010-03-31 17:35:13 UTC (rev 9036)
+++ trunk/src/main/org/hornetq/api/core/FilterConstants.java 2010-03-31 17:57:19 UTC (rev 9037)
@@ -24,6 +24,11 @@
public class FilterConstants
{
/**
+ * Name of the HornetQ UserID header.
+ */
+ public static final SimpleString HORNETQ_USERID = new SimpleString("HQUserID");
+
+ /**
* Name of the HornetQ Message expiration header.
*/
public static final SimpleString HORNETQ_EXPIRATION = new SimpleString("HQExpiration");
Modified: trunk/src/main/org/hornetq/api/core/Message.java
===================================================================
--- trunk/src/main/org/hornetq/api/core/Message.java 2010-03-31 17:35:13 UTC (rev 9036)
+++ trunk/src/main/org/hornetq/api/core/Message.java 2010-03-31 17:57:19 UTC (rev 9037)
@@ -88,6 +88,19 @@
* The messageID is set when the message is handled by the server.
*/
long getMessageID();
+
+ /**
+ * Returns the userID - this is an optional user specified String that can be set to identify the message
+ * and will be passed around with the message
+ * @return
+ */
+ SimpleString getUserID();
+
+ /**
+ * Sets the user ID
+ * @param userID
+ */
+ void setUserID(SimpleString userID);
/**
* Returns the address this message is sent to.
@@ -303,7 +316,7 @@
* @param value property value
*/
void putStringProperty(String key, String value);
-
+
/**
* Puts an Object property in this message.
* <br>
Modified: trunk/src/main/org/hornetq/core/filter/impl/FilterImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/filter/impl/FilterImpl.java 2010-03-31 17:35:13 UTC (rev 9036)
+++ trunk/src/main/org/hornetq/core/filter/impl/FilterImpl.java 2010-03-31 17:57:19 UTC (rev 9037)
@@ -38,6 +38,7 @@
* HQDurable - "DURABLE" or "NON_DURABLE"
* HQExpiration - the expiration of the message
* HQSize - the encoded size of the full message in bytes
+* HQUserID - the user specified ID string (if any)
* Any other identifers that appear in a filter expression represent header values for the message
*
* String values must be set as <code>SimpleString</code>, not <code>java.lang.String</code> (see JBMESSAGING-1307).
@@ -105,16 +106,15 @@
try
{
+ result = parser.parse(sfilterString, identifiers);
- result = parser.parse(sfilterString, identifiers);
resultType = result.getClass();
-
}
catch (Throwable e)
{
FilterImpl.log.error("Invalid filter: " + str, e);
- throw new HornetQException(HornetQException.INVALID_FILTER_EXPRESSION, "Invalid filter: " + sfilterString);
+ throw new HornetQException(HornetQException.INVALID_FILTER_EXPRESSION, "Invalid filter: " + sfilterString + " " + e.getMessage());
}
}
@@ -151,12 +151,15 @@
}
if (resultType.equals(Identifier.class))
+ {
return (Boolean)((Identifier)result).getValue();
+ }
else if (resultType.equals(Operator.class))
{
- Operator op = (Operator) result;
+ Operator op = (Operator)result;
return (Boolean)op.apply();
- } else
+ }
+ else
{
throw new Exception("Bad object type: " + result);
}
@@ -182,8 +185,12 @@
private Object getHeaderFieldValue(final ServerMessage msg, final SimpleString fieldName)
{
- if (FilterConstants.HORNETQ_PRIORITY.equals(fieldName))
+ if (FilterConstants.HORNETQ_USERID.equals(fieldName))
{
+ return msg.getUserID();
+ }
+ else if (FilterConstants.HORNETQ_PRIORITY.equals(fieldName))
+ {
return new Integer(msg.getPriority());
}
else if (FilterConstants.HORNETQ_TIMESTAMP.equals(fieldName))
Modified: trunk/src/main/org/hornetq/core/filter/impl/FilterParser.jj
===================================================================
--- trunk/src/main/org/hornetq/core/filter/impl/FilterParser.jj 2010-03-31 17:35:13 UTC (rev 9036)
+++ trunk/src/main/org/hornetq/core/filter/impl/FilterParser.jj 2010-03-31 17:57:19 UTC (rev 9037)
@@ -22,6 +22,7 @@
options {
LOOKAHEAD=1;
+ UNICODE_INPUT=true;
/*
DEBUG_PARSER=true;
DEBUG_LOOKAHEAD=true;
Modified: trunk/src/main/org/hornetq/core/filter/impl/SimpleStringReader.java
===================================================================
--- trunk/src/main/org/hornetq/core/filter/impl/SimpleStringReader.java 2010-03-31 17:35:13 UTC (rev 9036)
+++ trunk/src/main/org/hornetq/core/filter/impl/SimpleStringReader.java 2010-03-31 17:57:19 UTC (rev 9037)
@@ -17,6 +17,7 @@
import java.io.Reader;
import org.hornetq.api.core.SimpleString;
+import org.hornetq.core.logging.Logger;
/**
@@ -32,6 +33,8 @@
{
// Constants -----------------------------------------------------
+
+ private static final Logger log = Logger.getLogger(SimpleStringReader.class);
// Attributes ----------------------------------------------------
Modified: trunk/src/main/org/hornetq/core/message/impl/MessageImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/message/impl/MessageImpl.java 2010-03-31 17:35:13 UTC (rev 9036)
+++ trunk/src/main/org/hornetq/core/message/impl/MessageImpl.java 2010-03-31 17:57:19 UTC (rev 9037)
@@ -85,6 +85,8 @@
private boolean copied = true;
private boolean bufferUsed;
+
+ private SimpleString userID;
// Constructors --------------------------------------------------
@@ -136,6 +138,7 @@
protected MessageImpl(final MessageImpl other)
{
messageID = other.getMessageID();
+ userID = other.getUserID();
address = other.getAddress();
type = other.getType();
durable = other.isDurable();
@@ -183,6 +186,7 @@
public int getHeadersAndPropertiesEncodeSize()
{
return DataConstants.SIZE_LONG + // Message ID
+ SimpleString.sizeofNullableString(userID) +
/* address */SimpleString.sizeofNullableString(address) +
DataConstants./* Type */SIZE_BYTE +
DataConstants./* Durable */SIZE_BOOLEAN +
@@ -197,6 +201,7 @@
{
buffer.writeLong(messageID);
buffer.writeNullableSimpleString(address);
+ buffer.writeNullableSimpleString(userID);
buffer.writeByte(type);
buffer.writeBoolean(durable);
buffer.writeLong(expiration);
@@ -209,6 +214,7 @@
{
messageID = buffer.readLong();
address = buffer.readNullableSimpleString();
+ userID = buffer.readNullableSimpleString();
type = buffer.readByte();
durable = buffer.readBoolean();
expiration = buffer.readLong();
@@ -238,6 +244,16 @@
{
return messageID;
}
+
+ public SimpleString getUserID()
+ {
+ return userID;
+ }
+
+ public void setUserID(final SimpleString userID)
+ {
+ this.userID = userID;
+ }
public SimpleString getAddress()
{
@@ -339,6 +355,7 @@
Map<String, Object> map = new HashMap<String, Object>();
map.put("messageID", messageID);
+ map.put("userID", userID);
map.put("address", address.toString());
map.put("type", type);
map.put("durable", durable);
@@ -516,7 +533,7 @@
bufferValid = false;
}
-
+
public void putObjectProperty(final SimpleString key, final Object value) throws PropertyConversionException
{
if (value == null)
@@ -759,7 +776,7 @@
{
return properties.getSimpleStringProperty(new SimpleString(key));
}
-
+
public Object getObjectProperty(final String key)
{
return properties.getProperty(new SimpleString(key));
Modified: trunk/src/main/org/hornetq/core/server/impl/QueueImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/server/impl/QueueImpl.java 2010-03-31 17:35:13 UTC (rev 9036)
+++ trunk/src/main/org/hornetq/core/server/impl/QueueImpl.java 2010-03-31 17:57:19 UTC (rev 9037)
@@ -1119,7 +1119,7 @@
{
ref = holder.iter.next();
}
-
+
if (ref == null)
{
nullRefCount++;
@@ -1168,6 +1168,7 @@
}
else if (status == HandleStatus.BUSY)
{
+ log.info("busy");
if (holder.iter == null)
{
// Put the ref back
Modified: trunk/src/main/org/hornetq/jms/client/HornetQMessage.java
===================================================================
--- trunk/src/main/org/hornetq/jms/client/HornetQMessage.java 2010-03-31 17:35:13 UTC (rev 9036)
+++ trunk/src/main/org/hornetq/jms/client/HornetQMessage.java 2010-03-31 17:57:19 UTC (rev 9037)
@@ -42,7 +42,6 @@
import org.hornetq.api.jms.HornetQJMSConstants;
import org.hornetq.core.client.impl.ClientMessageImpl;
import org.hornetq.core.logging.Logger;
-import org.hornetq.utils.UUID;
/**
* HornetQ implementation of a JMS Message.
@@ -70,10 +69,6 @@
private static final SimpleString CORRELATIONID_HEADER_NAME = new SimpleString("JMSCorrelationID");
- //public static final SimpleString HORNETQ_MESSAGE_ID = new SimpleString("_HQI");
-
- public static final SimpleString JMSMESSAGEID_HEADER_NAME = new SimpleString("JMSMessageID");
-
private static final SimpleString TYPE_HEADER_NAME = new SimpleString("JMSType");
private static final SimpleString JMS = new SimpleString("JMS");
@@ -112,6 +107,10 @@
{
// Ignore
}
+ else if (entry.getKey().equals("userID"))
+ {
+ jmsMessage.put("JMSMessageID", entry.getValue().toString());
+ }
else
{
Object value = entry.getValue();
@@ -307,45 +306,17 @@
// javax.jmx.Message implementation ------------------------------
-// public String getJMSMessageID()
-// {
-// if (msgID == null)
-// {
-// byte[] bytes = message.getBytesProperty(HornetQMessage.HORNETQ_MESSAGE_ID);
-//
-// msgID = bytes == null ? null : "ID:" + new UUID(UUID.TYPE_TIME_BASED, bytes).toString();
-// }
-// return msgID;
-// }
-
public String getJMSMessageID()
{
if (msgID == null)
{
- msgID = message.getStringProperty(HornetQMessage.JMSMESSAGEID_HEADER_NAME);
+ SimpleString uid = message.getUserID();
+
+ msgID = uid == null ? null : uid.toString();
}
return msgID;
}
-// public void setJMSMessageID(final String jmsMessageID) throws JMSException
-// {
-// if (jmsMessageID != null && !jmsMessageID.startsWith("ID:"))
-// {
-// throw new JMSException("JMSMessageID must start with ID:");
-// }
-//
-// if (jmsMessageID == null)
-// {
-// message.removeProperty(HornetQMessage.HORNETQ_MESSAGE_ID);
-// }
-// else
-// {
-// message.putStringProperty(HornetQMessage.HORNETQ_MESSAGE_ID, new SimpleString(jmsMessageID));
-// }
-//
-// msgID = jmsMessageID;
-// }
-
public void setJMSMessageID(final String jmsMessageID) throws JMSException
{
if (jmsMessageID != null && !jmsMessageID.startsWith("ID:"))
@@ -353,18 +324,11 @@
throw new JMSException("JMSMessageID must start with ID:");
}
- if (jmsMessageID == null)
- {
- message.removeProperty(HornetQMessage.JMSMESSAGEID_HEADER_NAME);
- }
- else
- {
- message.putStringProperty(HornetQMessage.JMSMESSAGEID_HEADER_NAME, new SimpleString(jmsMessageID));
- }
+ message.setUserID(null);
msgID = jmsMessageID;
}
-
+
public long getJMSTimestamp() throws JMSException
{
return message.getTimestamp();
Modified: trunk/src/main/org/hornetq/jms/client/HornetQMessageProducer.java
===================================================================
--- trunk/src/main/org/hornetq/jms/client/HornetQMessageProducer.java 2010-03-31 17:35:13 UTC (rev 9036)
+++ trunk/src/main/org/hornetq/jms/client/HornetQMessageProducer.java 2010-03-31 17:57:19 UTC (rev 9037)
@@ -82,9 +82,9 @@
// Constructors --------------------------------------------------
protected HornetQMessageProducer(final HornetQConnection jbossConn,
- final ClientProducer producer,
- final HornetQDestination defaultDestination,
- final ClientSession clientSession) throws JMSException
+ final ClientProducer producer,
+ final HornetQDestination defaultDestination,
+ final ClientSession clientSession) throws JMSException
{
this.jbossConn = jbossConn;
@@ -350,8 +350,8 @@
if (!destination.equals(defaultDestination))
{
throw new UnsupportedOperationException("Where a default destination is specified " + "for the sender and a destination is "
- + "specified in the arguments to the send, "
- + "these destinations must be equal");
+ + "specified in the arguments to the send, "
+ + "these destinations must be equal");
}
}
@@ -409,40 +409,22 @@
UUID uid = UUIDGenerator.getInstance().generateUUID();
- msg.getCoreMessage().putStringProperty(HornetQMessage.JMSMESSAGEID_HEADER_NAME, new SimpleString("ID:" + uid.toString()));
+ byte[] bytes = uid.asBytes();
- msg.resetMessageID(null);
+ byte[] id = new byte[6 + 16];
+
+ id[0] = (byte)'I';
+ id[2] = (byte)'D';
+ id[4] = (byte)':';
+
+ System.arraycopy(bytes, 0, id, 6, 16);
+
+ SimpleString ssid = new SimpleString(id);
+
+ msg.getCoreMessage().setUserID(ssid);
+
+ msg.resetMessageID(null);
}
-
-// if (!disableMessageID)
-// {
-// // Generate an id
-//
-// UUID uid = UUIDGenerator.getInstance().generateUUID();
-//
-// byte[] bytes = uid.asBytes();
-//
-// long id1 = bytes[0] << 56 | bytes[1] << 48 |
-// bytes[2] << 40 |
-// bytes[3] << 32 |
-// bytes[4] << 24 |
-// bytes[5] << 16 |
-// bytes[6] << 8 |
-// bytes[7];
-//
-// long id2 = bytes[8] << 56 | bytes[9] << 48 |
-// bytes[10] << 40 |
-// bytes[11] << 32 |
-// bytes[12] << 24 |
-// bytes[13] << 16 |
-// bytes[14] << 8 |
-// bytes[15];
-//
-// //We store it as two longs in the message, as it's a more compact format
-// msg.getCoreMessage().setClientMessageID(id1, id2);
-//
-// msg.resetMessageID(null);
-// }
if (foreign)
{
Modified: trunk/src/main/org/hornetq/jms/management/impl/JMSQueueControlImpl.java
===================================================================
--- trunk/src/main/org/hornetq/jms/management/impl/JMSQueueControlImpl.java 2010-03-31 17:35:13 UTC (rev 9036)
+++ trunk/src/main/org/hornetq/jms/management/impl/JMSQueueControlImpl.java 2010-03-31 17:57:19 UTC (rev 9037)
@@ -13,16 +13,15 @@
package org.hornetq.jms.management.impl;
-import java.util.List;
import java.util.Map;
import javax.management.MBeanInfo;
import javax.management.StandardMBean;
+import org.hornetq.api.core.FilterConstants;
import org.hornetq.api.core.HornetQException;
import org.hornetq.api.core.management.MessageCounterInfo;
import org.hornetq.api.core.management.QueueControl;
-import org.hornetq.api.jms.HornetQJMSClient;
import org.hornetq.api.jms.management.JMSQueueControl;
import org.hornetq.core.logging.Logger;
import org.hornetq.core.management.impl.MBeanInfoHelper;
@@ -70,7 +69,7 @@
private static String createFilterForJMSMessageID(final String jmsMessageID) throws Exception
{
- return HornetQMessage.JMSMESSAGEID_HEADER_NAME + " = '" + jmsMessageID + "'";
+ return FilterConstants.HORNETQ_USERID + " = '" + jmsMessageID + "'";
}
static String toJSON(final Map<String, Object>[] messages)
Modified: trunk/tests/src/org/hornetq/tests/unit/core/postoffice/impl/BindingsImplTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/unit/core/postoffice/impl/BindingsImplTest.java 2010-03-31 17:35:13 UTC (rev 9036)
+++ trunk/tests/src/org/hornetq/tests/unit/core/postoffice/impl/BindingsImplTest.java 2010-03-31 17:57:19 UTC (rev 9037)
@@ -886,6 +886,18 @@
}
+ public SimpleString getUserID()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public void setUserID(SimpleString userID)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
}
class FakeFilter implements Filter
14 years, 11 months
JBoss hornetq SVN: r9036 - trunk/src/main/org/hornetq/jms/server/impl.
by do-not-reply@jboss.org
Author: jmesnil
Date: 2010-03-31 13:35:13 -0400 (Wed, 31 Mar 2010)
New Revision: 9036
Modified:
trunk/src/main/org/hornetq/jms/server/impl/JMSServerManagerImpl.java
Log:
fix Queue deployment
* in JMSServerManagerImpl, call directly HornetQServer to deploy/destroy queues instead of going through the
management interface
Modified: trunk/src/main/org/hornetq/jms/server/impl/JMSServerManagerImpl.java
===================================================================
--- trunk/src/main/org/hornetq/jms/server/impl/JMSServerManagerImpl.java 2010-03-31 16:48:00 UTC (rev 9035)
+++ trunk/src/main/org/hornetq/jms/server/impl/JMSServerManagerImpl.java 2010-03-31 17:35:13 UTC (rev 9036)
@@ -624,7 +624,7 @@
jmsManagementService.unregisterQueue(name);
- server.getHornetQServerControl().destroyQueue(HornetQDestination.createQueueAddressFromName(name).toString());
+ server.destroyQueue(HornetQDestination.createQueueAddressFromName(name), null);
storage.deleteDestination(PersistedType.Queue, name);
@@ -1111,10 +1111,11 @@
// checks when routing messages to a topic that
// does not exist - otherwise we would not be able to distinguish from a non existent topic and one with no
// subscriptions - core has no notion of a topic
- server.getHornetQServerControl().deployQueue(hqTopic.getAddress(),
- hqTopic.getAddress(),
- JMSServerManagerImpl.REJECT_FILTER,
- true);
+ server.deployQueue(SimpleString.toSimpleString(hqTopic.getAddress()),
+ SimpleString.toSimpleString(hqTopic.getAddress()),
+ SimpleString.toSimpleString(JMSServerManagerImpl.REJECT_FILTER),
+ true,
+ false);
topics.put(topicName, hqTopic);
14 years, 11 months
JBoss hornetq SVN: r9035 - trunk/src/main/org/hornetq/core/client/impl.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2010-03-31 12:48:00 -0400 (Wed, 31 Mar 2010)
New Revision: 9035
Modified:
trunk/src/main/org/hornetq/core/client/impl/ClientSessionImpl.java
Log:
Fixing LargeMessage failover.
(the same way receiving a message doesn't represent workDone, receiving a largeMessage shouldn't represent workdone)
Modified: trunk/src/main/org/hornetq/core/client/impl/ClientSessionImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/client/impl/ClientSessionImpl.java 2010-03-31 16:47:34 UTC (rev 9034)
+++ trunk/src/main/org/hornetq/core/client/impl/ClientSessionImpl.java 2010-03-31 16:48:00 UTC (rev 9035)
@@ -767,8 +767,6 @@
if (consumer != null)
{
- workDone();
-
consumer.handleLargeMessage(message);
}
}
@@ -779,8 +777,6 @@
if (consumer != null)
{
- workDone();
-
consumer.handleLargeMessageContinuation(continuation);
}
}
14 years, 11 months
JBoss hornetq SVN: r9034 - branches/HnetQ_323_cn/docs/user-manual/zh.
by do-not-reply@jboss.org
Author: gaohoward
Date: 2010-03-31 12:47:34 -0400 (Wed, 31 Mar 2010)
New Revision: 9034
Modified:
branches/HnetQ_323_cn/docs/user-manual/zh/persistence.xml
Log:
another chapter
Modified: branches/HnetQ_323_cn/docs/user-manual/zh/persistence.xml
===================================================================
--- branches/HnetQ_323_cn/docs/user-manual/zh/persistence.xml 2010-03-31 16:04:11 UTC (rev 9033)
+++ branches/HnetQ_323_cn/docs/user-manual/zh/persistence.xml 2010-03-31 16:47:34 UTC (rev 9034)
@@ -17,273 +17,195 @@
<!-- permitted by applicable law. -->
<!-- ============================================================================= -->
<chapter id="persistence">
- <title>Persistence</title>
- <para>In this chapter we will describe how persistence works with HornetQ and how to configure
- it.</para>
- <para>HornetQ ships with a high performance journal. Since HornetQ handles its own persistence,
- rather than relying on a database or other 3rd party persistence engine it is very highly
- optimised for the specific messaging use cases.</para>
- <para>A HornetQ journal is an <emphasis>append only</emphasis> journal. It consists of a set of
- files on disk. Each file is pre-created to a fixed size and initially filled with padding.
- As operations are performed on the server, e.g. add message, update message, delete message,
- records are appended to the journal. When one journal file is full we move to the next
- one.</para>
- <para>Because records are only appended, i.e. added to the end of the journal we minimise disk
- head movement, i.e. we minimise random access operations which is typically the slowest
- operation on a disk.</para>
- <para>Making the file size configurable means that an optimal size can be chosen, i.e. making
- each file fit on a disk cylinder. Modern disk topologies are complex and we are not in
- control over which cylinder(s) the file is mapped onto so this is not an exact science. But
- by minimising the number of disk cylinders the file is using, we can minimise the amount of
- disk head movement, since an entire disk cylinder is accessible simply by the disk rotating
- - the head does not have to move.</para>
- <para>As delete records are added to the journal, HornetQ has a sophisticated file garbage
- collection algorithm which can determine if a particular journal file is needed any more -
- i.e. has all it's data been deleted in the same or other files. If so, the file can be
- reclaimed and re-used. </para>
- <para>HornetQ also has a compaction algorithm which removes dead space from the journal and
- compresses up the data so it takes up less files on disk.</para>
- <para>The journal also fully supports transactional operation if required, supporting both local
- and XA transactions.</para>
- <para>The majority of the journal is written in Java, however we abstract out the interaction
- with the actual file system to allow different pluggable implementations. HornetQ ships with
- two implementations:</para>
+ <title>持久化</title>
+ <para>本章我们将描述HornetQ的持久化技术,包括持久化的工作原理和配置方法。</para>
+ <para>HornetQ拥有一个高性能的日志(journal)模块来处理持久化。因此它并不依赖一个外部的数据库或第三方持久化产品。这个
+ 日志模块针对消息的处理进行了高度的优化。</para>
+ <para>所谓HornetQ日志是一个<emphasis>只添加</emphasis>系统。它由一组磁盘文件构成。每个文件都是预先创建好的并且
+ 大小是固定的。文件在创建时都进行了格式化。随着HornetQ不断地处理消息,如消息的增加、更新、删除等,一个个记录被添加
+ 到日志中。当一个日志文件写满时,新记录就会写到下一个文件。</para>
+ <para>由于对日志的写入只是对文件的添加,这样有效减少了随机寻道的操作。而随机寻道的操作是磁盘操作中最耗时的操作。
+ 所以这种设计可以使磁头的运动降到最低,效率最高。</para>
+ <para>而文件的大小是可以配置的。这使我们可以将文件大小配置为刚好占满一个磁盘柱面。不过现代的磁盘技术是复杂多样的,
+ 我们并不能控制文件与磁盘柱面的对应关系。尽管如此,我们通过最大限度地降低文件对磁盘柱面的占用,来降低磁头的运动。
+ 这是因为在同一个柱面的存取只需要盘面的转动而不需要磁头的运动。</para>
+ <para>当被删除的记录越来越多时,有的文件最終会变成一个没有有效记录的文件。这样的文件就可以回收再利用。HornetQ有
+ 一套复杂的文件回收算法来判断一个日志文件是否可以被回收。</para>
+ <para>HornetQ还有一套文件整理的算法,它用来将日志文件中不用的空隙移除以达到更高的存贮效率。</para>
+ <para>这个日志系统全面支持事务功能。根据需要它可以支持本地事务或XA型事务。</para>
+ <para>日志系统的大部分是用Java实现的,但是HornetQ在其中实现了一层抽象的文件系统,这样就使得其它的语言实现能
+ 方便地“插入”到日志模块中。实际上HornetQ自带有两种实现:</para>
<itemizedlist>
<listitem>
- <para>Java <ulink url="http://en.wikipedia.org/wiki/New_I/O">NIO</ulink>.</para>
- <para>The first implementation uses standard Java NIO to interface with the file system.
- This provides extremely good performance and runs on any platform where there's a
- Java 5+ runtime.</para>
+ <para>Java <ulink url="http://en.wikipedia.org/wiki/New_I/O">NIO</ulink>。</para>
+ <para>第一种采用的是标准的Java NIO接口来进行文件的操作。它可以在任何安装有Java 1.5或以上的系统中运行。
+ NIO的性能是很高的。</para>
</listitem>
<listitem id="aio-journal">
- <para>Linux Asynchronous IO</para>
- <para>The second implementation uses a thin native code wrapper to talk to the Linux
- asynchronous IO library (AIO). With AIO, HornetQ will be called back when the data
- has made it to disk, allowing us to avoid explicit syncs altogether and simply send
- back confirmation of completion when AIO informs us that the data has been
- persisted.</para>
- <para>Using AIO will typically provide even better performance than using Java
- NIO.</para>
- <para>The AIO journal is only available when running Linux kernel 2.6 or later and after
- having installed libaio (if it's not already installed). For instructions on how to
- install libaio please see <xref linkend="installing-aio"/>.</para>
- <para>For more information on libaio please see <xref linkend="libaio"/>.</para>
- <para>libaio is part of the kernel project.</para>
+ <para>Linux 异步IO (Asynchronous IO)</para>
+ <para>第二种是采用的Linux系统中的异步IO技术(AIO)。它包括了少量的平台相关的代码(native code)来
+ 调用AIO的接口。当数据被保存到磁盘上后,AIO会回调HornetQ进行通知。这样,HornetQ就避免了磁盘写
+ 的同步操作。</para>
+ <para>使用AIO通常可以有比NIO更高的性能。</para>
+ <para>采用AIO的日志只能在运行 Linux kernel 2.6 或以上版本的内核的系统中才有。另外你需要安装libaio。
+ 有关如何安装libaio请参见 <xref linkend="installing-aio"/>。</para>
+ <para>有关libaio的更多介绍参见 <xref linkend="libaio"/>。</para>
+ <para>libaio是Linux内核项目的一部分。</para>
</listitem>
</itemizedlist>
- <para>The standard HornetQ core server uses two instances of the journal:</para>
+ <para>标准的HornetQ核心服务器使用了两种日志:</para>
<itemizedlist>
<listitem>
- <para>Bindings journal.</para>
- <para>This journal is used to store bindings related data. That includes the set of
- queues that are deployed on the server and their attributes. It also stores data
- such as id sequence counters. </para>
- <para>The bindings journal is always a NIO journal as it is typically low throughput
- compared to the message journal.</para>
+ <para>绑定日志</para>
+ <para>这个日志用来保存与绑定有关的数据。其中包括在HornetQ上部署的队列及其属性,还有ID序列计数器。 </para>
+ <para>绑定日志是一个NIO型日志。与消息日志相比它的呑吐量是比较低的。</para>
</listitem>
<listitem>
- <para>Message journal.</para>
- <para>This journal instance stores all message related data, including the message
- themselves and also duplicate-id caches.</para>
- <para>By default HornetQ will try and use an AIO journal. If AIO is not available, e.g.
- the platform is not Linux with the correct kernel version or AIO has not been
- installed then it will automatically fall back to using Java NIO which is available
- on any Java platform.</para>
+ <para>消息日志</para>
+ <para>这个日志用来存贮所有消息相关的数据,包括消息本身和重复ID缓存。</para>
+ <para>默认情况下HornetQ总是优先使用AIO型日志。如果AIO型日志不可用(比如在非Linux平台上运行,或系统内核版本不同)
+ 它将自动使用NIO型日志。</para>
</listitem>
</itemizedlist>
- <para>For large messages, HornetQ persists them outside the message journal. This is discussed
- in <xref linkend="large-messages"/>.</para>
- <para>HornetQ can also be configured to page messages to disk in low memory situations. This is
- discussed in <xref linkend="paging"/>.</para>
- <para>If no persistence is required at all, HornetQ can also be configured not to persist any
- data at all to storage as discussed in <xref linkend="persistence.enabled"/>.</para>
+ <para>对于超大消息,Hornet将它们保存在消息日志之外的地方。详见<xref linkend="large-messages"/>.</para>
+ <para>HornetQ还可以在内存不够用时将消息暂存到磁盘上。相关的配置和说明参见<xref linkend="paging"/>。</para>
+ <para>如果不需要持久功能,HornetQ还可以配置成非持久的消息系统。参见<xref linkend="persistence.enabled"/>。</para>
<section id="configuring.bindings.journal">
- <title>Configuring the bindings journal</title>
- <para>The bindings journal is configured using the following attributes in <literal
- >hornetq-configuration.xml</literal></para>
+ <title>配置绑定日志</title>
+ <para>绑定日志的配置参数在 <literal
+ >hornetq-configuration.xml</literal>文件中。</para>
<itemizedlist>
<listitem>
<para><literal>bindings-directory</literal></para>
- <para>This is the directory in which the bindings journal lives. The default value
- is <literal>data/bindings</literal>.</para>
+ <para>这是绑定日志的位置。默认值是<literal>data/bindings</literal>。</para>
</listitem>
<listitem>
<para><literal>create-bindings-dir</literal></para>
- <para>If this is set to <literal>true</literal> then the bindings directory will be
- automatically created at the location specified in <literal
- >bindings-directory</literal> if it does not already exist. The default
- value is <literal>true</literal></para>
+ <para>如果设置为<literal>true</literal>,那么在 <literal
+ >bindings-directory</literal> 所设定的位置不存在的情况下会自动创建它。默认值是<literal>true</literal>。</para>
</listitem>
</itemizedlist>
</section>
<section id="configuring.message.journal">
- <title>Configuring the message journal</title>
- <para>The message journal is configured using the following attributes in <literal
- >hornetq-configuration.xml</literal></para>
+ <title>配置消息日志</title>
+ <para>消息日志的配置在<literal
+ >hornetq-configuration.xml文件中。</literal></para>
<itemizedlist>
<listitem id="configuring.message.journal.journal-directory">
<para><literal>journal-directory</literal></para>
- <para>This is the directory in which the message journal lives. The default value is
- <literal>data/journal</literal>.</para>
- <para>For the best performance, we recommend the journal is located on its own
- physical volume in order to minimise disk head movement. If the journal is on a
- volume which is shared with other processes which might be writing other files
- (e.g. bindings journal, database, or transaction coordinator) then the disk head
- may well be moving rapidly between these files as it writes them, thus
- drastically reducing performance.</para>
- <para>When the message journal is stored on a SAN we recommend each journal instance
- that is stored on the SAN is given its own LUN (logical unit).</para>
+ <para>这是消息日志文件所在的目录。默认值是
+ <literal>data/journal</literal>。</para>
+ <para>为以达到最佳性能,我们建议将日志设定到属于它自己的物理卷中以减少磁头运动。如果日志的位置与
+ 其它进程共用(如数据库,绑定日志或事务的日志等)则磁头的运动显然要增加很多。性能也就没有保证了。</para>
+ <para>如果消息日志是贮存在SAN中,我们建议每个日志都拥有自己的LUN(逻辑单元)。</para>
</listitem>
<listitem id="configuring.message.journal.create-journal-dir">
<para><literal>create-journal-dir</literal></para>
- <para>If this is set to <literal>true</literal> then the journal directory will be
- automatically created at the location specified in <literal
- >journal-directory</literal> if it does not already exist. The default value
- is <literal>true</literal></para>
+ <para>如果设为<literal>true</literal>,则当<literal
+ >journal-directory</literal>所指定的日志目录不存在时,会自动创建它。默认值是<literal>true</literal>。</para>
</listitem>
<listitem id="configuring.message.journal.journal-type">
<para><literal>journal-type</literal></para>
- <para>Valid values are <literal>NIO</literal> or <literal>ASYNCIO</literal>.</para>
+ <para>有效值是<literal>NIO</literal> 或者 <literal>ASYNCIO</literal>。</para>
<para>Choosing <literal>NIO</literal> chooses the Java NIO journal. Choosing
- <literal>AIO</literal> chooses the Linux asynchronous IO journal. If you
- choose <literal>AIO</literal> but are not running Linux or you do not have
- libaio installed then HornetQ will detect this and automatically fall back to
- using <literal>NIO</literal>.</para>
+ <literal>AIO</literal> 选择作用异步IO型日志。如果你的平台不是Linux或者你没有安装
+ libaio,HornetQ会自动检测到并使用<literal>NIO</literal>。</para>
</listitem>
<listitem id="configuring.message.journal.journal-sync-transactional">
<para><literal>journal-sync-transactional</literal></para>
- <para>If this is set to true then HornetQ will make sure all transaction data is
- flushed to disk on transaction boundaries (commit, prepare and rollback). The
- default value is <literal>true</literal>.</para>
+ <para>如果设为true,HornetQ会保证在事务的边界操作时(commit, prepare和rollback)将事务数据
+ 写到磁盘上。默认的值是 <literal>true</literal>。</para>
</listitem>
<listitem id="configuring.message.journal.journal-sync-non-transactional">
<para><literal>journal-sync-non-transactional</literal></para>
- <para>If this is set to true then HornetQ will make sure non transactional message
- data (sends and acknowledgements) are flushed to disk each time. The default
- value for this is <literal>true</literal>.</para>
+ <para>如果设为true HornetQ将保证每次都将非事务性消息数据(发送和通知)保存到磁盘上。默认值是 <literal>true</literal>。</para>
</listitem>
<listitem id="configuring.message.journal.journal-file-size">
<para><literal>journal-file-size</literal></para>
- <para>The size of each journal file in bytes. The default value for this is <literal
- >10485760</literal> bytes (10MiB).</para>
+ <para>每个日志文件的大于。单位为字节。默认值是 <literal
+ >10485760</literal> bytes (10MiB)。</para>
</listitem>
<listitem id="configuring.message.journal.journal-min-files">
<para><literal>journal-min-files</literal></para>
- <para>The minimum number of files the journal will maintain. When HornetQ starts and
- there is no initial message data, HornetQ will pre-create <literal
- >journal-min-files</literal> number of files.</para>
- <para>Creating journal files and filling them with padding is a fairly expensive
- operation and we want to minimise doing this at run-time as files get filled. By
- precreating files, as one is filled the journal can immediately resume with the
- next one without pausing to create it.</para>
- <para>Depending on how much data you expect your queues to contain at steady state
- you should tune this number of files to match that total amount of data.</para>
+ <para>最少日志文件数。当HornetQ启动时会创建这一数量的文件。</para>
+ <para>创建并初始化日志文件是一项费时的操作,通常不希望这些操作在服务运行时执行。预先创建并初始化这些
+ 日志文件将会使HornetQ在工作时避免浪费不必要的时间。</para>
+ <para>根据你的应用中队列中消息量的实际要求可以适当调节这一参数。</para>
</listitem>
<listitem id="configuring.message.journal.journal-max-io">
<para><literal>journal-max-io</literal></para>
- <para>Write requests are queued up before being submitted to the system for
- execution. This parameter controls the maximum number of write requests that can
- be in the IO queue at any one time. If the queue becomes full then writes will
- block until space is freed up. </para>
- <para>When using NIO, this value should always be equal to <literal
- >1</literal></para>
- <para>When using AIO, the default should be <literal>500</literal>.</para>
- <para>The system maintains different defaults for this parameter depening on whether
- it's NIO or AIO (default for NIO is 1, default for AIO is 500)</para>
- <para>There is a limit and the total max AIO can't be higher than what is configured
- at the OS level (/proc/sys/fs/aio-max-nr) usually at 65536.</para>
+ <para>写请求被放到一个队列中,然后再被发送到系统中执行。这个参数限制了在任一时间队列中可以存放的最大数量
+ 的写请求。如果队列达到这个限制,任何新的写请求都将被阻塞,直到队列中有空位为止。</para>
+ <para>当使用NIO时,这个参数必须为 <literal
+ >1</literal>。</para>
+ <para>当使用AIO时,它的默认值是<literal>500</literal>。</para>
+ <para>系统根据不同类型的日志提供不同的默认值。(NIO 为 1, AIO 为 500)。</para>
+ <para>如果是AIO,这个参数的上限不能超过操作系统的限制(/proc/sys/fs/aio-max-nr),这个值通常为65536.</para>
</listitem>
<listitem id="configuring.message.journal.journal-buffer-timeout">
<para><literal>journal-buffer-timeout</literal></para>
- <para>Instead of flushing on every write that requires a flush, we maintain an
- internal buffer, and flush the entire buffer either when it is full, or when a
- timeout expires, whichever is sooner. This is used for both NIO and AIO and
- allows the system to scale better with many concurrent writes that require
- flushing.</para>
- <para>This parameter controls the timeout at which the buffer will be flushed if it
- hasn't filled already. AIO can typically cope with a higher flush rate than NIO,
- so the system maintains different defaults for both NIO and AIO (default for NIO
- is 3333333 nanoseconds - 300 times per second, default for AIO is 500000
- nanoseconds - ie. 2000 times per second).</para>
+ <para>日志模块中有一个内部缓冲。每次写的内容并不是都立即写到磁盘上,而是先放到这个内部缓存中。当这个缓存已满时,或
+ 者超过了一定的时间(timeout),才将缓存的数据存到硬盘上。NIO和AIO都有这一特点。采用缓存的方式可以很好地满足
+ 大量并发写数据的需要。</para>
+ <para>这一参数规定了缓存的失效时间,如果过了这个时间,即使缓存还没有满,也将数据写入磁盘中。AIO的写入
+ 能力通常要比NIO强。因此系统对于不同类型的日志有着不同的默认值。( NIO的默认值是 3333333 纳秒,即每秒300次。
+ 而AIO则是500000纳秒,即每秒2000次。)</para>
<note>
- <para>By increasing the timeout, you may be able to increase system throughput
- at the expense of latency, the default parameters are chosen to give a
- reasonable balance between throughput and latency.</para>
+ <para>加在这个参数有可能会增加系统的呑吐量,但可能会降低系统的响应能力。通常情况下默认值应该是比较理想的折中选择。</para>
</note>
</listitem>
<listitem id="configuring.message.journal.journal-buffer-size">
<para><literal>journal-buffer-size</literal></para>
- <para>The size of the timed buffer on AIO. The default value is <literal
- >490KiB</literal>.</para>
+ <para>AIO的定时缓冲的大小,默认值为<literal
+ >490KiB</literal>。</para>
</listitem>
<listitem id="configuring.message.journal.journal-compact-min-files">
<para><literal>journal-compact-min-files</literal></para>
- <para>The minimal number of files before we can consider compacting the journal. The
- compacting algorithm won't start until you have at least <literal
- >journal-compact-min-files</literal></para>
- <para>The default for this parameter is <literal>10</literal></para>
+ <para>进行整理压缩日志操作的最少文件数。当日志文件少于这个数时,系统不会进行文件的整理压缩。</para>
+ <para>默认值是 <literal>10</literal>。</para>
</listitem>
<listitem id="configuring.message.journal.journal-compact-percentage">
<para><literal>journal-compact-percentage</literal></para>
- <para>The threshold to start compacting. When less than this percentage is
- considered live data, we start compacting. Note also that compacting won't kick
- in until you have at least <literal>journal-compact-min-files</literal> data
- files on the journal</para>
- <para>The default for this parameter is <literal>30</literal></para>
+ <para>开始整理压缩的界限值。当有效数据的比例少于这个值时系统开始整理压缩日志。注意是否进行压缩还要
+ 受到、<literal>journal-compact-min-files</literal>参数的控制。</para>
+ <para>这一参数的默认值是 <literal>30</literal>。</para>
</listitem>
</itemizedlist>
</section>
<section id="disk-write-cache">
- <title>An important note on disabling disk write cache.</title>
+ <title>关于关闭磁盘写缓冲的重要说明</title>
<warning>
- <para>Most disks contain hardware write caches. A write cache can increase the apparent
- performance of the disk because writes just go into the cache and are then lazily
- written to the disk later. </para>
- <para>This happens irrespective of whether you have executed a fsync() from the
- operating system or correctly synced data from inside a Java program!</para>
- <para>By default many systems ship with disk write cache enabled. This means that even
- after syncing from the operating system there is no guarantee the data has actually
- made it to disk, so if a failure occurs, critical data can be lost.</para>
- <para>Some more expensive disks have non volatile or battery backed write caches which
- won't necessarily lose data on event of failure, but you need to test them!</para>
- <para>If your disk does not have an expensive non volatile or battery backed cache and
- it's not part of some kind of redundant array (e.g. RAID), and you value your data
- integrity you need to make sure disk write cache is disabled.</para>
- <para>Be aware that disabling disk write cache can give you a nasty shock performance
- wise. If you've been used to using disks with write cache enabled in their default
- setting, unaware that your data integrity could be compromised, then disabling it
- will give you an idea of how fast your disk can perform when acting really
- reliably.</para>
- <para>On Linux you can inspect and/or change your disk's write cache settings using the
- tools <literal>hdparm</literal> (for IDE disks) or <literal>sdparm</literal> or
- <literal>sginfo</literal> (for SDSI/SATA disks)</para>
- <para>On Windows you can check / change the setting by right clicking on the disk and
- clicking properties.</para>
+ <para>大多数磁盘产品都有硬件的写缓冲。写缓冲可以明显提高写的效率。</para>
+ <para>这样的写缓冲与调用fsync()这样的系统函数无关,也与在Java程序中进行的同步调用无关!</para>
+ <para>默认情况下许多磁盘的写缓冲是打开的。这样的情况下,即使你在程序中调用了同步操作也不能保证你的数据
+ 就真正写到磁盘介质中了。因此如果故障发生时,关键的数据是有可能丢失的。</para>
+ <para>有些昂贵的磁盘采用非挥发性的介质或有电源的缓冲来保证故障情况下不丢失数据。但是你仍需要对这些硬盘进行测试!</para>
+ <para>如果你的磁盘没有非挥发性或有电源的缓存,也不是某种冗余盘阵(如RAID)。要想保证关键数据不丢失,你需要
+ 关闭磁盘的写缓冲。</para>
+ <para>需要知道的是关闭磁盘的写缓冲会显著降低磁盘的性能。如果平时你在使用磁盘时都打开写缓冲,那么当你为了
+ 保护你的数据而关闭它时,你可能感到两种情况下的明显差异。</para>
+ <para>Linux可以用<literal>hdparm</literal> (IDE硬盘) 或 <literal>sdparm</literal> 或
+ <literal>sginfo</literal> (SDSI/SATA 硬盘)工具来查看并修改磁盘的写缓冲。</para>
+ <para>在Windows平台上你可以右键点击硬盘图标,并选择“属性”菜单项来操作。</para>
</warning>
</section>
<section id="installing-aio">
- <title>Installing AIO</title>
- <para>The Java NIO journal gives great performance, but If you are running HornetQ using
- Linux Kernel 2.6 or later, we highly recommend you use the <literal>AIO</literal>
- journal for the very best persistence performance.</para>
- <para>It's not possible to use the AIO journal under other operating systems or earlier
- versions of the Linux kernel.</para>
- <para>If you are running Linux kernel 2.6 or later and don't already have <literal
- >libaio</literal> installed, you can easily install it using the following
- steps:</para>
- <para>Using yum, (e.g. on Fedora or Red Hat Enterprise Linux):
+ <title>安装AIO</title>
+ <para>Java NIO日志的性能是很好的。但是如果你是在Linux 内核2.6版本以上的系统中运行HornetQ,我们强烈建议
+ 你使用 <literal>AIO</literal>日志,以获得更佳的性能。</para>
+ <para>在早期的Linux版本中或其它操作系统中不可以使用 AIO日志。</para>
+ <para>如果你的Linux内核是2.6版本或以上但没有安装 <literal
+ >libaio</literal>,按照下列步骤可以很容易地安装它:</para>
+ <para>使用 yum,(如 Fedora 或 Red Hat Enterprise Linux):
<programlisting>yum install libaio</programlisting></para>
- <para>Using aptitude, (e.g. on Ubuntu or Debian system):
+ <para>使用 aptitude, (如 Ubuntu 或 Debian):
<programlisting>apt-get install libaio</programlisting></para>
</section>
<section id="persistence.enabled">
- <title>Configuring HornetQ for Zero Persistence</title>
- <para>In some situations, zero persistence is sometimes required for a messaging system.
- Configuring HornetQ to perform zero persistence is straightforward. Simply set the
- parameter <literal>persistence-enabled</literal> in <literal
- >hornetq-configuration.xml</literal> to <literal>false</literal>. </para>
- <para>Please note that if you set this parameter to false, then <emphasis>zero</emphasis>
- persistence will occur. That means no bindings data, message data, large message data,
- duplicate id caches or paging data will be persisted.</para>
+ <title>配置HornetQ不使用持久化</title>
+ <para>在一些情况下消息系统并不需要持久化。这时可以配置HornetQ不使用持久层。只要将<literal
+ >hornetq-configuration.xml</literal>文件中的<literal>persistence-enabled</literal>
+ 参数设为<literal>false</literal>即可。 </para>
+ <para>注意如果你将该参数设为 false来关闭持久化,就意味着所有的绑定数据、消息数据、超大消息数据、重复ID缓冲以及转移(paging)数据都将不会被持久。</para>
</section>
</chapter>
14 years, 11 months
JBoss hornetq SVN: r9033 - in trunk: tests/src/org/hornetq/tests/integration/jms and 1 other directory.
by do-not-reply@jboss.org
Author: jmesnil
Date: 2010-03-31 12:04:11 -0400 (Wed, 31 Mar 2010)
New Revision: 9033
Modified:
trunk/src/main/org/hornetq/jms/server/impl/JMSServerManagerImpl.java
trunk/tests/src/org/hornetq/tests/integration/jms/ManualReconnectionToSingleServerTest.java
Log:
fix Queue deployment
* in JMSServerManagerImpl.internalCreateQueue, call directly HornetQServer.deployQueue() instead of going throuhg the
management interface
Modified: trunk/src/main/org/hornetq/jms/server/impl/JMSServerManagerImpl.java
===================================================================
--- trunk/src/main/org/hornetq/jms/server/impl/JMSServerManagerImpl.java 2010-03-31 14:55:21 UTC (rev 9032)
+++ trunk/src/main/org/hornetq/jms/server/impl/JMSServerManagerImpl.java 2010-03-31 16:04:11 UTC (rev 9033)
@@ -1076,11 +1076,11 @@
coreFilterString = SelectorTranslator.convertToHornetQFilterString(selectorString);
}
- server.getHornetQServerControl().deployQueue(hqQueue.getAddress(),
- hqQueue.getAddress(),
- coreFilterString,
- durable);
-
+ server.deployQueue(SimpleString.toSimpleString(hqQueue.getAddress()),
+ SimpleString.toSimpleString(hqQueue.getAddress()),
+ SimpleString.toSimpleString(coreFilterString),
+ durable,
+ false);
queues.put(queueName, hqQueue);
jmsManagementService.registerQueue(hqQueue);
Modified: trunk/tests/src/org/hornetq/tests/integration/jms/ManualReconnectionToSingleServerTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/jms/ManualReconnectionToSingleServerTest.java 2010-03-31 14:55:21 UTC (rev 9032)
+++ trunk/tests/src/org/hornetq/tests/integration/jms/ManualReconnectionToSingleServerTest.java 2010-03-31 16:04:11 UTC (rev 9033)
@@ -164,7 +164,7 @@
JMSConfiguration configuration = new JMSConfigurationImpl();
context = new InVMContext();
configuration.setContext(context);
- configuration.getQueueConfigurations().add(new JMSQueueConfigurationImpl(queueName, null, false, queueName));
+ configuration.getQueueConfigurations().add(new JMSQueueConfigurationImpl(queueName, null, true, queueName));
ConnectionFactoryConfiguration cfConfig = new ConnectionFactoryConfigurationImpl("cf",
new TransportConfiguration(NettyConnectorFactory.class.getName()),
14 years, 11 months
JBoss hornetq SVN: r9032 - projects/jopr-plugin/trunk/src/resources/META-INF.
by do-not-reply@jboss.org
Author: ataylor
Date: 2010-03-31 10:55:21 -0400 (Wed, 31 Mar 2010)
New Revision: 9032
Modified:
projects/jopr-plugin/trunk/src/resources/META-INF/rhq-plugin.xml
Log:
added some jms manager message counter ops
Modified: projects/jopr-plugin/trunk/src/resources/META-INF/rhq-plugin.xml
===================================================================
--- projects/jopr-plugin/trunk/src/resources/META-INF/rhq-plugin.xml 2010-03-31 14:26:53 UTC (rev 9031)
+++ projects/jopr-plugin/trunk/src/resources/META-INF/rhq-plugin.xml 2010-03-31 14:55:21 UTC (rev 9032)
@@ -89,6 +89,10 @@
</c:list-property>
</results>
</operation>
+ <operation name="enableMessageCounters" displayName="Enable Message Counters" description="Enable Message Counters."/>
+ <operation name="disableMessageCounters" displayName="Disable Message Counters" description="Disable Message Counters."/>
+ <operation name="resetAllMessageCounters" displayName="Reset All MessageCounters" description="Reset All MessageCounters."/>
+ <operation name="resetAllMessageCounterHistories" displayName="Reset All Message Counter Histories" description="Reset All Message Counter Histories."/>
<metric property="version"
displayName="HornetQ Version"
description="The HornetQ version"
14 years, 11 months
JBoss hornetq SVN: r9031 - in trunk: src/main/org/hornetq/core/management/impl and 1 other directory.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2010-03-31 10:26:53 -0400 (Wed, 31 Mar 2010)
New Revision: 9031
Modified:
trunk/build-maven.xml
trunk/src/main/org/hornetq/core/management/impl/HornetQServerControlImpl.java
Log:
changing revision for another snapshot
Modified: trunk/build-maven.xml
===================================================================
--- trunk/build-maven.xml 2010-03-31 14:19:36 UTC (rev 9030)
+++ trunk/build-maven.xml 2010-03-31 14:26:53 UTC (rev 9031)
@@ -13,7 +13,7 @@
-->
<project default="upload" name="HornetQ">
- <property name="hornetq.version" value="2.1.0.r9008"/>
+ <property name="hornetq.version" value="2.1.0.r9031"/>
<property name="build.dir" value="build"/>
<property name="jars.dir" value="${build.dir}/jars"/>
Modified: trunk/src/main/org/hornetq/core/management/impl/HornetQServerControlImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/management/impl/HornetQServerControlImpl.java 2010-03-31 14:19:36 UTC (rev 9030)
+++ trunk/src/main/org/hornetq/core/management/impl/HornetQServerControlImpl.java 2010-03-31 14:26:53 UTC (rev 9031)
@@ -560,7 +560,7 @@
public void deployQueue(final String address, final String name, final String filterStr, final boolean durable) throws Exception
{
-// checkStarted(); // TODO: RE-enable this. Deploy is calling this method before start
+ checkStarted();
SimpleString filter = filterStr == null ? null : new SimpleString(filterStr);
clearIO();
14 years, 11 months
JBoss hornetq SVN: r9030 - trunk/examples/jms/temp-queue/server0.
by do-not-reply@jboss.org
Author: jmesnil
Date: 2010-03-31 10:19:36 -0400 (Wed, 31 Mar 2010)
New Revision: 9030
Modified:
trunk/examples/jms/temp-queue/server0/hornetq-configuration.xml
Log:
fix TemporaryQueue example
* update security configuration, JMS temp queues are prepended with jms.queue
Modified: trunk/examples/jms/temp-queue/server0/hornetq-configuration.xml
===================================================================
--- trunk/examples/jms/temp-queue/server0/hornetq-configuration.xml 2010-03-31 14:11:51 UTC (rev 9029)
+++ trunk/examples/jms/temp-queue/server0/hornetq-configuration.xml 2010-03-31 14:19:36 UTC (rev 9030)
@@ -20,8 +20,8 @@
<security-settings>
- <!--security for example queue-->
- <security-setting match="jms.queue.exampleQueue">
+ <!--security for example queues -->
+ <security-setting match="jms.queue.#">
<permission type="createDurableQueue" roles="guest"/>
<permission type="deleteDurableQueue" roles="guest"/>
<permission type="createTempQueue" roles="guest"/>
@@ -29,17 +29,6 @@
<permission type="consume" roles="guest"/>
<permission type="send" roles="guest"/>
</security-setting>
-
- <!-- needed so the session can create a temporary queue-->
- <security-setting match="jms.tempqueue.#">
- <permission type="createDurableQueue" roles="guest"/>
- <permission type="deleteDurableQueue" roles="guest"/>
- <permission type="createTempQueue" roles="guest"/>
- <permission type="deleteTempQueue" roles="guest"/>
- <permission type="consume" roles="guest"/>
- <permission type="send" roles="guest"/>
- </security-setting>
-
</security-settings>
</configuration>
14 years, 11 months
JBoss hornetq SVN: r9029 - trunk/examples/jms/request-reply/server0.
by do-not-reply@jboss.org
Author: jmesnil
Date: 2010-03-31 10:11:51 -0400 (Wed, 31 Mar 2010)
New Revision: 9029
Modified:
trunk/examples/jms/request-reply/server0/hornetq-configuration.xml
Log:
fix request/reply example
* update security configuration, JMS temp queues are prepended with jms.queue
Modified: trunk/examples/jms/request-reply/server0/hornetq-configuration.xml
===================================================================
--- trunk/examples/jms/request-reply/server0/hornetq-configuration.xml 2010-03-31 14:09:07 UTC (rev 9028)
+++ trunk/examples/jms/request-reply/server0/hornetq-configuration.xml 2010-03-31 14:11:51 UTC (rev 9029)
@@ -19,8 +19,8 @@
<!-- Other config -->
<security-settings>
- <!--security for example queue-->
- <security-setting match="jms.queue.exampleQueue">
+ <!--security for example queues -->
+ <security-setting match="jms.queue.#">
<permission type="createDurableQueue" roles="guest"/>
<permission type="deleteDurableQueue" roles="guest"/>
<permission type="createTempQueue" roles="guest"/>
@@ -28,16 +28,6 @@
<permission type="consume" roles="guest"/>
<permission type="send" roles="guest"/>
</security-setting>
-
- <!-- needed so the session can create a temporary queue-->
- <security-setting match="jms.tempqueue.#">
- <permission type="createDurableQueue" roles="guest"/>
- <permission type="deleteDurableQueue" roles="guest"/>
- <permission type="createTempQueue" roles="guest"/>
- <permission type="deleteTempQueue" roles="guest"/>
- <permission type="consume" roles="guest"/>
- <permission type="send" roles="guest"/>
- </security-setting>
</security-settings>
</configuration>
14 years, 11 months