Skip to content

Commit

Permalink
Avoid reusing the same destination name for the sjms2 idempotency tests
Browse files Browse the repository at this point in the history
  • Loading branch information
orpiske authored and oscerd committed Feb 3, 2021
1 parent 3f1a3be commit cc371d7
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ public class CamelSinkIdempotentJMSITCase extends AbstractKafkaTest {
private static final Logger LOG = LoggerFactory.getLogger(CamelSinkIdempotentJMSITCase.class);

private String topic;
private String destinationName;
private int received;
private final int expect = 10;

Expand All @@ -84,6 +85,7 @@ public void setUp() {
LOG.info("JMS service running at {}", jmsService.defaultEndpoint());
received = 0;
topic = TestUtils.getDefaultTestTopic(this.getClass());
destinationName = SJMS2Common.DEFAULT_JMS_QUEUE + "-" + TestUtils.randomWithRange(0, 100);
}

private boolean checkRecord(Message jmsMessage) {
Expand Down Expand Up @@ -111,7 +113,7 @@ private void consumeJMSMessages() {
jmsClient = JMSClient.newClient(jmsService.defaultEndpoint());
jmsClient.start();

try (MessageConsumer consumer = jmsClient.createConsumer(SJMS2Common.DEFAULT_JMS_QUEUE)) {
try (MessageConsumer consumer = jmsClient.createConsumer(destinationName)) {
// number of retries until stale
int retries = 10;

Expand Down Expand Up @@ -176,7 +178,7 @@ public void testIdempotentBodySendReceive() {
.basic()
.withTopics(topic)
.withConnectionProperties(connectionProperties())
.withDestinationName(SJMS2Common.DEFAULT_JMS_QUEUE)
.withDestinationName(destinationName)
.withIdempotency()
.withRepositoryType("memory")
.withExpressionType("body")
Expand Down

0 comments on commit cc371d7

Please sign in to comment.