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!