public static HttpURLConnection retrieveMessages ( final URI uri , final QueueRequestOptions queueOptions , final OperationContext opContext , final int numberOfMessages , final int visibilityTimeoutInSeconds ) throws URISyntaxException , IOException , StorageException { final UriQueryBuilder builder = new UriQueryBuilder ( ) ; if ( numberOfMessages != 0 ) { builder . add ( NUMBER_OF_MESSAGES , Integer . toString ( numberOfMessages ) ) ; } builder . add ( VISIBILITY_TIMEOUT , Integer . toString ( visibilityTimeoutInSeconds ) ) ; final HttpURLConnection request = BaseRequest . createURLConnection ( uri , queueOptions , builder , opContext ) ; request . setRequestMethod ( "GET" ) ; return request ; }
Constructs a web request to retrieve messages from the front of the queue . Sign the web request with a length of - 1L .