# Local activities aren't cancelled when I cancel the CancellationScope they are being called in

**URL:** <https://community.temporal.io/t/local-activities-arent-cancelled-when-i-cancel-the-cancellationscope-they-are-being-called-in/5274>\
**Category:** Community Support\
**Tags:** java-sdk, general-impl\
**Created:** [July 11, 2022, 8:06am UTC](https://community.temporal.io/t/local-activities-arent-cancelled-when-i-cancel-the-cancellationscope-they-are-being-called-in/5274 "2022-07-11T08:06:25Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![tihomir](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/tihomir/32/6580_2.png) [@tihomir](https://community.temporal.io/u/tihomir)\
**Post date:** [July 11, 2022, 2:17pm UTC](https://community.temporal.io/t/local-activities-arent-cancelled-when-i-cancel-the-cancellationscope-they-are-being-called-in/5274/3 "2022-07-11T14:17:32Z")

</div>

Cancellation of local activities is currently not possible via Java SDK. This is something that will be added in the future.

This is because cancellation is delivered through heartbeats (see sample [here](https://github.com/temporalio/samples-java/blob/main/src/main/java/io/temporal/samples/hello/HelloCancellationScope.java)) and local activities do not support heartbeating (more info in [this](https://community.temporal.io/t/local-activity-vs-activity/290/3) post).

For your use case you would need to use regular activities and make sure they heartbeat to receive cancellation request.

---

_[View the full topic](https://community.temporal.io/t/local-activities-arent-cancelled-when-i-cancel-the-cancellationscope-they-are-being-called-in/5274)._
