# Retry configuration for Activity from external source

**URL:** <https://community.temporal.io/t/retry-configuration-for-activity-from-external-source/2163>\
**Category:** Community Support\
**Tags:** java-sdk\
**Created:** [May 18, 2021, 8:41am UTC](https://community.temporal.io/t/retry-configuration-for-activity-from-external-source/2163 "2021-05-18T08:41:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Faizan\_Kamal](https://avatars.discourse-cdn.com/v4/letter/f/dfb087/32.png) [@Faizan\_Kamal](https://community.temporal.io/u/Faizan_Kamal)\
**Post date:** [May 18, 2021, 8:41am UTC](https://community.temporal.io/t/retry-configuration-for-activity-from-external-source/2163/1 "2021-05-18T08:41:19Z")

</div>

I have a spring application where i have the logic for creating workflows and running them to external temporal server.

I wanted to set retry configurations like maxRetry for an Activity dynamically, i.e, from my application database. I tried to use my custom class inside workflow implementation file and set the values. But it was null.

Can someone help me on how to achieve this. Thanks

---

<div class="post-metadata">

**Author:** ![maxim](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/maxim/32/8_2.png) [@maxim](https://community.temporal.io/u/maxim)\
**Post date:** [May 18, 2021, 2:43pm UTC](https://community.temporal.io/t/retry-configuration-for-activity-from-external-source/2163/2 "2021-05-18T14:43:12Z")

</div>

You can use the not yet released feature of setting `ActivityOptions` when initializing a worker:

```java
WorkflowImplementationOptions options = WorkflowImplementationOptions.newBuilder().
                  .setDefaultActivityOptions(defaultOps)
                  .setActivityOptions(perActivityOptions)
                  .build();
worker.registerWorkflowImplementationType(implementationOptions, <WorkflowClass>.class);

```

Until the feature is released you can use ‘1.0.7-SNAPSHOT’ version of the temporal SDK. It also requires [adding the snapshot repository](https://github.com/temporalio/samples-java/blob/19f5b83207a22d3650e1b4cee4d9d0cb85d27ddb/build.gradle#L27) to your build configuration file.
