1

I can't get several Broker to communicate with each other. Everything else works as expected (including the communication between producer and consumer). But how to I manage that Broker talk to each other using multicast?

Any advice would be highly appreciated

This is my environment:

  • 10 virtual hosts using ubuntu 12 with working Multicast (ping tested)
  • Java-Application using ActiveMQ on every host
  • Every Host starts a client (Java-App), and every client is able to manage some agents, which can grab some jobs from a common joblist (just running "sleep" at the moment)

These are the Broker settings

private String brokerUri;
private String brokerName;
private String brokerProtokol = "tcp://";;
private int    brokerPort = 9999;
private String networkConName = "Network";
private String transportConName = "Transport";
private BrokerService broker;
brokerUri = Inet4Address.getLocalHost().getHostAddress();
brokerName = Inet4Address.getLocalHost().getHostName();

and this is the code snipped which is maybe not correct:

public void createBroker() throws UnknownHostException, InterruptedException{
try {
broker = new BrokerService();
TransportConnector transportCon = new TransportConnector();
NetworkConnector networkCon = new NetworkConnector(new URI("multicast://default")) {
};
broker.setBrokerName(brokerName);
transportCon.setUri(new URI(brokerProtokol+brokerUri+":"+brokerPort));
transportCon.setName(transportConName);
transportCon.setDiscoveryUri(new URI("multicast://default"));
final SystemUsage systemUsage = broker.getSystemUsage();
systemUsage.getMemoryUsage().setLimit(1024 * 1024 * 2); // 2 MB
systemUsage.getTempUsage().setLimit(1024L * 1024 * 1024 * 2); // 2 GB
systemUsage.getStoreUsage().setLimit(1024L * 1024 * 1024 * 2); // 2 GB
broker.setPersistent(true);
networkCon.setDuplex(true);
//                broker.setUseJmx(true);
broker.addConnector(transportCon);
broker.addNetworkConnector(networkCon);
broker.start();
4

0 回答 0