Manual Entry into the routing table?

I have a ejabberd setup to which I have a custom component connected. The cluster component handles a domain (domain.com) which basically has only 2 buddies - user1@domain.com, and user2@domain.com.

I want to connect 2 instances of the component, such that a particular user is always connected to a particular component. Something like {domain_balancing, bare_destination}, but there is a difference.

These components need to run on different machines (machine1 and machine 2), and i need to be sure that user1 always goes to machine1, and user2 always to machine2. These need to happen because the service (user1@domain.com) is tied to a HTTP server on that machine.

Is it possible?

Just an idea

So you currently have this?

{listen,
 [
  ...
  {5231, ejabberd_service, [{hosts, ["domain.com"], [{password, "somesecret"}]}]},
  ...
 ]
}.

The only idea that I can think is the Access option, but I don't know if it will work at all:

{acl, user1, {user, "user1", "domain.com"}}.
{acl, user2, {user, "user2", "domain.com"}}.

{access, onlyuser1, [{allow, user1}, {deny, all}]}.
{access, onlyuser2, [{allow, user2}, {deny, all}]}.

{listen,
 [
  ...
  {5231, ejabberd_service, [{access, onlyuser1}, {hosts, ["domain.com"], [{password, "somesecret"}]}]},
  {5232, ejabberd_service, [{access, onlyuser2}, {hosts, ["domain.com"], [{password, "somesecret"}]}]},
  ...
 ]
}.

Thanks for your reply - let

Thanks for your reply - let me try it and see if it works.

access can be on the "to" id - i though acls were for "from" id.

This doesn't work. Basically,

This doesn't work. Basically, I looked at the erl code, and the access control is happening inside the ejabberd_service and is based on the "from" attribute, and not on the "to" attribute.

Also, on failure, it returns an error "405 not allowed" instead of seeing if there is anything else to route to.

Any other ideas.

Syndicate content