users@glassfish.java.net

Re: Loadbalancer: Auto-apply + rewrite-location

From: <glassfish_at_javadesktop.org>
Date: Fri, 05 Sep 2008 00:13:41 PDT

This does not look like a bug.

lb-config element allows you to add property in domain.xml.
[b]<!ELEMENT lb-config ((cluster-ref* | server-ref*), property*)>[/b]

So, if you add the [i]rewrite-location[/i] property under [i]lb-config[/i] element, it sets the correct value in exported loadbalancer.xml.

To test this, I created a simple test cluster named "Cluster1" and then created a loadbalancer named "mylb" that points to the Cluster1. I added the rewrite-location property under lb-config element. The domain.xml snippet will look like the following:
<lb-configs>
    <lb-config https-routing="false" monitoring-enabled="false" name="mylb_LB_CONFIG" reload-poll-interval-in-seconds="60" response-timeout-in-seconds="60" route-cookie-enabled="true">
      <cluster-ref lb-policy="round-robin" ref="Cluster1">
        <health-checker interval-in-seconds="30" timeout-in-seconds="10" url="/"/>
      </cluster-ref>
      [b]<property name="rewrite-location" value="false"/>[/b]
      <property name="last-exported" value="1220597044764"/>
    </lb-config>
</lb-configs>

Exported loadbalancer.xml reflects the rewrite-location property:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE loadbalancer PUBLIC "-//Sun Microsystems Inc.//DTD Sun Java System Application Server 9.1//EN" "sun-loadbalancer_1_2.dtd">
<loadbalancer>
  <cluster name="Cluster1" policy="round-robin">
    <instance disable-timeout-in-minutes="30" enabled="true" listeners="http://Macintosh-109.local:38080 https://Macintosh-109.local:38181" name="i1" weight="100"/>
    <health-checker interval-in-seconds="30" timeout-in-seconds="10" url="/"/>
  </cluster>
  <property name="response-timeout-in-seconds" value="60"/>
  <property name="reload-poll-interval-in-seconds" value="60"/>
  <property name="https-routing" value="false"/>
  <property name="require-monitor-data" value="false"/>
  [b]<property name="rewrite-location" value="false"/>[/b]
  <property name="last-exported" value=""/>
  <property name="active-healthcheck-enabled" value="false"/>
  <property name="number-healthcheck-retries" value="3"/>
</loadbalancer>

Hope this helps.

--Nazrul
[Message sent by forum member 'ai109478' (ai109478)]

http://forums.java.net/jive/thread.jspa?messageID=297360