Pass multiple parameters in the App Engine task queue (Java)

Is there any way to pass multiple parameters in the Google App Engine queue?

Queue queue = QueueFactory.getQueue("sms-queue");
queue.add(TaskOptions.Builder.url("/SQ").param("id",pId));

In my servlet, this ID is a query string

long pID = Long.parseLong(req.getParameter("id"));

I need to pass six parameters

Solution

Have you ever tried this:

queue.add(TaskOptions.Builder
    .url("/SQ")
    .param("p1Name",p1Value)
    .param("p2Name",p2Value)
    .param("p3Name",p3Value)
    // etc
);
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>