example fixes

This commit is contained in:
Andy Taylor 2015-01-13 15:51:16 +00:00
parent 5595e0a9fc
commit 2c61399b11
2 changed files with 4 additions and 3 deletions

View File

@ -57,7 +57,6 @@ public class EmbeddedExample extends ActiveMQExample
System.out.println("Started Embedded JMS Server"); System.out.println("Started Embedded JMS Server");
JMSServerManager jmsServerManager = jmsServer.getJMSServerManager(); JMSServerManager jmsServerManager = jmsServer.getJMSServerManager();
jmsServerManager.addQueueToJndi("exampleQueue", "queue/exampleQueue");
List<String> connectors = new ArrayList<String>(); List<String> connectors = new ArrayList<String>();
connectors.add("in-vm"); connectors.add("in-vm");
jmsServerManager.createConnectionFactory("ConnectionFactory", false, JMSFactoryType.CF, connectors, "ConnectionFactory"); jmsServerManager.createConnectionFactory("ConnectionFactory", false, JMSFactoryType.CF, connectors, "ConnectionFactory");

View File

@ -82,8 +82,10 @@ public class SymmetricClusterExample extends ActiveMQExample
// connection factory directly we avoid having to worry about a JNDI look-up. // connection factory directly we avoid having to worry about a JNDI look-up.
// In an app server environment you could use HA-JNDI to lookup from the clustered JNDI servers without // In an app server environment you could use HA-JNDI to lookup from the clustered JNDI servers without
// having to know about a specific one. // having to know about a specific one.
UDPBroadcastGroupConfiguration udpCfg = new UDPBroadcastGroupConfiguration("231.7.7.7", 9876, null, -1); UDPBroadcastGroupConfiguration udpCfg = new UDPBroadcastGroupConfiguration();
DiscoveryGroupConfiguration groupConfiguration = new DiscoveryGroupConfiguration(ActiveMQClient.DEFAULT_DISCOVERY_INITIAL_WAIT_TIMEOUT, ActiveMQClient.DEFAULT_DISCOVERY_INITIAL_WAIT_TIMEOUT, udpCfg); udpCfg.setGroupAddress("231.7.7.7").setGroupPort(9876);
DiscoveryGroupConfiguration groupConfiguration = new DiscoveryGroupConfiguration();
groupConfiguration.setBroadcastEndpointFactoryConfiguration(udpCfg);
ConnectionFactory cf = ActiveMQJMSClient.createConnectionFactoryWithHA(groupConfiguration, JMSFactoryType.CF); ConnectionFactory cf = ActiveMQJMSClient.createConnectionFactoryWithHA(groupConfiguration, JMSFactoryType.CF);