{"action":"closed","issue":{"number":62,"created_at":"2011-10-17T15:50:20Z","pull_request":{"diff_url":null,"patch_url":null,"html_url":null},"body":"Scope of Change\n====\nThe ability to pass a list of servers to the Remote API will be added.\n\n\nRationale\n====\nLoad balancing and failover.\n\n\nFunctionality\n====\n\nCurrent\n----\nThe suggested functionality can be implemented currently as follows:\n\n```php\n<?php\n  $remotespecs= array('xp://jboss01.example.com/', 'xp://jboss02.example.com/');\n  shuffle($remotespecs);\n  foreach ($remotespecs as $remotespec) {\n    try(); {\n      $remote= &Remote::forName($remotespec);\n    } if (catch('RemoteException', $e)) {\n      continue;\n    }\n\n    $e= NULL;\n    break;\n  }\n  \n  if ($e) {\n    $e->printStackTrace();\n    exit(1);\n  }\n  \n  $home= &$remote->lookup('xp/demo/IteratorDemo');\n?>\n```\n\n\nProposed\n----\nThe new functionality would make this transparent, so one would not have\nto differ whether there are one or many remoting servers:\n\n```php\n<?php\n  try(); {\n    $remote= &Remote::forName('xp://jboss01.example.com/,xp://jboss02.example.com/');\n  } if (catch('RemoteException', $e)) {\n    $e->printStackTrace();\n    exit(1);\n  }\n\n  $home= &$remote->lookup('xp/demo/IteratorDemo');\n?>\n```\n\n\nNotes\n----\n* Initially, a random value is used to determine which one of the given\n  servers the connection should be made to. This is not real load-\n  balancing!\n\n* If connecting to jboss01 fails, jboss02 will be used (the other way\n  around respectively).\n\n\nSecurity considerations\n====\nn/a\n\n\nSpeed impact\n====\n- Minimalistic for round-robbing load balancing\n\n\nDependencies\n====\nn/a\n\n\nRelated documents\n====\n- http://unittests.xp-framework.net/?net.xp_framework.unittest.remote.RemoteTest\n  Unittest verifying new functionality\n\n\n","comments":0,"title":"HA-JNDI","updated_at":"2011-10-17T15:50:20Z","url":"https://api.github.com/repos/xp-framework/rfc/issues/62","id":1930083,"assignee":null,"milestone":null,"closed_at":"2011-10-17T15:50:20Z","user":{"gravatar_id":"26f07e3b262e9a80436f368cb11bd0c2","avatar_url":"https://secure.gravatar.com/avatar/26f07e3b262e9a80436f368cb11bd0c2?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/thekid","id":696742,"login":"thekid"},"html_url":"https://github.com/xp-framework/rfc/issues/62","labels":[{"name":"framework","url":"https://api.github.com/repos/xp-framework/rfc/labels/framework","color":"118f5b"},{"name":"implemented","url":"https://api.github.com/repos/xp-framework/rfc/labels/implemented","color":"807370"}],"state":"closed"},"legacy":{"number":62,"action":"closed","issue":1930083}}