LrSqsClient.resetQueueUrl

Replaces the current queue URL with a new URL.

public static void resetQueueUrl(String newQueueUrl)

Arguments

NameDescription
newQueueUrlNew URL of the message queue.

Return values

This function does not return any values.

General information

This API replaces the queue URL with the new provided string.

Example

Copy code
public void changeQueue() {

  String standardQueueUrl = "https://sqs.eu-central-1.amazonaws.com/123456789/jsmith-sqs0";
  String fifoQueueUrl = "https://sqs.eu-central-1.amazonaws.com/123456789/jsmith-sqsfifo0.fifo";
  LrAwsRegion region = LrAwsRegion.EU_CENTRAL_1;
        
  LrSqsClient.initClient(region, ""); // unused queueUrl
        
  for (String queueUrl : new ArrayList<String>() {{ add(standardQueueUrl); add(fifoQueueUrl); }}) {
        
  LrSqsClient.resetQueueUrl(queueUrl);
                
   if (queueUrl.equals(standardQueueUrl)) 
            LrSqsClient.sendMessage("abc");
   else 
            LrSqsClient.sendMessage("abc", "a", "aaaa");
                
    }
            
    LrSqsClient.closeClient();    
}