all.
This my code for creating workflow:
return $workflowClient->newWorkflowStub(
static::class,
WorkflowOptions::new()
->withTaskQueue(config()->get('workflow.taskQueue'))
->withRetryOptions(
RetryOptions::new()
->withNonRetryableExceptions([NonRetryableActivityException::class])
->withInitialInterval(CarbonInterval::seconds((int) env('WORKFLOW_RETRY_INITIAL_INTERVAL_SECONDS', 1)))
->withMaximumAttempts((int) env('WORKFLOW_RETRY_MAXIMUM_ATTEMPTS', 3))
)
->withSearchAttributes($customSearchAttributes)
And my activity code:
#[ReturnType(Type::TYPE_STRING)]
#[ActivityMethod(name: '.executeWebHook')]
public function executeWebHook(string $path, array $entityData): string
{
$response = Http::withHeaders([
'Content-Type' => 'application/vnd.api+json',
])->post($path, $entityData);
if (in_array($response->status(), [
SymfonyResponse::HTTP_BAD_REQUEST,
SymfonyResponse::HTTP_UNPROCESSABLE_ENTITY,
SymfonyResponse::HTTP_NOT_FOUND,
], true)
) {
throw new ApplicationFailure(
$response->body(),
NonRetryableActivityException::class,
true
);
}
return $response->body();
}
But, my activity retrying and ignoring NonRetryableActivityException::class type