ARTEMIS-3523 Small tweaks into AddressControl delegation
This commit is contained in:
parent
ebf8adc72b
commit
fdc0cc591c
|
@ -84,7 +84,7 @@ public class ReplayManager {
|
|||
}
|
||||
}
|
||||
|
||||
private void actualReplay(Date start, Date end, String sourceAddress, String targetAddress, String filterStr) throws Exception {
|
||||
private void actualReplay(Date start, Date end, String sourceAddress, String targetAddressParameter, String filterStr) throws Exception {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Replay::" + sourceAddress);
|
||||
}
|
||||
|
@ -92,6 +92,12 @@ public class ReplayManager {
|
|||
throw new NullPointerException("sourceAddress");
|
||||
}
|
||||
|
||||
if (targetAddressParameter == null || targetAddressParameter.trim().isEmpty()) {
|
||||
targetAddressParameter = sourceAddress;
|
||||
}
|
||||
|
||||
final String targetAddress = targetAddressParameter;
|
||||
|
||||
if (journal == null) {
|
||||
// notice this routing plays single threaded. no need for any sort of synchronization here
|
||||
journal = (JournalImpl)server.getStorageManager().getMessageJournal();
|
||||
|
|
|
@ -363,7 +363,6 @@ public class AddressControlTest extends ManagementTestBase {
|
|||
ClientSessionFactory sf2 = createSessionFactory(locator2);
|
||||
|
||||
session = sf2.createSession(false, true, false);
|
||||
session.createQueue(new QueueConfiguration(address));
|
||||
Assert.assertEquals(1024, addressControl.getNumberOfBytesPerPage());
|
||||
}
|
||||
|
||||
|
@ -601,12 +600,11 @@ public class AddressControlTest extends ManagementTestBase {
|
|||
}
|
||||
|
||||
private void testReplaySimple(boolean useDate) throws Exception {
|
||||
SimpleString address = RandomUtil.randomSimpleString();
|
||||
|
||||
AddressControl addressControl = createManagementControl(address);
|
||||
String queue = "testQueue" + RandomUtil.randomString();
|
||||
server.addAddressInfo(new AddressInfo(queue).addRoutingType(RoutingType.ANYCAST));
|
||||
server.createQueue(new QueueConfiguration(queue).setRoutingType(RoutingType.ANYCAST).setAddress(queue));
|
||||
AddressControl addressControl = createManagementControl(SimpleString.toSimpleString(queue));
|
||||
|
||||
ConnectionFactory factory = CFUtil.createConnectionFactory("core", "tcp://localhost:61616");
|
||||
try (Connection connection = factory.createConnection()) {
|
||||
|
@ -661,13 +659,13 @@ public class AddressControlTest extends ManagementTestBase {
|
|||
|
||||
@Test
|
||||
public void testReplayFilter() throws Exception {
|
||||
SimpleString address = RandomUtil.randomSimpleString();
|
||||
|
||||
AddressControl addressControl = createManagementControl(address);
|
||||
String queue = "testQueue" + RandomUtil.randomString();
|
||||
server.addAddressInfo(new AddressInfo(queue).addRoutingType(RoutingType.ANYCAST));
|
||||
server.createQueue(new QueueConfiguration(queue).setRoutingType(RoutingType.ANYCAST).setAddress(queue));
|
||||
|
||||
AddressControl addressControl = createManagementControl(SimpleString.toSimpleString(queue));
|
||||
|
||||
ConnectionFactory factory = CFUtil.createConnectionFactory("core", "tcp://localhost:61616");
|
||||
try (Connection connection = factory.createConnection()) {
|
||||
Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
|
||||
|
@ -704,8 +702,9 @@ public class AddressControlTest extends ManagementTestBase {
|
|||
public void setUp() throws Exception {
|
||||
super.setUp();
|
||||
|
||||
Configuration config = createDefaultInVMConfig().setJMXManagementEnabled(true);
|
||||
server = createServer(false, config);
|
||||
Configuration config = createDefaultNettyConfig().setJMXManagementEnabled(true);
|
||||
config.setJournalRetentionDirectory(config.getJournalDirectory() + "_ret"); // needed for replay tests
|
||||
server = createServer(true, config);
|
||||
server.setMBeanServer(mbeanServer);
|
||||
server.start();
|
||||
|
||||
|
|
Loading…
Reference in New Issue