Registering Domains - AWS SDK for Java 1.x

We announced the upcoming end-of-support for AWS SDK for Java (v1). We recommend that you migrate to AWS SDK for Java v2. For dates, additional details, and information on how to migrate, please refer to the linked announcement.

Registering Domains

Every workflow and activity in Amazon SWF needs a domain to run in.

  1. Create a new RegisterDomainRequest object, providing it with at least the domain name and workflow execution retention period (these parameters are both required).

  2. Call the AmazonSimpleWorkflowClient.registerDomain method with the RegisterDomainRequest object.

  3. Catch the DomainAlreadyExistsException if the domain you’re requesting already exists (in which case, no action is usually required).

The following code demonstrates this procedure:

public void register_swf_domain(AmazonSimpleWorkflowClient swf, String name) { RegisterDomainRequest request = new RegisterDomainRequest().withName(name); request.setWorkflowExecutionRetentionPeriodInDays("10"); try { swf.registerDomain(request); } catch (DomainAlreadyExistsException e) { System.out.println("Domain already exists!"); } }