String paramName = (String) paramNames.nextElement();
String paramValue = request.getParameter(paramName);
properties.setProperty(paramName, paramValue);
}
String taskName = request.getHeader(TASK_NAME_REQUEST_HEADER);
Task task = Task.fromProperties(taskName, properties);
task.getQueueSettings().setDelayInSeconds(null);
String queueName = request.getHeader(TASK_QUEUE_NAME_HEADER);
if (queueName != null && !queueName.isEmpty()) {
String onQueue = task.getQueueSettings().getOnQueue();
if (onQueue == null || onQueue.isEmpty()) {
task.getQueueSettings().setOnQueue(queueName);
}
Map<String, Object> attributes = ApiProxy.getCurrentEnvironment().getAttributes();
attributes.put(TASK_QUEUE_NAME_HEADER, queueName);
}
return task;