|
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.
|
@@ -70,29 +70,22 @@ public Configuration createConfiguration() {
|
70 | 70 | + this.properties.getClusterPassword());
|
71 | 71 | }
|
72 | 72 | configuration.setClusterPassword(this.properties.getClusterPassword());
|
| 73 | + configuration.addAddressConfiguration(createAddressConfiguration("DLQ")); |
| 74 | + configuration.addAddressConfiguration(createAddressConfiguration("ExpiryQueue")); |
73 | 75 | configuration.addAddressesSetting("#",
|
74 |
| - new AddressSettings() |
75 |
| - .setDeadLetterAddress(SimpleString.toSimpleString("DLQ")) |
76 |
| - .setExpiryAddress(SimpleString.toSimpleString("ExpiryQueue"))); |
77 |
| - configuration.addAddressConfiguration( |
78 |
| - new CoreAddressConfiguration() |
79 |
| - .setName("DLQ") |
80 |
| - .addRoutingType(RoutingType.ANYCAST) |
81 |
| - .addQueueConfiguration( |
82 |
| - new CoreQueueConfiguration() |
83 |
| - .setName("DLQ") |
84 |
| - .setRoutingType(RoutingType.ANYCAST))); |
85 |
| - configuration.addAddressConfiguration( |
86 |
| - new CoreAddressConfiguration() |
87 |
| - .setName("ExpiryQueue") |
88 |
| - .addRoutingType(RoutingType.ANYCAST) |
89 |
| - .addQueueConfiguration( |
90 |
| - new CoreQueueConfiguration() |
91 |
| - .setName("ExpiryQueue") |
92 |
| - .setRoutingType(RoutingType.ANYCAST))); |
| 76 | + new AddressSettings() |
| 77 | + .setDeadLetterAddress(SimpleString.toSimpleString("DLQ")) |
| 78 | + .setExpiryAddress(SimpleString.toSimpleString("ExpiryQueue"))); |
93 | 79 | return configuration;
|
94 | 80 | }
|
95 | 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 | + |
96 | 89 | private String getDataDir() {
|
97 | 90 | if (this.properties.getDataDirectory() != null) {
|
98 | 91 | return this.properties.getDataDirectory();
|
|
0 commit comments