我尝试了以下方法将 TaskQueue 传递给后端,但没有奏效。
这种语法有问题吗?
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);
}
后端.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>