Skip to content

Commit

Permalink
add naming server configuration
Browse files Browse the repository at this point in the history
Add the ability to configure the naming server in the standalone hornetq.xml file.
  • Loading branch information
andytaylor committed Oct 10, 2014
1 parent b150e73 commit 1792e0f
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 0 deletions.
3 changes: 3 additions & 0 deletions distribution/hornetq/src/main/resources/config/hornetq.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,12 @@
<broker xmlns="http://hornetq.org/schema">

<core configuration="${hornetq.home}/config/stand-alone/non-clustered/hornetq-configuration.xml"></core>

<jms configuration="${hornetq.home}/config/stand-alone/non-clustered/hornetq-jms.xml"></jms>

<basic-security/>

<naming bindAddress="localhost" port="1099" rmiBindAddress="localhost" rmiPort="1098"/>

</broker>

12 changes: 12 additions & 0 deletions hornetq-bootstrap/src/main/java/org/hornetq/cli/commands/Run.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,18 @@ public Object execute(ActionContext context) throws Exception

namingServer = new StandaloneNamingServer(server);

namingServer.setBindAddress(broker.naming.bindAddress);

namingServer.setPort(broker.naming.port);

namingServer.setRmiBindAddress(broker.naming.rmiBindAddress);

namingServer.setRmiPort(broker.naming.rmiPort);

namingServer.start();

HornetQBootstrapLogger.LOGGER.startedNamingService(broker.naming.bindAddress, broker.naming.port, broker.naming.rmiBindAddress, broker.naming.rmiPort);

if (jms != null)
{
jmsServerManager = new JMSServerManagerImpl(server, jms);
Expand All @@ -86,6 +96,8 @@ public Object execute(ActionContext context) throws Exception
jmsServerManager = new JMSServerManagerImpl(server);
}

HornetQBootstrapLogger.LOGGER.serverStarting();

jmsServerManager.start();

return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ public interface HornetQBootstrapLogger extends BasicLogger
@Message(id = 101001, value = "Stopping HornetQ Server", format = Message.Format.MESSAGE_FORMAT)
void serverStopping();

@LogMessage(level = Logger.Level.INFO)
@Message(id = 101002, value = "Starting Naming server on {0}:{1,number,#} (rmi {2}:{3,number,#})", format = Message.Format.MESSAGE_FORMAT)
void startedNamingService(String bindAddress, int port, String rmiBindAddress, int rmiPort);

@LogMessage(level = Logger.Level.WARN)
@Message(id = 102000, value = "Error during undeployment: {0}", format = Message.Format.MESSAGE_FORMAT)
void errorDuringUndeployment(@Cause Throwable t, String name);
Expand Down
3 changes: 3 additions & 0 deletions hornetq-dto/src/main/java/org/hornetq/dto/BrokerDTO.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,7 @@ public class BrokerDTO
@XmlElementRef
public SecurityDTO security;

@XmlElementRef
public NamingDTO naming;

}
35 changes: 35 additions & 0 deletions hornetq-dto/src/main/java/org/hornetq/dto/NamingDTO.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* Copyright 2005-2014 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.dto;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;

@XmlRootElement(name = "naming")
@XmlAccessorType(XmlAccessType.FIELD)
public class NamingDTO
{
@XmlAttribute
public String bindAddress = "localhost";

@XmlAttribute
public int port = 1099;

@XmlAttribute
public String rmiBindAddress = "localhost";

@XmlAttribute
public int rmiPort = 1098;
}
1 change: 1 addition & 0 deletions hornetq-dto/src/main/resources/org/hornetq/dto/jaxb.index
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ CoreDTO
JmsDTO
SecurityDTO
BasicSecurityDTO
NamingDTO

0 comments on commit 1792e0f

Please sign in to comment.