0

I'm having trouble understanding why frontend tasks execute correctly but backend tasks are returning 405 error.

The following code:

queue.add(withUrl(url).taskName(taskName).method(Method.GET));

works without a hitch as it is being processed on the frontend. But when I address it towards the backend like so:

queue.add(withUrl(url).taskName(taskName).method(Method.GET).header("Host", BackendServiceFactory.getBackendService().getBackendAddress(backend)));

then it doesn't work. Is this not the correct way to send tasks to the backend? I relied on examples from this code lab. I do have the backends configured in backends.xml, so not sure what else I should be doing.

Any help would be greatly appreciated. Thanks!

klactose
  • 1,190
  • 2
  • 9
  • 26

1 Answers1

0

This is a silly error. The code above is totally fine. It turns out that the frontend and backends were out of sync in regards to the application version they were running. So if you see similar behavior, be sure to check that everything is running on the same version.

klactose
  • 1,190
  • 2
  • 9
  • 26