Search in sources :

Example 1 with WorkflowServiceTChannel

use of com.uber.cadence.serviceclient.WorkflowServiceTChannel in project cadence-client by uber-java.

the class WorkerFactoryTests method setUp.

@Before
public void setUp() {
    service = new WorkflowServiceTChannel(ClientOptions.defaultInstance());
    client = WorkflowClient.newInstance(service);
    factory = WorkerFactory.newInstance(client);
}
Also used : WorkflowServiceTChannel(com.uber.cadence.serviceclient.WorkflowServiceTChannel) Before(org.junit.Before)

Example 2 with WorkflowServiceTChannel

use of com.uber.cadence.serviceclient.WorkflowServiceTChannel in project cadence-client by uber-java.

the class RegisterTestDomain method main.

public static void main(String[] args) throws InterruptedException {
    if (!useDockerService) {
        return;
    }
    IWorkflowService service = new WorkflowServiceTChannel(ClientOptions.defaultInstance());
    RegisterDomainRequest request = new RegisterDomainRequest().setName(DOMAIN).setWorkflowExecutionRetentionPeriodInDays(1);
    while (true) {
        try {
            service.RegisterDomain(request);
            break;
        } catch (DomainAlreadyExistsError e) {
            break;
        } catch (TException e) {
            String message = e.getMessage();
            if (message != null && !message.contains("Failed to connect to the host") && !message.contains("Connection timeout on identification")) {
                e.printStackTrace();
            }
            Thread.sleep(500);
            continue;
        } catch (Throwable e) {
            e.printStackTrace();
            System.exit(1);
        }
    }
    System.exit(0);
}
Also used : TException(org.apache.thrift.TException) IWorkflowService(com.uber.cadence.serviceclient.IWorkflowService) WorkflowServiceTChannel(com.uber.cadence.serviceclient.WorkflowServiceTChannel)

Aggregations

WorkflowServiceTChannel (com.uber.cadence.serviceclient.WorkflowServiceTChannel)2 IWorkflowService (com.uber.cadence.serviceclient.IWorkflowService)1 TException (org.apache.thrift.TException)1 Before (org.junit.Before)1