Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

Use GetMatchingJob with an AWS SDK - AWS SDK Code Examples

There are more AWS SDK examples available in the AWS Doc SDK Examples GitHub repo.

There are more AWS SDK examples available in the AWS Doc SDK Examples GitHub repo.

Use GetMatchingJob with an AWS SDK

The following code example shows how to use GetMatchingJob.

Java
SDK for Java 2.x
Note

There's more on GitHub. Find the complete example and learn how to set up and run in the AWS Code Examples Repository.

/** * Asynchronously retrieves a matching job based on the provided job ID and workflow name. * * @param jobId the ID of the job to retrieve * @param workflowName the name of the workflow associated with the job * @return a {@link CompletableFuture} that completes when the job information is available or an exception occurs */ public CompletableFuture<GetMatchingJobResponse> getMatchingJobAsync(String jobId, String workflowName) { GetMatchingJobRequest request = GetMatchingJobRequest.builder() .jobId(jobId) .workflowName(workflowName) .build(); return getResolutionAsyncClient().getMatchingJob(request) .whenComplete((response, exception) -> { if (response != null) { // Successfully fetched the matching job details, log the job status. logger.info("Job status: " + response.status()); logger.info("Job details: " + response.toString()); } else { if (exception == null) { throw new CompletionException("An unknown error occurred while fetching the matching job.", null); } Throwable cause = exception.getCause(); if (cause instanceof ResourceNotFoundException) { throw new CompletionException("The requested job could not be found.", cause); } // Wrap other exceptions in a CompletionException with the message. throw new CompletionException("Error fetching matching job: " + exception.getMessage(), exception); } }); }
  • For API details, see GetMatchingJob in AWS SDK for Java 2.x API Reference.

SDK for Java 2.x
Note

There's more on GitHub. Find the complete example and learn how to set up and run in the AWS Code Examples Repository.

/** * Asynchronously retrieves a matching job based on the provided job ID and workflow name. * * @param jobId the ID of the job to retrieve * @param workflowName the name of the workflow associated with the job * @return a {@link CompletableFuture} that completes when the job information is available or an exception occurs */ public CompletableFuture<GetMatchingJobResponse> getMatchingJobAsync(String jobId, String workflowName) { GetMatchingJobRequest request = GetMatchingJobRequest.builder() .jobId(jobId) .workflowName(workflowName) .build(); return getResolutionAsyncClient().getMatchingJob(request) .whenComplete((response, exception) -> { if (response != null) { // Successfully fetched the matching job details, log the job status. logger.info("Job status: " + response.status()); logger.info("Job details: " + response.toString()); } else { if (exception == null) { throw new CompletionException("An unknown error occurred while fetching the matching job.", null); } Throwable cause = exception.getCause(); if (cause instanceof ResourceNotFoundException) { throw new CompletionException("The requested job could not be found.", cause); } // Wrap other exceptions in a CompletionException with the message. throw new CompletionException("Error fetching matching job: " + exception.getMessage(), exception); } }); }
  • For API details, see GetMatchingJob in AWS SDK for Java 2.x API Reference.

PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.