Can't register activity implementation that uses inheritance

Consider the following:

@ActivityInterface
public interface BlockListenerActivities {
     @ActivityMethod
     Optional<BlockRef> processNextBlock();
}

@Slf4j
public abstract class BaseBlockListenerActivities implements BlockListenerActivities {
    @Override
    public final Optional<BlockRef> processNextBlock() {
        return doProcessNextBlock();
    }

    abstract protected Optional<BlockRef> doProcessNextBlock();
}

@Slf4j
public class BlockListenerActivitiesImpl extends BaseBlockListenerActivities {
    @Override
    protected Optional<BlockRef> doProcessNextBlock() {
        log.info("Processing next ETH block");
        return Optional.empty();
    }
}

Then, registering the activity implementation (worker.registerActivitiesImplementations(new BlockListenerActivitiesImpl());) will cause the exception Class doesn't implement any non empty interface annotated with @ActivityInterface: BlockListenerActivitiesImpl.

It seems that that SDK expects BlockListenerActivitiesImpl to explicitly say implements BlockListenerActivities. Is this expected? The fix for this maybe trivial in POJOActivityImplMetadata but I am not sure if this enforced because of some constraint.

The reason I ran into this is because I was provided a “quarkus” injected bean that automatically extends the activity implementation class to form a proxy like ActivityImpl_ClientProxy extends ActivityImpl and temporal SDK rejects ActivityImpl_ClientProxy as a valid activity implementation.

Looks like a bug to me. Would you file an issue against the Java SDK?

Thanks… issue raised @ Can't register activity implementation that uses inheritance · Issue #929 · temporalio/sdk-java · GitHub