example fixes
This commit is contained in:
parent
5595e0a9fc
commit
2c61399b11
|
@ -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");
|
||||||
|
|
|
@ -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);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue