# Retry is not working for activity in child workflow

**URL:** https://community.temporal.io/t/retry-is-not-working-for-activity-in-child-workflow/10884
**Category:** Community Support
**Tags:** java-sdk, activity
**Created:** [February 2, 2024, 6:46am UTC](https://community.temporal.io/t/retry-is-not-working-for-activity-in-child-workflow/10884 "2024-02-02T06:46:51Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Raushan\_Kumar](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/raushan_kumar/32/4008_2.png) [@Raushan\_Kumar](https://community.temporal.io/u/Raushan_Kumar)
#### Post date: [February 2, 2024, 6:46am UTC](https://community.temporal.io/t/retry-is-not-working-for-activity-in-child-workflow/10884/1 "2024-02-02T06:46:52Z")

</div>

In Cadence, I am using the activity inside Async.func. In an activity, i am throwing exception when i am not getting the desired result so that it should retry. Inside the workflow, I have defined my activity as

```auto
private final Activity1 activity1 = Workflow.newActivityStub(Activity1.class, new ActivityOptions.Builder()
            .setScheduleToCloseTimeout(Duration.ofMinutes(30))
            .setRetryOptions(
                    new RetryOptions.Builder()
                            .setMaximumAttempts(3)
                            .setInitialInterval(Duration.ofSeconds(10))
                            .setMaximumInterval(Duration.ofSeconds(15))
                            .setExpiration(Duration.ofSeconds(60))
                            .build()).build());

```

And my activity code is :

```auto
@Override
    public Boolean methodB(Config config){
        try{
            return clientA.method(config);
        }catch(Exception e){
            log.error("Failed with exception!");
            throw e;
        }
    }

```

Inside the workflow, i am calling this activity method in Async like:

```auto
List<Promise<Boolean>> promises = new ArrayList<>();
for (Config config : Configs) {
                        Promise<Boolean> promise = Async.function(
                                () -> activity1.methodB(config)
                        );
                        promises.add(promise);
                    }
Workflow.await(() -> promises.stream().allMatch(Promise::isCompleted));

```

In cadence web, it is showing in pending state,

 ![Screenshot 2024-02-02 at 12.12.27 PM](https://us1.discourse-cdn.com/flex016/uploads/temporal/original/2X/a/a693bfcc6a520c9341b693a651c4b460a873af8e.png)  
But retry is not working. I am not getting why this is happening  
I also wants that if all the retry attempt failed then it should return false.
