Java Azure存储-未请求容器列表

Java Azure存储-未请求容器列表,java,azure,azure-storage,azure-storage-blobs,vert.x,Java,Azure,Azure Storage,Azure Storage Blobs,Vert.x,我正在尝试从两个不同的类(测试类和服务类)发出以下请求- 测试课程结果: 请求得到了应有的执行,我正在获取Azure存储帐户中容器的名称。使用Wireshark提出并验证请求 服务类结果: 未从此类发出请求,请选中此复选框 使用Wireshark 线程被阻塞,并且没有引发异常,或者在写入日志的任何日志文件中都没有发生其他错误 注意: 服务类以jar的形式出现,并在另一个应用程序中作为Vertx垂直体部署 代码详细信息:此函数仅返回ServiceURL对象。此方法是从同一类中的另一个onReq

我正在尝试从两个不同的类(测试类和服务类)发出以下请求-

测试课程结果:

请求得到了应有的执行,我正在获取Azure存储帐户中容器的名称。使用Wireshark提出并验证请求

服务类结果:

  • 未从此类发出请求,请选中此复选框 使用Wireshark
  • 线程被阻塞,并且没有引发异常,或者在写入日志的任何日志文件中都没有发生其他错误
注意: 服务类以jar的形式出现,并在另一个应用程序中作为Vertx垂直体部署

代码详细信息:此函数仅返回ServiceURL对象。此方法是从同一类中的另一个onRequest方法(进一步提及)调用的

 * Create Service URL
 * @param storageAccountName
 * @param storageAccountKey
 * @param endpointUrl
 * @return
 * @throws InvalidKeyException
 * @throws MalformedURLException
 */
private ServiceURL createServiceUrl(String storageAccountName, String storageAccountKey, String endpointUrl, String endpointProtocol) throws InvalidKeyException, MalformedURLException {
    ServiceURL serviceURL = null;
    try {
        FlintLogger.JOB_LOGGER.info("createServiceUrl | Creating Service URL");
        FlintLogger.JOB_LOGGER.debug("createServiceUrl | Creating Service URL with inputs: \n"+storageAccountName+"\n"+storageAccountKey+"\n"+endpointUrl+"\n"+endpointProtocol);

        // Use your Storage account's name and key to create a credential object; this is used to access your account.
        SharedKeyCredentials credential = new SharedKeyCredentials(storageAccountName, storageAccountKey);
        FlintLogger.JOB_LOGGER.info("createServiceUrl | Storage credentials created "+credential.toString());

        /*
            Create a request pipeline that is used to process HTTP(S) requests and responses. It requires your accont
            credentials. In more advanced scenarios, you can configure telemetry, retry policies, logging, and other
            options. Also you can configure multiple pipelines for different scenarios.
         */
        HttpPipeline pipeline = StorageURL.createPipeline(credential, new PipelineOptions());
        FlintLogger.JOB_LOGGER.info("createServiceUrl | Created Http pipeline "+pipeline);

        /*
            From the Azure portal, get your Storage account blob service URL endpoint.
            The URL typically looks like this:
         */
        URL url = new URL(String.format(Locale.ROOT, endpointProtocol+"://%s.blob."+endpointUrl, storageAccountName));
        FlintLogger.JOB_LOGGER.debug("createServiceUrl | Created Url with specified endpoint "+url.toString());

        // Create a ServiceURL object that wraps the service URL and a request pipeline.
        serviceURL = new ServiceURL(url, pipeline);
        FlintLogger.JOB_LOGGER.debug("createServiceUrl | ServiceUrl structure: "+serviceURL.toURL().toString());


        FlintLogger.JOB_LOGGER.info("createServiceUrl | Created service URL");

    }catch(Exception e) {
        FlintLogger.JOB_LOGGER.error("createServiceUrl | Exception: ",e.getMessage());
    }
    return serviceURL;
}
onRequest方法:

 * Create Service URL
 * @param storageAccountName
 * @param storageAccountKey
 * @param endpointUrl
 * @return
 * @throws InvalidKeyException
 * @throws MalformedURLException
 */
private ServiceURL createServiceUrl(String storageAccountName, String storageAccountKey, String endpointUrl, String endpointProtocol) throws InvalidKeyException, MalformedURLException {
    ServiceURL serviceURL = null;
    try {
        FlintLogger.JOB_LOGGER.info("createServiceUrl | Creating Service URL");
        FlintLogger.JOB_LOGGER.debug("createServiceUrl | Creating Service URL with inputs: \n"+storageAccountName+"\n"+storageAccountKey+"\n"+endpointUrl+"\n"+endpointProtocol);

        // Use your Storage account's name and key to create a credential object; this is used to access your account.
        SharedKeyCredentials credential = new SharedKeyCredentials(storageAccountName, storageAccountKey);
        FlintLogger.JOB_LOGGER.info("createServiceUrl | Storage credentials created "+credential.toString());

        /*
            Create a request pipeline that is used to process HTTP(S) requests and responses. It requires your accont
            credentials. In more advanced scenarios, you can configure telemetry, retry policies, logging, and other
            options. Also you can configure multiple pipelines for different scenarios.
         */
        HttpPipeline pipeline = StorageURL.createPipeline(credential, new PipelineOptions());
        FlintLogger.JOB_LOGGER.info("createServiceUrl | Created Http pipeline "+pipeline);

        /*
            From the Azure portal, get your Storage account blob service URL endpoint.
            The URL typically looks like this:
         */
        URL url = new URL(String.format(Locale.ROOT, endpointProtocol+"://%s.blob."+endpointUrl, storageAccountName));
        FlintLogger.JOB_LOGGER.debug("createServiceUrl | Created Url with specified endpoint "+url.toString());

        // Create a ServiceURL object that wraps the service URL and a request pipeline.
        serviceURL = new ServiceURL(url, pipeline);
        FlintLogger.JOB_LOGGER.debug("createServiceUrl | ServiceUrl structure: "+serviceURL.toURL().toString());


        FlintLogger.JOB_LOGGER.info("createServiceUrl | Created service URL");

    }catch(Exception e) {
        FlintLogger.JOB_LOGGER.error("createServiceUrl | Exception: ",e.getMessage());
    }
    return serviceURL;
}
try {
            // Create Service URL
            ServiceURL serviceUrl = createServiceUrl(storageAccountName, storageAccountKey, endpointUrl, endpointProtocol);
            FlintLogger.JOB_LOGGER.debug("onRequest | serviceUrl "+serviceUrl.toURL());
            FlintLogger.JOB_LOGGER.debug("onRequest | serviceUrl Before request"+serviceUrl.toURL());

            try {
            serviceUrl.listContainersSegment(null, new ListContainersOptions()).blockingGet().body().containerItems().forEach(container -> {
                FlintLogger.JOB_LOGGER.debug("onRequest | Blocking get : "+container.name());
            });
            }catch(Exception e) {
                FlintLogger.JOB_LOGGER.error("Error in thread blocking request ", e.getLocalizedMessage());
            }