I just discovered ClientMessageBusImpl#setApplicationRoot. Let's see if that helps.
So not really.
If I add setApplicationRoot to MainEntryPoint's constructor (or even its static initialization block) then the test message I try to send myself (from MainEntryPoint) is aimed at /backend but the very first (ConnectToQueue) still goes to /frontend.
How can I set the application root? Is that even the right approach? Any help would be appreciated.
Yes you're on the right path. This is a new feature that didn't make it into the docs yet.
Note that for errai-bus the variable is called erraiBusApplicationRoot.
The JSNI approach didn't work (i.e. it gave the same behaviour as using ClientMessageBusImpl#setApplicationRoot) so I guess it is invoked too late. Setting erraiBusApplicationRoot directly in the index.html does indeed work. Woohoo! :-)
Is there a way to use the JSNI approach (or better yet use ClientMessageBusImpl#setApplicationRoot)? I mean, how do I call it earlier? I would prefer not touching the index.html for this.
Right now the host page is your only reliable option. I have created a JIRA to fix this so that setting the app root programmatically before the bus starts becomes possible: https://issues.jboss.org/browse/ERRAI-380
All right. Thanks for creating the issue in JIRA; I've added my vote. :-)