Skip to content

Commit c73064d

Browse files
authored
fix(java): Fix variable mismatch: ctx vs context (#1024)
There were two snippets that were not consistent in the naming of their context variable. In one case, `ctx` did not exist, in the other, `context` did not exist.
1 parent c54e7f6 commit c73064d

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

java/messaging.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,7 @@ The following example demonstrates how the error handler can be used to catch me
635635

636636
```java
637637
@On(service = "messaging")
638-
private void handleError(MessagingErrorEventContext context) {
638+
private void handleError(MessagingErrorEventContext ctx) {
639639
640640
String errorCode = ctx.getException().getErrorStatus().getCodeString();
641641
if (errorCode.equals(CdsErrorStatuses.NO_ON_HANDLER.getCodeString()) ||
@@ -646,9 +646,9 @@ private void handleError(MessagingErrorEventContext context) {
646646
// error handling for application errors
647647
648648
// how to access the event context of the raised exception:
649-
// context.getException().getEventContexts().stream().findFirst().ifPresent(e -> {
650-
// String event = e.getEvent());
651-
// String payload = e.get("data"));
649+
// ctx.getException().getEventContexts().stream().findFirst().ifPresent(e -> {
650+
// String event = e.getEvent());
651+
// String payload = e.get("data"));
652652
// });
653653
654654
ctx.setResult(true); // acknowledge

java/outbox.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ void processMyEvent(OutboxMessageEventContext context) {
210210

211211
// Perform processing logic for myEvent
212212

213-
ctx.setCompleted();
213+
context.setCompleted();
214214
}
215215
```
216216

0 commit comments

Comments
 (0)