buddycloud / buddycloud-server-java

The buddycloud server written in Java.
http://buddycloud.com
Apache License 2.0
67 stars 40 forks source link

Don't perform look up until we've checked the subscriptions table #155

Open lloydwatkin opened 10 years ago

lloydwatkin commented 10 years ago

Every time we want to discover a remote server we perform a DISCO look up (or DNS fallback). However, we (probably) already know a user's home channel server as it'll be in our database (listener in the subscriptions table). So why not use this instead?

This does mean that the user won't be able to change the domain of their channel server but this is already an issue due to the way the listener is setup up.

What I'd suggest is we switch to checking database first in the short term, but longer term look at moving away from the listener field in the subscriptions table and determine if the user is remote by comparing the domain on their JID.

@imaginator, @abmargb what do you think about this?

imaginator commented 10 years ago

We should probably think about our timeouts carefully. That said, we could always use a connection failure to also invalidate an entry and then reinitiate the lookup.

What timeout do you propose for expiring the local version?