use of com.google.cloud.tasks.v2.UpdateQueueRequest in project java-docs-samples by GoogleCloudPlatform.
the class UpdateQueue method updateQueue.
public static void updateQueue(String projectId, String locationId, String queueId) throws Exception {
try (CloudTasksClient client = CloudTasksClient.create()) {
// TODO(developer): Uncomment these lines and replace with your values.
// String projectId = "your-project-id";
// String locationId = "us-central1";
// String queueId = "queue-blue";
LocationName parent = LocationName.of(projectId, locationId);
Queue queueBlue = Queue.newBuilder().setName(QueueName.of(projectId, locationId, queueId).toString()).setRateLimits(RateLimits.newBuilder().setMaxDispatchesPerSecond(20.0).setMaxConcurrentDispatches(10)).build();
UpdateQueueRequest request = UpdateQueueRequest.newBuilder().setQueue(queueBlue).build();
Queue response = client.updateQueue(request);
System.out.println(response);
}
}
Aggregations