This repository has been archived by the owner on May 26, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SCTP-279: Enabling ability to browse and delete messages across multi…
…ple artemis brokers. System property ARTEMIS_URI takes a comma separated list of broker host values.
- Loading branch information
Mahesh Subramanian
committed
May 14, 2019
1 parent
371cdee
commit 0a282fd
Showing
5 changed files
with
140 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 12 additions & 4 deletions
16
...ore/src/main/java/uk/gov/justice/services/test/utils/core/messaging/QueueUriProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,41 @@ | ||
package uk.gov.justice.services.test.utils.core.messaging; | ||
|
||
import static com.google.common.base.Splitter.on; | ||
import static com.google.common.collect.Lists.newArrayList; | ||
import static java.lang.String.format; | ||
import static uk.gov.justice.services.test.utils.common.host.TestHostProvider.getArtemisHost; | ||
import static uk.gov.justice.services.test.utils.common.host.TestHostProvider.getHost; | ||
|
||
import java.util.List; | ||
|
||
import org.apache.commons.lang3.StringUtils; | ||
|
||
public class QueueUriProvider { | ||
|
||
private static final String BASE_URI_PATTERN = "tcp://%s:61616"; | ||
|
||
/** | ||
* Takes a comma separated list of broker hosts | ||
*/ | ||
private static final String ARTEMIS_URI = "ARTEMIS_URI"; | ||
|
||
public String getQueueUri() { | ||
return format(BASE_URI_PATTERN, getHost()); | ||
} | ||
|
||
public String getArtemisQueueUri() { | ||
public List<String> getArtemisQueueUri() { | ||
final String artemisUri = System.getProperty(ARTEMIS_URI); | ||
if (StringUtils.isNotBlank(artemisUri)) { | ||
return artemisUri; | ||
return on(",").splitToList(artemisUri); | ||
} | ||
return format(BASE_URI_PATTERN, getArtemisHost()); | ||
return newArrayList(format(BASE_URI_PATTERN, getArtemisHost())); | ||
} | ||
|
||
public static String queueUri() { | ||
return new QueueUriProvider().getQueueUri(); | ||
} | ||
|
||
public static String artemisQueueUri(){ | ||
public static List<String> artemisQueueUri() { | ||
return new QueueUriProvider().getArtemisQueueUri(); | ||
} | ||
} |
Oops, something went wrong.