Silot
Silot

Reputation: 1

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>

Upvotes: 0

Views: 429

Answers (2)

Rafael Sanches
Rafael Sanches

Reputation: 1823

try this for the "Host" header:

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

Upvotes: 0

Thaina
Thaina

Reputation: 21

Because Instances 1 mean index 0 ?

Upvotes: 2

Related Questions