2
TaskOptions taskOptions = TaskOptions.Builder.withUrl("/mytask");
options.param("a", a);
options.param("b", b);
options.param("c", c);
options.param("d", d);
options.param("e", e);
options.param("f", f);
options.param("g", g);
options.param("a1", a1);
options.param("b1", b1);
options.param("c1", c1);
options.param("d1", d1);
options.param("e1", e1);
options.param("f1", f1);
options.param("g1", g1);

How many options params can I specify here? Is there an upper limit?

Milkmate
  • 111
  • 4

2 Answers2

2

I would imagine that there is a hard upper-limit at the maximum amount of memory allocated to your JVM instance, which may be anywhere between a few dozen to a few hundred MB.

Prior to hitting that limit, there may be platform/client specific limitations on the size, since you are basically constructing an HTTP GET or POST request (depending upon how you have set up your TaskOptions). The client that ultimately processes the request may have its own limits on size.

But even in the worst-case scenario you should be able to pass at least 2 KB worth of data using a GET format URL/request (regardless of whether it is distributed across many parameters or just one). That would be if App Engine inexplicably uses the same request processing code as Internet Explorer. I think it's very likely that the Google code can handle quite a bit more than that.

And why not just try it and see? Just write a loop that queues up increasingly long tasks until it eventually fails, and log out the size of the request that triggers the failure.

Community
  • 1
  • 1
aroth
  • 54,026
  • 20
  • 135
  • 176
0

The release notes for version 1.5.0 of the SDK say the following:

Task Queue payload limits have been increased. Queues support 100KB per task.

The QueueConstants class has a maxPushTaskSizeBytes() method which you can call to get the size.

The source code for QueueConstats.java confirms the limit to be 100k:

private static final int MAX_PUSH_TASK_SIZE_BYTES = 100 * (1 << 10);
Saxon Druce
  • 17,406
  • 5
  • 50
  • 71