|
1 | 1 | /*
|
2 |
| - * Copyright 2012-2017 the original author or authors. |
| 2 | + * Copyright 2012-2018 the original author or authors. |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | * you may not use this file except in compliance with the License.
|
|
18 | 18 |
|
19 | 19 | import java.io.File;
|
20 | 20 |
|
| 21 | +import org.apache.activemq.artemis.api.core.RoutingType; |
| 22 | +import org.apache.activemq.artemis.api.core.SimpleString; |
21 | 23 | import org.apache.activemq.artemis.api.core.TransportConfiguration;
|
22 | 24 | import org.apache.activemq.artemis.core.config.Configuration;
|
| 25 | +import org.apache.activemq.artemis.core.config.CoreAddressConfiguration; |
| 26 | +import org.apache.activemq.artemis.core.config.CoreQueueConfiguration; |
23 | 27 | import org.apache.activemq.artemis.core.config.impl.ConfigurationImpl;
|
24 | 28 | import org.apache.activemq.artemis.core.remoting.impl.invm.InVMAcceptorFactory;
|
25 | 29 | import org.apache.activemq.artemis.core.server.JournalType;
|
| 30 | +import org.apache.activemq.artemis.core.settings.impl.AddressSettings; |
26 | 31 | import org.apache.commons.logging.Log;
|
27 | 32 | import org.apache.commons.logging.LogFactory;
|
28 | 33 |
|
@@ -65,9 +70,22 @@ public Configuration createConfiguration() {
|
65 | 70 | + this.properties.getClusterPassword());
|
66 | 71 | }
|
67 | 72 | configuration.setClusterPassword(this.properties.getClusterPassword());
|
| 73 | + configuration.addAddressConfiguration(createAddressConfiguration("DLQ")); |
| 74 | + configuration.addAddressConfiguration(createAddressConfiguration("ExpiryQueue")); |
| 75 | + configuration.addAddressesSetting("#", |
| 76 | + new AddressSettings() |
| 77 | + .setDeadLetterAddress(SimpleString.toSimpleString("DLQ")) |
| 78 | + .setExpiryAddress(SimpleString.toSimpleString("ExpiryQueue"))); |
68 | 79 | return configuration;
|
69 | 80 | }
|
70 | 81 |
|
| 82 | + private CoreAddressConfiguration createAddressConfiguration(String name) { |
| 83 | + return new CoreAddressConfiguration().setName(name) |
| 84 | + .addRoutingType(RoutingType.ANYCAST) |
| 85 | + .addQueueConfiguration(new CoreQueueConfiguration().setName(name) |
| 86 | + .setRoutingType(RoutingType.ANYCAST)); |
| 87 | + } |
| 88 | + |
71 | 89 | private String getDataDir() {
|
72 | 90 | if (this.properties.getDataDirectory() != null) {
|
73 | 91 | return this.properties.getDataDirectory();
|
|
0 commit comments