}
nbr.setBrokers(brokers);
}
EndpointReference consumerEPR = nb.getBrokerConsumerReference().getReference();
URL consumerUrl = consumerEPR.getEndpointAddress().getAddress();
BrokerID consumerBrokerID = consumerEPR.getReferenceProperties().getProperty(BrokerID.class);
EndpointReference producerEPR = nb.getBrokerProducerReference().getReference();
URL producerUrl = producerEPR.getEndpointAddress().getAddress();
BrokerID producerBrokerID = producerEPR.getReferenceProperties().getProperty(BrokerID.class);
if (consumerBrokerID == null ||
producerBrokerID == null ||
!consumerBrokerID.getID().equals(producerBrokerID.getID())) {
throw new RuntimeException("Producer and consumer broker ids do not match");
}
// only add broker if consumerList == null && producerList == null
// otherwise, make it a pending broker and wait for ack
// TODO block for a configurable amount of time