简体   繁体   中英

What's wrong with this syntax for passing an App Engine TaskQueue to a Backend?

I tried the following to pass a TaskQueue to a Backend but it didn't work.

Is there a problem with this syntax?

try{
    Queue queue = QueueFactory.getQueue("pine");
    TaskOptions options = TaskOptions.Builder.withUrl("/pine/task/getbusy");

    options = options.param("taskparams", params);
    options = options.header("Host",
    BackendServiceFactory.getBackendService().getBackendAddress("pinetask", 1));

    queue.add(options);
}

backend.xml:

<backends>
  <backend name="pinetask">
    <class>B2</class>
    <instances>1</instances>
    <max-concurrent-requests>1</max-concurrent-requests>
    <options>
      <public>false</public>
      <dynamic>true</dynamic>
    </options>
  </backend>
</backends>

Because Instances 1 mean index 0?

try this for the "Host" header:

options = options.header("Host", BackendServiceFactory.getBackendService().getBackendAddress("pinetask"));

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM