Closed ousenko closed 7 years ago
I'm looking now.
Commented are the lines that worked like charm in 0.8.4 of lib. More - nothing worked if I didn't specify these hosts in 0.8.4 manually.
The 1.0 spec includes a ClientOptions.environment
field, which you should use if you want to override the default hosts. Pre-1.0 libraries all did something slightly different, and the behaviour you were relying on - that the realtimeHost
and restHost
would be pre-populated - was undocumented behaviour specific to the older version of the java library only.
So now you would just set
options.environment = "MY_SECRET_APP-";
We don't document this option in the main documentation because users are not generally expected to use custom environments, but this is speciifed in the library specification; see https://docs.ably.io/client-lib-development-guide/features/#RSC11 for details.
So now you would just set options.environment = "MY_SECRET_APP-";
Please note that would actually be options.environment = "MY_SECRET_APP"
as that would then result in the rest host changing to MY_SECRET_APP-rest.ably.io
and realtime to MY_SECRET_APP-realtime.ably.io
. i.e. you don't need the trailing hyphen
@paddybyers @mattheworiordan right now I'm using explicit MY_SECRET_APP-rest.ably.io
, seems to be working approach, too
I'm using explicit MY_SECRET_APP-rest.ably.io , seems to be working approach, too
You mean as a host? I would recommend you use environment
to be honest, but explicitly setting the restHost
and realtimeHost
does work.
Mind if I ask what environment you are using? You an email us at support@ably.io if you don't want to publish here.
Mailed
Dear Ably staff,
In this issue you suggested I update to 1.0
I did. And it broke everything :-)
My code for initializing ART is and was:
Commented are the lines that worked like charm in 0.8.4 of lib. More - nothing worked if I didn't specify these hosts in 0.8.4 manually.
Now these lines useless, because in 1.0
options.restHost
andoptions.realtimeHost
arenull
by default. In 0.8.4 I spied them to berealtime.ably.io
andrest.ably.io
by default - and it required me to specify "MY_SECRET_APP-" prefix for these hostsNow with the lines above I get:
If I revert to 0.8.4 and uncomment lines everything works
Guys, taking into consideration this and this, - could you hint me on ways to resolve that issue, and provide any ETAs on fixing these issues ?
For now I decided to manually specify these hosts, but I feel this is a very temporary approach and that design, distribution and documentation problems of Ably Java lib should be taken care of.
@mattheworiordan @paddybyers @SimonWoolf