Skip to content

Conversation

@Quinn-With-Two-Ns
Copy link
Contributor

@Quinn-With-Two-Ns Quinn-With-Two-Ns commented Apr 30, 2025

Add a sample showing how to create a custom annotation to customize activity type.

@Quinn-With-Two-Ns Quinn-With-Two-Ns force-pushed the custom-annotation-sample branch from 87e57ae to fe24ae8 Compare June 25, 2025 22:06
@Quinn-With-Two-Ns Quinn-With-Two-Ns marked this pull request as ready for review June 25, 2025 22:11
public static class ActivityInboundCallsInterceptorAnnotation
extends io.temporal.common.interceptors.ActivityInboundCallsInterceptorBase {
private final ActivityInboundCallsInterceptor next;
private Set<Class<? extends Exception>> benignExceptionTypes = new HashSet<>();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pedantic, can ignore

Suggested change
private Set<Class<? extends Exception>> benignExceptionTypes = new HashSet<>();
private Set<Class<? extends Exception>> benignExceptionTypes = Collections.emptySet<>();

Comment on lines +90 to +92
if (benignExceptionTypes.isEmpty()) {
return next.execute(input);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (benignExceptionTypes.isEmpty()) {
return next.execute(input);
}

Pedantic, but probably no value in this extra code

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unsure if tests are needed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing really to show in the tests here

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to prove the interceptor code even works (and continues to). We have had issues in other SDK samples repos where our lack of tests have caused us to miss when someone broke something, and we only found out when a human user manually tried to run the sample again. But up to you, non-blocking.

@Quinn-With-Two-Ns Quinn-With-Two-Ns merged commit 38372fa into temporalio:main Jun 26, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants