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 Feb 4, 2022
1 parent 74f9274 commit a7416a3
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 a7416a3

Please sign in to comment.