Skip to content

Commit

Permalink
MODULE: Do not allow changing group-transaction-events
Browse files Browse the repository at this point in the history
  • Loading branch information
albertogpz committed Nov 5, 2021
1 parent 9251e71 commit bcf6e55
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,18 +113,9 @@ public ResultModel alterGatewaySender(@CliOption(key = CliStrings.ALTER_GATEWAYS
"alter-gateway-sender cannot be performed for --batch-time-interval values smaller then -1.");
}

if (groupTransactionEvents != null && groupTransactionEvents
&& !oldConfiguration.mustGroupTransactionEvents()) {
if (!oldConfiguration.isParallel() && (oldConfiguration.getDispatcherThreads() == null
|| Integer.parseInt(oldConfiguration.getDispatcherThreads()) > 1)) {
return ResultModel.createError(
"alter-gateway-sender cannot be performed for --group-transaction-events attribute if serial sender and dispatcher-threads is greater than 1.");
}

if (oldConfiguration.isEnableBatchConflation()) {
return ResultModel.createError(
"alter-gateway-sender cannot be performed for --group-transaction-events attribute if batch-conflation is enabled.");
}
if (groupTransactionEvents != null && groupTransactionEvents) {
return ResultModel.createError(
"alter-gateway-sender cannot be performed for --group-transaction-events attribute.");
}

Set<DistributedMember> dsMembers = findMembers(onGroup, onMember);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -460,14 +460,8 @@ public void testCreateParallelGatewaySenderAndChangeGroupTransaction() throws Ex
.containsOutput("sender1P");

gfsh.executeAndAssertThat("alter gateway-sender --id=sender1P --group-transaction-events=true")
.statusIsSuccess();

// verify that server1's event queue has the default value
server1.invoke(() -> {
InternalCache cache = ClusterStartupRule.getCache();
GatewaySender sender = cache.getGatewaySender("sender1P");
assertThat(sender.mustGroupTransactionEvents()).isTrue();
});
.statusIsError()
.containsOutput("alter-gateway-sender cannot be performed for --group-transaction-events");
}

public static class MyGatewayEventFilter implements GatewayEventFilter {
Expand Down

0 comments on commit bcf6e55

Please sign in to comment.