JBoss hornetq SVN: r9028 - trunk/examples/jms/queue-requestor/server0.
by do-not-reply@jboss.org
Author: jmesnil
Date: 2010-03-31 10:09:07 -0400 (Wed, 31 Mar 2010)
New Revision: 9028
Modified:
trunk/examples/jms/queue-requestor/server0/hornetq-configuration.xml
Log:
fix QueueRequestor example
* update security configuration, JMS temp queues are prepended with jms.queue
Modified: trunk/examples/jms/queue-requestor/server0/hornetq-configuration.xml
===================================================================
--- trunk/examples/jms/queue-requestor/server0/hornetq-configuration.xml 2010-03-31 14:07:09 UTC (rev 9027)
+++ trunk/examples/jms/queue-requestor/server0/hornetq-configuration.xml 2010-03-31 14:09:07 UTC (rev 9028)
@@ -20,8 +20,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"/>
@@ -29,16 +29,6 @@
<permission type="consume" roles="guest"/>
<permission type="send" roles="guest"/>
</security-setting>
- <!-- needed so
- the queue requester 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>
15 years, 8 months
JBoss hornetq SVN: r9027 - in projects/jopr-plugin/trunk/src: resources/META-INF and 1 other directory.
by do-not-reply@jboss.org
Author: ataylor
Date: 2010-03-31 10:07:09 -0400 (Wed, 31 Mar 2010)
New Revision: 9027
Modified:
projects/jopr-plugin/trunk/src/main/java/org/jboss/as/integration/hornetq/jopr/JMSConstants.java
projects/jopr-plugin/trunk/src/main/java/org/jboss/as/integration/hornetq/jopr/JMSManagerComponent.java
projects/jopr-plugin/trunk/src/main/java/org/jboss/as/integration/hornetq/jopr/JMSResourceComponent.java
projects/jopr-plugin/trunk/src/resources/META-INF/rhq-plugin.xml
Log:
added some jms manager ops
Modified: projects/jopr-plugin/trunk/src/main/java/org/jboss/as/integration/hornetq/jopr/JMSConstants.java
===================================================================
--- projects/jopr-plugin/trunk/src/main/java/org/jboss/as/integration/hornetq/jopr/JMSConstants.java 2010-03-31 13:57:54 UTC (rev 9026)
+++ projects/jopr-plugin/trunk/src/main/java/org/jboss/as/integration/hornetq/jopr/JMSConstants.java 2010-03-31 14:07:09 UTC (rev 9027)
@@ -40,4 +40,10 @@
public static final ComponentType COMPONENT_TYPE = new ComponentType("JMSDestinationManage", "TopicManage");
}
+
+ interface Manager
+ {
+ public static final String COMPONENT_NAME = "JMSServerMO";
+ public static final ComponentType COMPONENT_TYPE = new ComponentType("JMSManage", "ServerManage");
+ }
}
Modified: projects/jopr-plugin/trunk/src/main/java/org/jboss/as/integration/hornetq/jopr/JMSManagerComponent.java
===================================================================
--- projects/jopr-plugin/trunk/src/main/java/org/jboss/as/integration/hornetq/jopr/JMSManagerComponent.java 2010-03-31 13:57:54 UTC (rev 9026)
+++ projects/jopr-plugin/trunk/src/main/java/org/jboss/as/integration/hornetq/jopr/JMSManagerComponent.java 2010-03-31 14:07:09 UTC (rev 9027)
@@ -36,8 +36,8 @@
import org.rhq.core.domain.measurement.MeasurementReport;
import org.rhq.core.domain.measurement.MeasurementScheduleRequest;
import org.rhq.core.domain.resource.CreateResourceStatus;
+import org.rhq.core.pluginapi.configuration.ConfigurationUpdateReport;
import org.rhq.core.pluginapi.inventory.*;
-import org.rhq.core.pluginapi.measurement.MeasurementFacet;
import java.lang.reflect.Method;
import java.util.List;
@@ -49,10 +49,8 @@
* @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
* Created 11-Mar-2010
*/
-public class JMSManagerComponent implements ResourceComponent, CreateChildResourceFacet, MeasurementFacet, JMSComponent
+public class JMSManagerComponent extends JMSResourceComponent implements ResourceComponent, CreateChildResourceFacet, JMSComponent
{
- private ResourceContext resourceContext;
-
public void getValues(MeasurementReport measurementReport, Set<MeasurementScheduleRequest> measurementScheduleRequests) throws Exception
{
@@ -172,6 +170,19 @@
return createResourceReport;
}
+
+ public void start(ResourceContext resourceContext) throws InvalidPluginConfigurationException, Exception
+ {
+ this.resourceContext = resourceContext;
+
+ jmsComponent = this;
+ }
+
+ public void stop()
+ {
+ this.resourceContext = null;
+ }
+
private void createConnectionFactory(CreateResourceReport createResourceReport, ManagementView managementView, String name,String liveTransportClassNames, String liveTransportParams, String backupTransportClassNames, String backupTransportParams, String bindings, String discoveryAddress, int discoveryPort, long discoveryRefreshTimeout, String clientId, int dupsOkBatchSize, int transactionBatchSize, long clientFailureCheckPeriod, long connectionTTL, long callTimeout, int consumerWindowSize, int confirmationWindowSize, int producerMaxRate, int producerWindowSize, boolean cacheLargeMessageClient, int minLargeMessageSize, boolean blockOnNonDurableSend, boolean blockOnAcknowledge, boolean blockOnDurableSend, boolean autoGroup, boolean preAcknowledge, long maxRetryInterval, double retryIntervalMultiplier, int reconnectAttempts, boolean failoverOnShutdown, int scheduledThreadPoolMaxSize, int threadPoolMaxSize, String groupId, int initialMessagePacketSize, boolean useGlobalPool!
s, long retryInterval, String connectionLoadBalancingPolicyClassName)
throws Exception
{
@@ -284,17 +295,6 @@
createResourceReport.setResourceName("jms.topic." + name);
}
-
- public void start(ResourceContext resourceContext) throws InvalidPluginConfigurationException, Exception
- {
- this.resourceContext = resourceContext;
- }
-
- public void stop()
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
public AvailabilityType getAvailability()
{
return AvailabilityType.UP;
@@ -309,6 +309,59 @@
return (ManagementView) m.invoke(conn);
}
+ @Override
+ protected String getInvokeOperationSubscriptionMessage()
+ {
+ return null;
+ }
+
+ @Override
+ protected String getInvokeOperationJMSMessage()
+ {
+ return null;
+ }
+
+ @Override
+ protected String getInvokeOperation()
+ {
+ return "invokeManagerOperation";
+ }
+
+ @Override
+ String getComponentName()
+ {
+ return JMSConstants.Manager.COMPONENT_NAME;
+ }
+
+ @Override
+ ComponentType getComponentType()
+ {
+ return JMSConstants.Manager.COMPONENT_TYPE;
+ }
+
+ @Override
+ String getConfigurationOperationName()
+ {
+ return null;
+ }
+
+ @Override
+ String getMeasurementsOperationName()
+ {
+ return null;
+ }
+
+ @Override
+ String getDeleteOperationName()
+ {
+ return null;
+ }
+
+ public void updateResourceConfiguration(ConfigurationUpdateReport configurationUpdateReport)
+ {
+
+ }
+
private void createRoles(CreateResourceReport configurationUpdateReport, String name, StringBuffer sendRoles, StringBuffer consumeRoles)
{
PropertyList propertyList = (PropertyList) configurationUpdateReport.getResourceConfiguration().get("roles");
Modified: projects/jopr-plugin/trunk/src/main/java/org/jboss/as/integration/hornetq/jopr/JMSResourceComponent.java
===================================================================
--- projects/jopr-plugin/trunk/src/main/java/org/jboss/as/integration/hornetq/jopr/JMSResourceComponent.java 2010-03-31 13:57:54 UTC (rev 9026)
+++ projects/jopr-plugin/trunk/src/main/java/org/jboss/as/integration/hornetq/jopr/JMSResourceComponent.java 2010-03-31 14:07:09 UTC (rev 9027)
@@ -57,7 +57,7 @@
public abstract class JMSResourceComponent implements ResourceComponent, MeasurementFacet, OperationFacet, ConfigurationFacet, JMSComponent, DeleteResourceFacet
{
protected ResourceContext resourceContext;
- private JMSComponent jmsComponent;
+ protected JMSComponent jmsComponent;
public AvailabilityType getAvailability()
{
@@ -294,6 +294,23 @@
SimpleValueSupport valueSupport = (SimpleValueSupport) val;
return new OperationResult(valueSupport.getValue().toString());
}
+ else if(type.equalsIgnoreCase("String[]"))
+ {
+ OperationResult operationResult = new OperationResult();
+ Configuration c = operationResult.getComplexResults();
+ PropertyList property = new PropertyList("result");
+ ArrayValueSupport support = (ArrayValueSupport) val;
+ for(int i = 0; i < support.getLength(); i++)
+ {
+ org.rhq.core.domain.configuration.PropertyMap p1 = new org.rhq.core.domain.configuration.PropertyMap("element");
+ property.add(p1);
+ SimpleValueSupport svs = (SimpleValueSupport) ((ArrayValueSupport) val).getValue(i);
+ if(svs != null)
+ p1.put(new PropertySimple("value",svs.getValue()));
+ }
+ c.put(property);
+ return operationResult;
+ }
else if(type.equalsIgnoreCase("JMSMessage") || type.equalsIgnoreCase("SubscriptionInfo"))
{
OperationResult operationResult = new OperationResult();
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 13:57:54 UTC (rev 9026)
+++ projects/jopr-plugin/trunk/src/resources/META-INF/rhq-plugin.xml 2010-03-31 14:07:09 UTC (rev 9027)
@@ -40,7 +40,55 @@
<parent-resource-type name="JBossAS Server" plugin="JBossAS"/>
<parent-resource-type name="JBossAS Server" plugin="JBossAS5"/>
</runs-inside>
-
+
+ <operation name="listRemoteAddresses,result=String[]" displayName="List Remote Addresses" description="List all remote addresses connected to HornetQ.">
+ <results>
+ <c:list-property name="result">
+ <c:map-property required="false" name="element">
+ <c:simple-property type="string" name="value"/>
+ </c:map-property>
+ </c:list-property>
+ </results>
+ </operation>
+ <operation name="listRemoteAddresses2,operation=listRemoteAddresses,result=String[]" displayName="List Remote Addresses" description="List all remote addresses connected to HornetQ that match an ip address.">
+ <parameters>
+ <c:simple-property required="true" name="ipAddress" displayName="The IP Address"/>
+ </parameters>
+ <results>
+ <c:list-property name="result">
+ <c:map-property required="false" name="element">
+ <c:simple-property type="string" name="value"/>
+ </c:map-property>
+ </c:list-property>
+ </results>
+ </operation>
+ <operation name="closeConnectionsForAddress" displayName="Close Connection" description="Closes all the connections for the given IP Address.">
+ <parameters>
+ <c:simple-property required="true" name="ipAddress" displayName="The IP Address"/>
+ </parameters>
+ <results><c:simple-property name="operationResult" type="boolean" description="The Outcome of closing the connection."/></results>
+ </operation>
+ <operation name="listConnectionIDs,result=String[]" displayName="List connections" description="List all the connection IDs.">
+ <results>
+ <c:list-property name="result">
+ <c:map-property required="false" name="element">
+ <c:simple-property type="string" name="value"/>
+ </c:map-property>
+ </c:list-property>
+ </results>
+ </operation>
+ <operation name="listSessions,result=String[]" displayName="List sessions" description="List the sessions for the given connectionID.">
+ <parameters>
+ <c:simple-property required="true" name="connectionID" displayName="The Connection ID"/>
+ </parameters>
+ <results>
+ <c:list-property name="result">
+ <c:map-property required="false" name="element">
+ <c:simple-property type="string" name="value"/>
+ </c:map-property>
+ </c:list-property>
+ </results>
+ </operation>
<metric property="version"
displayName="HornetQ Version"
description="The HornetQ version"
15 years, 8 months
JBoss hornetq SVN: r9026 - trunk/examples/jms/management/server0.
by do-not-reply@jboss.org
Author: jmesnil
Date: 2010-03-31 09:57:54 -0400 (Wed, 31 Mar 2010)
New Revision: 9026
Modified:
trunk/examples/jms/management/server0/hornetq-configuration.xml
Log:
fix Management example
* update security configuration, JMS temp queues are prepended with jms.queue
Modified: trunk/examples/jms/management/server0/hornetq-configuration.xml
===================================================================
--- trunk/examples/jms/management/server0/hornetq-configuration.xml 2010-03-31 13:31:09 UTC (rev 9025)
+++ trunk/examples/jms/management/server0/hornetq-configuration.xml 2010-03-31 13:57:54 UTC (rev 9026)
@@ -35,7 +35,7 @@
</security-setting>
<!-- security settings for JMS temporary queue -->
- <security-setting match="jms.tempqueue.#">
+ <security-setting match="jms.queue.#">
<permission type="createTempQueue" roles="guest"/>
<permission type="deleteTempQueue" roles="guest"/>
<permission type="consume" roles="guest"/>
15 years, 8 months
JBoss hornetq SVN: r9025 - in trunk: src/main/org/hornetq/core/management/impl and 1 other directories.
by do-not-reply@jboss.org
Author: jmesnil
Date: 2010-03-31 09:31:09 -0400 (Wed, 31 Mar 2010)
New Revision: 9025
Added:
trunk/src/main/org/hornetq/api/core/management/AddressSettingsInfo.java
Modified:
trunk/src/main/org/hornetq/api/core/management/HornetQServerControl.java
trunk/src/main/org/hornetq/core/management/impl/HornetQServerControlImpl.java
trunk/tests/src/org/hornetq/tests/integration/management/HornetQServerControlTest.java
trunk/tests/src/org/hornetq/tests/integration/management/HornetQServerControlUsingCoreTest.java
Log:
fix Management API
* do not expose HornetQ internal resources through the management API
Added: trunk/src/main/org/hornetq/api/core/management/AddressSettingsInfo.java
===================================================================
--- trunk/src/main/org/hornetq/api/core/management/AddressSettingsInfo.java (rev 0)
+++ trunk/src/main/org/hornetq/api/core/management/AddressSettingsInfo.java 2010-03-31 13:31:09 UTC (rev 9025)
@@ -0,0 +1,154 @@
+/*
+ * Copyright 2010 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.api.core.management;
+
+import org.hornetq.utils.json.JSONObject;
+
+/**
+ * A AddressSettingsInfo
+ *
+ * @author jmesnil
+ *
+ *
+ */
+public class AddressSettingsInfo
+{
+
+ // Constants -----------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
+ private String addressFullMessagePolicy;
+
+ private long maxSizeBytes;
+
+ private int pageSizeBytes;
+
+ private int maxDeliveryAttempts;
+
+ private long redeliveryDelay;
+
+ private String deadLetterAddress;
+
+ private String expiryAddress;
+
+ private boolean lastValueQueue;
+
+ private long redistributionDelay;
+
+ private boolean sendToDLAOnNoRoute;
+
+ // Static --------------------------------------------------------
+
+ public static final AddressSettingsInfo from(final String jsonString) throws Exception
+ {
+ JSONObject object = new JSONObject(jsonString);
+ return new AddressSettingsInfo(object.getString("addressFullMessagePolicy"),
+ object.getLong("maxSizeBytes"),
+ object.getInt("pageSizeBytes"),
+ object.getInt("maxDeliveryAttempts"),
+ object.getLong("redeliveryDelay"),
+ object.getString("DLA"),
+ object.getString("expiryAddress"),
+ object.getBoolean("lastValueQueue"),
+ object.getLong("redistributionDelay"),
+ object.getBoolean("sendToDLAOnNoRoute"));
+ }
+
+ // Constructors --------------------------------------------------
+
+ public AddressSettingsInfo(String addressFullMessagePolicy,
+ long maxSizeBytes,
+ int pageSizeBytes,
+ int maxDeliveryAttempts,
+ long redeliveryDelay,
+ String deadLetterAddress,
+ String expiryAddress,
+ boolean lastValueQueue,
+ long redistributionDelay,
+ boolean sendToDLAOnNoRoute)
+ {
+ this.addressFullMessagePolicy = addressFullMessagePolicy;
+ this.maxSizeBytes = maxSizeBytes;
+ this.pageSizeBytes = pageSizeBytes;
+ this.maxDeliveryAttempts = maxDeliveryAttempts;
+ this.redeliveryDelay = redeliveryDelay;
+ this.deadLetterAddress = deadLetterAddress;
+ this.expiryAddress = expiryAddress;
+ this.lastValueQueue = lastValueQueue;
+ this.redistributionDelay = redistributionDelay;
+ this.sendToDLAOnNoRoute = sendToDLAOnNoRoute;
+ }
+
+ // Public --------------------------------------------------------
+
+ public String getAddressFullMessagePolicy()
+ {
+ return addressFullMessagePolicy;
+ }
+
+ public long getMaxSizeBytes()
+ {
+ return maxSizeBytes;
+ }
+
+ public int getPageSizeBytes()
+ {
+ return pageSizeBytes;
+ }
+
+ public int getMaxDeliveryAttempts()
+ {
+ return maxDeliveryAttempts;
+ }
+
+ public long getRedeliveryDelay()
+ {
+ return redeliveryDelay;
+ }
+
+ public String getDeadLetterAddress()
+ {
+ return deadLetterAddress;
+ }
+
+ public String getExpiryAddress()
+ {
+ return expiryAddress;
+ }
+
+ public boolean isLastValueQueue()
+ {
+ return lastValueQueue;
+ }
+
+ public long getRedistributionDelay()
+ {
+ return redistributionDelay;
+ }
+
+ public boolean isSendToDLAOnNoRoute()
+ {
+ return sendToDLAOnNoRoute;
+ }
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+
+}
Modified: trunk/src/main/org/hornetq/api/core/management/HornetQServerControl.java
===================================================================
--- trunk/src/main/org/hornetq/api/core/management/HornetQServerControl.java 2010-03-31 11:31:37 UTC (rev 9024)
+++ trunk/src/main/org/hornetq/api/core/management/HornetQServerControl.java 2010-03-31 13:31:09 UTC (rev 9025)
@@ -20,7 +20,6 @@
import org.hornetq.api.core.HornetQException;
import org.hornetq.api.core.Interceptor;
import org.hornetq.core.security.Role;
-import org.hornetq.core.settings.impl.AddressSettings;
/**
* A HornetQServerControl is used to manage HornetQ servers.
@@ -495,8 +494,6 @@
@Operation(desc = "Remove security settings for an address", impact = MBeanOperationInfo.ACTION)
void removeSecuritySettings(@Parameter(desc = "an address match", name = "addressMatch") String addressMatch) throws Exception;
- Set<Role> getSecuritySettings(String addressMatch) throws Exception;
-
@Operation(desc = "get roles for a specific address match", impact = MBeanOperationInfo.INFO)
Object[] getRoles(@Parameter(desc = "an address match", name = "addressMatch") String addressMatch) throws Exception;
@@ -519,8 +516,6 @@
@Parameter(desc="do we send to the DLA when there is no where to route the message", name="sendToDLAOnNoRoute") boolean sendToDLAOnNoRoute,
@Parameter(desc="the ploicy to use when the address is full", name="addressFullMessagePolicy") String addressFullMessagePolicy) throws Exception;
- AddressSettings getAddressSettings(String address) throws Exception;
-
void removeAddressSettings(String addressMatch) throws Exception;
/**
Modified: trunk/src/main/org/hornetq/core/management/impl/HornetQServerControlImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/management/impl/HornetQServerControlImpl.java 2010-03-31 11:31:37 UTC (rev 9024)
+++ trunk/src/main/org/hornetq/core/management/impl/HornetQServerControlImpl.java 2010-03-31 13:31:09 UTC (rev 9025)
@@ -1227,21 +1227,6 @@
}
}
- public Set<Role> getSecuritySettings(String addressMatch) throws Exception
- {
- checkStarted();
-
- clearIO();
- try
- {
- return server.getSecurityRepository().getMatch(addressMatch);
- }
- finally
- {
- blockOnIO();
- }
- }
-
public Object[] getRoles(String addressMatch) throws Exception
{
checkStarted();
@@ -1372,13 +1357,6 @@
storageManager.storeAddressSetting(new PersistedAddressSetting(new SimpleString(address), addressSettings));
}
- public AddressSettings getAddressSettings(final String address)
- {
- checkStarted();
-
- return server.getAddressSettingsRepository().getMatch(address);
- }
-
public void removeAddressSettings(String addressMatch) throws Exception
{
checkStarted();
Modified: trunk/tests/src/org/hornetq/tests/integration/management/HornetQServerControlTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/management/HornetQServerControlTest.java 2010-03-31 11:31:37 UTC (rev 9024)
+++ trunk/tests/src/org/hornetq/tests/integration/management/HornetQServerControlTest.java 2010-03-31 13:31:09 UTC (rev 9025)
@@ -20,9 +20,9 @@
import org.hornetq.api.core.SimpleString;
import org.hornetq.api.core.TransportConfiguration;
+import org.hornetq.api.core.management.AddressSettingsInfo;
import org.hornetq.api.core.management.HornetQServerControl;
import org.hornetq.api.core.management.ObjectNameBuilder;
-import org.hornetq.api.core.management.Parameter;
import org.hornetq.api.core.management.QueueControl;
import org.hornetq.api.core.management.RoleInfo;
import org.hornetq.core.config.Configuration;
@@ -31,7 +31,6 @@
import org.hornetq.core.remoting.impl.invm.InVMConnectorFactory;
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.server.HornetQServers;
-import org.hornetq.core.settings.impl.AddressSettings;
import org.hornetq.tests.util.RandomUtil;
import org.hornetq.utils.json.JSONArray;
import org.hornetq.utils.json.JSONObject;
@@ -481,18 +480,19 @@
//restartServer();
serverControl = createManagementControl();
- AddressSettings settings = serverControl.getAddressSettings(exactAddress);
-
- assertEquals(DLA, settings.getDeadLetterAddress().toString());
- assertEquals(expiryAddress, settings.getExpiryAddress().toString());
- assertEquals(lastValueQueue, settings.isLastValueQueue());
- assertEquals(deliveryAttempts, settings.getMaxDeliveryAttempts());
- assertEquals(maxSizeBytes, settings.getMaxSizeBytes());
- assertEquals(pageSizeBytes, settings.getPageSizeBytes());
- assertEquals(redeliveryDelay, settings.getRedeliveryDelay());
- assertEquals(redistributionDelay, settings.getRedistributionDelay());
- assertEquals(sendToDLAOnNoRoute, settings.isSendToDLAOnNoRoute());
- assertEquals(addressFullMessagePolicy, settings.getAddressFullMessagePolicy().toString());
+ String jsonString = serverControl.getAddressSettingsAsJSON(exactAddress);
+ AddressSettingsInfo info = AddressSettingsInfo.from(jsonString);
+
+ assertEquals(DLA, info.getDeadLetterAddress());
+ assertEquals(expiryAddress, info.getExpiryAddress());
+ assertEquals(lastValueQueue, info.isLastValueQueue());
+ assertEquals(deliveryAttempts, info.getMaxDeliveryAttempts());
+ assertEquals(maxSizeBytes, info.getMaxSizeBytes());
+ assertEquals(pageSizeBytes, info.getPageSizeBytes());
+ assertEquals(redeliveryDelay, info.getRedeliveryDelay());
+ assertEquals(redistributionDelay, info.getRedistributionDelay());
+ assertEquals(sendToDLAOnNoRoute, info.isSendToDLAOnNoRoute());
+ assertEquals(addressFullMessagePolicy, info.getAddressFullMessagePolicy());
}
// Package protected ---------------------------------------------
Modified: trunk/tests/src/org/hornetq/tests/integration/management/HornetQServerControlUsingCoreTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/management/HornetQServerControlUsingCoreTest.java 2010-03-31 11:31:37 UTC (rev 9024)
+++ trunk/tests/src/org/hornetq/tests/integration/management/HornetQServerControlUsingCoreTest.java 2010-03-31 13:31:09 UTC (rev 9025)
@@ -517,24 +517,6 @@
proxy.invokeOperation("addAddressSettings", addressMatch, DLA, expiryAddress, lastValueQueue, deliveryAttempts, maxSizeBytes, pageSizeBytes, redeliveryDelay, redistributionDelay, sendToDLAOnNoRoute, addressFullMessagePolicy);
}
- public AddressSettings getAddressSettings(String address) throws Exception
- {
- String res = (String)proxy.invokeOperation("getAddressSettingsAsJSON", address);
- JSONObject object = new JSONObject(res);
- AddressSettings settings = new AddressSettings();
- settings.setDeadLetterAddress(SimpleString.toSimpleString(object.getString("DLA")));
- settings.setExpiryAddress(SimpleString.toSimpleString(object.getString("expiryAddress")));
- settings.setLastValueQueue(object.getBoolean("lastValueQueue"));
- settings.setMaxDeliveryAttempts(object.getInt("maxDeliveryAttempts"));
- settings.setMaxSizeBytes(object.getLong("maxSizeBytes"));
- settings.setPageSizeBytes(object.getInt("pageSizeBytes"));
- settings.setRedeliveryDelay(object.getLong("redeliveryDelay"));
- settings.setRedistributionDelay(object.getLong("redistributionDelay"));
- settings.setSendToDLAOnNoRoute(object.getBoolean("sendToDLAOnNoRoute"));
- settings.setAddressFullMessagePolicy(AddressFullMessagePolicy.valueOf(object.getString("addressFullMessagePolicy")));
- return settings;
- }
-
public void removeAddressSettings(String addressMatch) throws Exception
{
proxy.invokeOperation("removeAddressSettings", addressMatch);
15 years, 8 months
JBoss hornetq SVN: r9024 - in trunk: src/main/org/hornetq/core/message/impl and 5 other directories.
by do-not-reply@jboss.org
Author: timfox
Date: 2010-03-31 07:31:37 -0400 (Wed, 31 Mar 2010)
New Revision: 9024
Modified:
trunk/src/main/org/hornetq/core/client/impl/ClientSessionImpl.java
trunk/src/main/org/hornetq/core/message/impl/MessageImpl.java
trunk/src/main/org/hornetq/core/postoffice/impl/PostOfficeImpl.java
trunk/src/main/org/hornetq/core/server/cluster/impl/BridgeImpl.java
trunk/src/main/org/hornetq/core/server/impl/ServerSessionImpl.java
trunk/src/main/org/hornetq/ra/inflow/HornetQActivation.java
trunk/tests/src/org/hornetq/tests/integration/cluster/failover/FailoverTest.java
Log:
fixed default address optimisation
Modified: trunk/src/main/org/hornetq/core/client/impl/ClientSessionImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/client/impl/ClientSessionImpl.java 2010-03-31 10:38:37 UTC (rev 9023)
+++ trunk/src/main/org/hornetq/core/client/impl/ClientSessionImpl.java 2010-03-31 11:31:37 UTC (rev 9024)
@@ -999,6 +999,9 @@
}
channel.setTransferring(false);
+
+ //Reset default address
+ defaultAddress = null;
}
catch (Throwable t)
{
Modified: trunk/src/main/org/hornetq/core/message/impl/MessageImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/message/impl/MessageImpl.java 2010-03-31 10:38:37 UTC (rev 9023)
+++ trunk/src/main/org/hornetq/core/message/impl/MessageImpl.java 2010-03-31 11:31:37 UTC (rev 9024)
@@ -76,7 +76,7 @@
protected ResetLimitWrappedHornetQBuffer bodyBuffer;
- protected boolean bufferValid;
+ protected volatile boolean bufferValid;
private int endOfBodyPosition = -1;
@@ -244,7 +244,7 @@
return address;
}
- public void setAddress(final SimpleString address)
+ public synchronized void setAddress(final SimpleString address)
{
if (this.address != address)
{
Modified: trunk/src/main/org/hornetq/core/postoffice/impl/PostOfficeImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/postoffice/impl/PostOfficeImpl.java 2010-03-31 10:38:37 UTC (rev 9023)
+++ trunk/src/main/org/hornetq/core/postoffice/impl/PostOfficeImpl.java 2010-03-31 11:31:37 UTC (rev 9024)
@@ -548,7 +548,7 @@
}
SimpleString address = message.getAddress();
-
+
setPagingStore(message);
Object duplicateID = message.getObjectProperty(Message.HDR_DUPLICATE_DETECTION_ID);
Modified: trunk/src/main/org/hornetq/core/server/cluster/impl/BridgeImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/server/cluster/impl/BridgeImpl.java 2010-03-31 10:38:37 UTC (rev 9023)
+++ trunk/src/main/org/hornetq/core/server/cluster/impl/BridgeImpl.java 2010-03-31 11:31:37 UTC (rev 9024)
@@ -411,7 +411,7 @@
// nodes could have same queue ids
// Note we must copy since same message may get routed to other nodes which require different headers
message = message.copy();
-
+
// TODO - we can optimise this
Set<SimpleString> propNames = new HashSet<SimpleString>(message.getPropertyNames());
Modified: trunk/src/main/org/hornetq/core/server/impl/ServerSessionImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/server/impl/ServerSessionImpl.java 2010-03-31 10:38:37 UTC (rev 9023)
+++ trunk/src/main/org/hornetq/core/server/impl/ServerSessionImpl.java 2010-03-31 11:31:37 UTC (rev 9024)
@@ -911,10 +911,12 @@
{
long id = storageManager.generateUniqueID();
+ SimpleString address = message.getAddress();
+
message.setMessageID(id);
message.encodeMessageIDToBuffer();
-
- if (message.getAddress() == null)
+
+ if (address == null)
{
if (message.isDurable())
{
@@ -942,7 +944,7 @@
if (defaultAddress == null)
{
- defaultAddress = message.getAddress();
+ defaultAddress = address;
}
}
Modified: trunk/src/main/org/hornetq/ra/inflow/HornetQActivation.java
===================================================================
--- trunk/src/main/org/hornetq/ra/inflow/HornetQActivation.java 2010-03-31 10:38:37 UTC (rev 9023)
+++ trunk/src/main/org/hornetq/ra/inflow/HornetQActivation.java 2010-03-31 11:31:37 UTC (rev 9024)
@@ -95,7 +95,7 @@
private boolean isDeliveryTransacted;
private HornetQDestination destination;
-
+
/** The name of the temporary subscription name that all the sessions will share */
private SimpleString topicTemporaryQueue;
@@ -220,7 +220,6 @@
return isTopic;
}
-
/**
* Start the activation
*
@@ -235,7 +234,7 @@
deliveryActive.set(true);
ra.getWorkManager().scheduleWork(new SetupActivation());
}
-
+
/**
* @return the topicTemporaryQueue
*/
@@ -287,12 +286,25 @@
setupDestination();
for (int i = 0; i < spec.getMaxSessionInt(); i++)
{
- ClientSession session = setupSession();
+ ClientSession session = null;
- HornetQMessageHandler handler = new HornetQMessageHandler(this, session, i);
- handler.setup();
- session.start();
- handlers.add(handler);
+ try
+ {
+ session = setupSession();
+ HornetQMessageHandler handler = new HornetQMessageHandler(this, session, i);
+ handler.setup();
+ session.start();
+ handlers.add(handler);
+ }
+ catch (Exception e)
+ {
+ if (session != null)
+ {
+ session.close();
+ }
+
+ throw e;
+ }
}
HornetQActivation.log.info("Setup complete " + this);
@@ -426,11 +438,11 @@
// If there is no binding on naming, we will just create a new instance
if (isTopic)
{
- destination = (HornetQDestination) HornetQJMSClient.createTopic(destinationName.substring(destinationName.lastIndexOf('/') + 1));
+ destination = (HornetQDestination)HornetQJMSClient.createTopic(destinationName.substring(destinationName.lastIndexOf('/') + 1));
}
else
{
- destination = (HornetQDestination) HornetQJMSClient.createQueue(destinationName.substring(destinationName.lastIndexOf('/') + 1));
+ destination = (HornetQDestination)HornetQJMSClient.createQueue(destinationName.substring(destinationName.lastIndexOf('/') + 1));
}
}
}
@@ -452,11 +464,11 @@
{
if (Topic.class.getName().equals(spec.getDestinationType()))
{
- destination = (HornetQDestination) HornetQJMSClient.createTopic(spec.getDestination());
+ destination = (HornetQDestination)HornetQJMSClient.createTopic(spec.getDestination());
}
else
{
- destination = (HornetQDestination) HornetQJMSClient.createQueue(spec.getDestination());
+ destination = (HornetQDestination)HornetQJMSClient.createQueue(spec.getDestination());
}
}
Modified: trunk/tests/src/org/hornetq/tests/integration/cluster/failover/FailoverTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/cluster/failover/FailoverTest.java 2010-03-31 10:38:37 UTC (rev 9023)
+++ trunk/tests/src/org/hornetq/tests/integration/cluster/failover/FailoverTest.java 2010-03-31 11:31:37 UTC (rev 9024)
@@ -134,8 +134,6 @@
fail(session, latch);
- FailoverTest.log.info("got here 1");
-
ClientConsumer consumer = session.createConsumer(FailoverTestBase.ADDRESS);
session.start();
@@ -158,7 +156,6 @@
}
}
- FailoverTest.log.info("closing session");
session.close();
Assert.assertEquals(0, sf.numSessions());
@@ -228,7 +225,6 @@
message.acknowledge();
}
- FailoverTest.log.info("closing session");
session.close();
Assert.assertEquals(0, sf.numSessions());
@@ -1166,7 +1162,6 @@
{
public void connectionFailed(final HornetQException me)
{
- FailoverTest.log.info("calling listener");
latch.countDown();
}
}
@@ -1224,8 +1219,6 @@
boolean ok = latch.await(1000, TimeUnit.MILLISECONDS);
- FailoverTest.log.info("waited for latch");
-
Assert.assertTrue(ok);
try
@@ -1976,24 +1969,19 @@
{
sf.addInterceptor(interceptor);
- FailoverTest.log.info("attempting commit");
session.commit();
}
catch (HornetQException e)
{
if (e.getCode() == HornetQException.TRANSACTION_ROLLED_BACK)
{
- FailoverTest.log.info("got transaction rolled back");
-
// Ok - now we retry the commit after removing the interceptor
sf.removeInterceptor(interceptor);
try
{
- FailoverTest.log.info("trying to commit again");
session.commit();
- FailoverTest.log.info("committed again ok");
failed = false;
}
@@ -2017,8 +2005,6 @@
fail(session, latch);
- FailoverTest.log.info("connection has failed");
-
committer.join();
Assert.assertFalse(committer.failed);
@@ -2270,7 +2256,6 @@
*/
protected void setBody(final int i, final ClientMessage message) throws Exception
{
- log.info("in failovertest:: setbody");
message.getBodyBuffer().writeString("message" + i);
}
15 years, 8 months
JBoss hornetq SVN: r9023 - trunk/docs/user-manual/en.
by do-not-reply@jboss.org
Author: ataylor
Date: 2010-03-31 06:38:37 -0400 (Wed, 31 Mar 2010)
New Revision: 9023
Modified:
trunk/docs/user-manual/en/persistence.xml
Log:
added jms journal section
Modified: trunk/docs/user-manual/en/persistence.xml
===================================================================
--- trunk/docs/user-manual/en/persistence.xml 2010-03-31 10:33:42 UTC (rev 9022)
+++ trunk/docs/user-manual/en/persistence.xml 2010-03-31 10:38:37 UTC (rev 9023)
@@ -81,6 +81,13 @@
<para>The bindings journal is always a NIO journal as it is typically low throughput
compared to the message journal.</para>
</listitem>
+ <listitem>
+ <para>JMS journal.</para>
+ <para>This journal instance stores all JMS related data, This is basically any JMS Queues, Topics and Connection
+ Factories and any JNDI bindings for these resources.</para>
+ <para>Any JMS Resources created via the management API will be persisted to this journal. Any resources
+ configured via configuration files will not. The JMS Journal will only becreated if JMS is being used.</para>
+ </listitem>
<listitem>
<para>Message journal.</para>
<para>This journal instance stores all message related data, including the message
@@ -116,6 +123,10 @@
</listitem>
</itemizedlist>
</section>
+ <section id="configuring.bindings.jms">
+ <title>Configuring the jms journal</title>
+ <para>The jms config shares its configuration with the bindings journal.</para>
+ </section>
<section id="configuring.message.journal">
<title>Configuring the message journal</title>
<para>The message journal is configured using the following attributes in <literal
15 years, 8 months
JBoss hornetq SVN: r9022 - trunk.
by do-not-reply@jboss.org
Author: jmesnil
Date: 2010-03-31 06:33:42 -0400 (Wed, 31 Mar 2010)
New Revision: 9022
Modified:
trunk/build-hornetq.xml
Log:
Distribution build
* validate AS6 configuration files when building HornetQ distribution
Modified: trunk/build-hornetq.xml
===================================================================
--- trunk/build-hornetq.xml 2010-03-31 10:18:29 UTC (rev 9021)
+++ trunk/build-hornetq.xml 2010-03-31 10:33:42 UTC (rev 9022)
@@ -92,6 +92,8 @@
<property name="src.config.trunk.clustered.dir" value="${src.dir}/config/trunk/clustered"/>
<property name="src.config.jbossas.non-clustered.dir" value="${src.dir}/config/jboss-as/non-clustered"/>
<property name="src.config.jbossas.clustered.dir" value="${src.dir}/config/jboss-as/clustered"/>
+ <property name="src.config.jbossas6.non-clustered.dir" value="${src.dir}/config/jboss-as-6/non-clustered"/>
+ <property name="src.config.jbossas6.clustered.dir" value="${src.dir}/config/jboss-as-6/clustered"/>
<property name="src.config.service.dir" value="${src.dir}/config/service"/>
<property name="src.schema.dir" value="${src.config.dir}/common/schema"/>
<property name="src.bin.dir" value="${src.dir}/bin"/>
@@ -611,13 +613,21 @@
file="${src.schema.dir}/hornetq-users.xsd"/>
</schemavalidate>
+ <!-- AS 5 configuration validation -->
<antcall target="-validate-configuration">
<param name="conf.dir" value="${src.config.jbossas.non-clustered.dir}"/>
</antcall>
-
<antcall target="-validate-configuration">
<param name="conf.dir" value="${src.config.jbossas.clustered.dir}"/>
</antcall>
+
+ <!-- AS 6 configuration validation -->
+ <antcall target="-validate-configuration">
+ <param name="conf.dir" value="${src.config.jbossas6.non-clustered.dir}"/>
+ </antcall>
+ <antcall target="-validate-configuration">
+ <param name="conf.dir" value="${src.config.jbossas6.clustered.dir}"/>
+ </antcall>
</target>
<target name="-validate-configuration">
15 years, 8 months
JBoss hornetq SVN: r9021 - in trunk/docs/user-manual/en: images and 1 other directory.
by do-not-reply@jboss.org
Author: ataylor
Date: 2010-03-31 06:18:29 -0400 (Wed, 31 Mar 2010)
New Revision: 9021
Added:
trunk/docs/user-manual/en/images/console1.png
Modified:
trunk/docs/user-manual/en/management.xml
Log:
added doc section for admin console
Added: trunk/docs/user-manual/en/images/console1.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/user-manual/en/images/console1.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/docs/user-manual/en/management.xml
===================================================================
--- trunk/docs/user-manual/en/management.xml 2010-03-31 10:08:45 UTC (rev 9020)
+++ trunk/docs/user-manual/en/management.xml 2010-03-31 10:18:29 UTC (rev 9021)
@@ -906,4 +906,55 @@
message counters to retrieve information on a JMS <literal>Queue</literal>.</para>
</section>
</section>
+ <section>
+ <title>Administering HornetQ Resources Using The JBoss AS Admin Console</title>
+ <para>Its possible to create and configure HornetQ resources via the admin console within the JBoss Application Server.</para>
+ <para>The Admin Console will allow you to create destinations (JMS Topics and Queues) and JMS Connection Factories.</para>
+ <para>Once logged in to the admin console you will see a JMS Manager item in the left hand tree. All HornetQ resources
+ will be configured via this. This will have a child items for JMS Queues, Topics and Connection Factories, clicking
+ on each node will reveal which resources are currently available. The following sections explain how to create
+ and configure each resource in turn.</para>
+ <section>
+ <title>JMS Queues</title>
+ <para>To create a new JMS Queue click on the JMS Queues item to reveal the available queues. On the right hand
+ panel you will see an add a new resource button, click on this and then choose the default(JMS Queue) template
+ and click continue. The important things to fill in here are the name of the queue and the JNDI name of the
+ queue. The JNDI name is what you will use to look up the queue in JNDI from your client. For most queues this
+ will be the only info you will need to provide as sensible defaults are provided for the others. You will also
+ see a security roles section near the bottom. If you do not provide any roles for this queue then the servers
+ default security configuration will be used, after you have created the queue these will be shown in the configuration.
+ All configuration values, except the name and JNDI name, can be changed via the configuration tab after clicking
+ on the queue in the admin console. The following section explains these in more detail</para>
+ <para>After highlighting the configuration you will see the following screen</para>
+ <para>
+ <graphic fileref="images/console1.png" align="center"/>
+ </para>
+ <para>The name and JNDI name cant be changed, if you want to change these recreate the queue with the appropriate
+ settings. The rest of the configuration options, apart from security roles, relate to address settings for a particular
+ address. The default address settings are picked up from the servers configuration, if you change any of these
+ settings or create a queue via the console a new Address Settings enrty will be added. For a full explanation on
+ Address Settings see <xref linkend="queue-attributes.address-settings"/></para>
+ <para>To delete a queue simply click on the delete button beside the queue name in the main JMS Queues screen.
+ This will also delete any address settings or security settings previously created for the queues address</para>
+ <para>The last part of the configuration options are security roles. If non are provided on creation then the
+ servers default security settings will be shown. If these are changed or updated then new securty settings are
+ created for the address of this queue. For more information on securuty setting see <xref linkend="security"/> </para>
+ <para>It is also possible via the metrics tab to view statistics for this queue. This will show statistics such
+ as message count, consumer count etc.</para>
+ <para>Operations can be performed on a queue via the control tab. This will allow you to start and stop the queue,
+ list,move,expire and delete messages from the queue and other useful operations. To invoke an operation click on
+ the button for the operation you want, this will take you to a screen where you can parameters for the opertion can be set.
+ Once set clicking the ok button will invoke the operation, results appear at the bottom of the screen.</para>
+ </section>
+ <section>
+ <title>JMS Topics</title>
+ <para>Creating and configuring JMS Topics is almost identical to creating queues. The only difference is that the
+ configuration will be applied to the queue representing a subscription.</para>
+ </section>
+ <section>
+ <title>JMS Connection Factories</title>
+ <para>The format for creating connection factories is the same as for JMS Queues and topics apart frm the configuration
+ being different. For as list of all the connection factory settings see the configuration index </para>
+ </section>
+ </section>
</chapter>
15 years, 8 months
JBoss hornetq SVN: r9020 - trunk/src/config/jboss-as/clustered.
by do-not-reply@jboss.org
Author: jmesnil
Date: 2010-03-31 06:08:45 -0400 (Wed, 31 Mar 2010)
New Revision: 9020
Modified:
trunk/src/config/jboss-as/clustered/hornetq-jms.xml
Log:
fixed invalid XML configuration file
Modified: trunk/src/config/jboss-as/clustered/hornetq-jms.xml
===================================================================
--- trunk/src/config/jboss-as/clustered/hornetq-jms.xml 2010-03-31 08:36:23 UTC (rev 9019)
+++ trunk/src/config/jboss-as/clustered/hornetq-jms.xml 2010-03-31 10:08:45 UTC (rev 9020)
@@ -13,14 +13,14 @@
</connection-factory>
<connection-factory name="NettyThroughputConnectionFactory">
- <connectors>
+ <connectors>
<connector-ref connector-name="netty-throughput"/>
- </connectors>
- <entries>
- <entry name="/ThroughputConnectionFactory"/>
- <entry name="/XAThroughputConnectionFactory"/>
- </entries>
- /connection-factory>
+ </connectors>
+ <entries>
+ <entry name="/ThroughputConnectionFactory"/>
+ <entry name="/XAThroughputConnectionFactory"/>
+ </entries>
+ </connection-factory>
<connection-factory name="InVMConnectionFactory">
<connectors>
15 years, 8 months
JBoss hornetq SVN: r9019 - trunk/src/main/org/hornetq/ra/inflow.
by do-not-reply@jboss.org
Author: jmesnil
Date: 2010-03-31 04:36:23 -0400 (Wed, 31 Mar 2010)
New Revision: 9019
Modified:
trunk/src/main/org/hornetq/ra/inflow/HornetQActivation.java
Log:
fixed compilation error
Modified: trunk/src/main/org/hornetq/ra/inflow/HornetQActivation.java
===================================================================
--- trunk/src/main/org/hornetq/ra/inflow/HornetQActivation.java 2010-03-31 08:14:12 UTC (rev 9018)
+++ trunk/src/main/org/hornetq/ra/inflow/HornetQActivation.java 2010-03-31 08:36:23 UTC (rev 9019)
@@ -27,6 +27,7 @@
import javax.resource.ResourceException;
import javax.resource.spi.endpoint.MessageEndpointFactory;
import javax.resource.spi.work.Work;
+import javax.resource.spi.work.WorkException;
import javax.resource.spi.work.WorkManager;
import org.hornetq.api.core.SimpleString;
@@ -254,7 +255,7 @@
/**
* Stop the activation
*/
- public void stop() throws ResourceException
+ public void stop()
{
if (HornetQActivation.trace)
{
@@ -262,7 +263,14 @@
}
deliveryActive.set(false);
- ra.getWorkManager().scheduleWork(new TearDownActivation());
+ try
+ {
+ ra.getWorkManager().scheduleWork(new TearDownActivation());
+ }
+ catch (WorkException e)
+ {
+ log.warn("exception while scheduling activation teardown " + this, e);
+ }
}
/**
15 years, 8 months