-
1. Re: How to send to a different application root?
hilco Sep 3, 2012 4:25 PM (in response to hilco)I just discovered ClientMessageBusImpl#setApplicationRoot. Let's see if that helps.
-
2. Re: How to send to a different application root?
hilco Sep 3, 2012 5:37 PM (in response to hilco)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.
-
3. Re: How to send to a different application root?
csa Sep 3, 2012 8:24 PM (in response to hilco)Hi,
Yes you're on the right path. This is a new feature that didn't make it into the docs yet.
You should be able to configure the application root using a JavaScript variable (erraiBusApplicationRoot) either directly in your host page or using JSNI. Here's an example for errai-jaxrs:
https://docs.jboss.org/author/display/ERRAI/Errai+JAX-RS+Configuration
Note that for errai-bus the variable is called erraiBusApplicationRoot.
Cheers,
Christian
-
4. Re: How to send to a different application root?
hilco Sep 3, 2012 11:18 PM (in response to csa)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.
-
5. Re: How to send to a different application root?
csa Sep 4, 2012 12:33 PM (in response to hilco)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
-
6. Re: How to send to a different application root?
hilco Sep 4, 2012 1:01 PM (in response to csa)All right. Thanks for creating the issue in JIRA; I've added my vote. :-)