use of org.apache.activemq.artemis.core.settings.impl.AddressSettings in project activemq-artemis by apache.
the class RelativePathTest method testRelativePathOnDefaultConfig.
@Test
public void testRelativePathOnDefaultConfig() throws Exception {
Configuration configuration = createDefaultConfig(false);
ActiveMQServer server = createServer(true, configuration, AddressSettings.DEFAULT_PAGE_SIZE, AddressSettings.DEFAULT_MAX_SIZE_BYTES, new HashMap<String, AddressSettings>());
server.start();
server.stop();
checkData(new File(configuration.getJournalDirectory()), ".amq");
checkData(new File(configuration.getBindingsDirectory()), ".bindings");
}
use of org.apache.activemq.artemis.core.settings.impl.AddressSettings in project activemq-artemis by apache.
the class RelativePathTest method testRelativePath.
@Test
public void testRelativePath() throws Exception {
Configuration configuration = createDefaultConfig(false);
File instanceHome = new File(getTemporaryDir(), "artemisHome");
File dataHome = new File(instanceHome, "data");
// One folder up for testing
File bindingsHome = new File(instanceHome, "../binx");
System.out.println("InstanceHome->" + instanceHome);
instanceHome.mkdirs();
configuration.setBrokerInstance(instanceHome);
configuration.setJournalDirectory("./data");
configuration.setPagingDirectory("./paging");
configuration.setBindingsDirectory("../binx");
// one folder up from instance home
configuration.setLargeMessagesDirectory("./large");
ActiveMQServer server = createServer(true, configuration, AddressSettings.DEFAULT_PAGE_SIZE, AddressSettings.DEFAULT_MAX_SIZE_BYTES, new HashMap<String, AddressSettings>());
server.start();
server.stop();
checkData(dataHome, ".amq");
checkData(bindingsHome, ".bindings");
}
use of org.apache.activemq.artemis.core.settings.impl.AddressSettings in project activemq-artemis by apache.
the class DuplicateRecordIdTest method setUp.
@Override
@Before
public void setUp() throws Exception {
super.setUp();
server = createServer(false, createDefaultInVMConfig().addAddressesSetting("#", new AddressSettings().setDeadLetterAddress(new SimpleString("dlq")).setExpiryAddress(new SimpleString("dlq"))));
server.getConfiguration().setPersistenceEnabled(true);
}
use of org.apache.activemq.artemis.core.settings.impl.AddressSettings in project activemq-artemis by apache.
the class ExpireWhileLoadBalanceTest method testSend.
@Test
public void testSend() throws Exception {
waitForTopology(getServer(0), 3);
waitForTopology(getServer(1), 3);
waitForTopology(getServer(2), 3);
SimpleString expiryQueue = SimpleString.toSimpleString("expiryQueue");
AddressSettings as = new AddressSettings();
as.setDeadLetterAddress(expiryQueue);
as.setExpiryAddress(expiryQueue);
for (int i = 0; i <= 2; i++) {
createQueue(i, "queues.testaddress", "queue0", null, true);
getServer(i).createQueue(expiryQueue, RoutingType.ANYCAST, expiryQueue, null, true, false);
getServer(i).getAddressSettingsRepository().addMatch("#", as);
}
// this will pause all the cluster bridges
for (ClusterConnection clusterConnection : getServer(0).getClusterManager().getClusterConnections()) {
for (MessageFlowRecord record : ((ClusterConnectionImpl) clusterConnection).getRecords().values()) {
record.getBridge().pause();
}
}
ClientSessionFactory sf = sfs[0];
ClientSession session = sf.createSession(false, false);
ClientProducer producer = session.createProducer("queues.testaddress");
for (int i = 0; i < 1000; i++) {
ClientMessage message = session.createMessage(true);
message.setExpiration(500);
producer.send(message);
}
session.commit();
session.start();
ClientConsumer consumer = session.createConsumer("expiryQueue");
for (int i = 0; i < 1000; i++) {
ClientMessage message = consumer.receive(2000);
Assert.assertNotNull(message);
message.acknowledge();
}
session.commit();
session.close();
}
use of org.apache.activemq.artemis.core.settings.impl.AddressSettings in project activemq-artemis by apache.
the class MessageRedistributionWithDiscoveryTest method setServer.
/**
* @param messageLoadBalancingType
* @throws Exception
*/
protected void setServer(final MessageLoadBalancingType messageLoadBalancingType, int server) throws Exception {
setupLiveServerWithDiscovery(server, groupAddress, groupPort, isFileStorage(), isNetty(), false);
AddressSettings setting = new AddressSettings().setRedeliveryDelay(0).setRedistributionDelay(0);
servers[server].getAddressSettingsRepository().addMatch("#", setting);
setupDiscoveryClusterConnection("cluster" + server, server, "dg1", "queues", messageLoadBalancingType, 1, isNetty());
}
Aggregations