<div dir="ltr"><div>Thanks Brain for answering this however I am still a bit puzzled,<br><br></div>Let me explain:<br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Aug 25, 2015 at 5:04 PM, Brian Stansberry <span dir="ltr"><<a href="mailto:brian.stansberry@redhat.com" target="_blank">brian.stansberry@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">This attribute does not support use of expressions, so any data you<br>
provide is evaluated simply as a string.<br>
<br></blockquote><div><br></div><div>"This attribute" most likely refers to the name attribute in <channel name="ee"> if I interpret your sentence correctly. If so, why not create an extra attribute CLUSTER_NAME next to the existing STACK and MODULE attributes and use the CLUSTER_NAME to create the JChannel. Using the current configuration model all containers start up with default cluster name "ee" unless the standalone*.xml file is edited beforehand. This is practically undoable because the cluster name defaults to the name of the channel used and I didn't find a way to overrule this (I might have overlooked something of course). <br><br></div><div>The only way to make distinct clusters is to add a bunch of pre-defined channel definitions and change the channels default. example:<br><pre style="color:rgb(0,0,0);font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px"><i><subsystem xmlns="urn:jboss:domain:jgroups:3.0">
</i><i> <channels default="${custom_clustername:ee}">
</i><i> <channel name="ee"/></i><br><i><i> <channel name="whee"/><br></i></i><i><i><i> <channel name="foo"/><br></i></i> </i><i></channels>
</i><i> ...
</i><i></subsytem></i></pre>And then select one of the names using the <span style="font-family:monospace,monospace">-Dcustom_clustername=[|whee|foo]</span> startup property. However the desired behavior is to be flexible and provide a random name at startup time. <span style="font-family:monospace,monospace"><br></span><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
It doesn't support expressions because it is what we call a "model<br>
reference" attribute. It's value refers to another element in the<br>
configuration model. We do not allow expressions in those attributes<br>
because it is not possible to have all the necessary data to resolve the<br>
expression at the points in time when the correctness of the model must<br>
be validated.<br>
<div><div class="h5"><br>
On 8/25/15 9:31 AM, Dennis Brouwer wrote:<br>
> Dear reader,<br>
><br>
> We recently moved to Wildfly 9.0.1.Final (from 8.2.0) for testing and<br>
> stumbled upon a bug regarding expression evaluation in the standalone*.xml.<br>
><br>
> Let me give an example for the following subsystem:<br>
><br>
> <subsystem xmlns="urn:jboss:domain:jgroups:3.0"><br>
> <channels default="ee"><br>
> <channel name="ee"/><br>
> </channels><br>
> ...<br>
> </subsytem><br>
><br>
> Since we have several deployment stages on one physical server we need<br>
> to separate the clusters by using a distinct name for each one of the<br>
> stages deployed. Hence we introduced a startup property to be<br>
> substituted in the standalone*.xml configuration like following snippet<br>
> clarifies:<br>
><br>
> <subsystem xmlns="urn:jboss:domain:jgroups:3.0"><br>
> <channels default="${custom_clustername:ee}"><br>
> <channel name="${custom_clustername:ee}"/><br>
> </channels><br>
> ...<br>
> </subsytem><br>
><br>
> Using this approach however fails to start the container because the<br>
> channels default attribute is properly evaluated to "ee" (accoding to<br>
> specs). However the channel name attribute is not evaluated at all and<br>
> is registered as "${custom_clustername:ee}" (without the quotes).<br>
><br>
> I took the liberty to dig in the class:<br>
> org.jboss.as.clustering.jgroups.subsystem.JGroupsSubsystemXMLReader and<br>
> manually do the expression evaluation for the channel name. At first<br>
> glance this seems to work however the container rewrites the<br>
> standalone*.xml file at a certain moment resulting in this snippet:<br>
><br>
> <subsystem xmlns="urn:jboss:domain:jgroups:3.0"><br>
> <channels default="${custom_clustername:ee}"><br>
> <channel name="ee"/><br>
> </channels><br>
> ...<br>
> </subsytem><br>
><br>
> Which on subsequent container starts and when using the<br>
> -Dcustom_clustername=whee startup property causes a problem because the<br>
> channels default is evaluated to "whee" and the channel name remains "ee".<br>
><br>
><br>
> So my questions are:<br>
><br>
> 1] How to solve this issue in a correct way?<br>
> 2] Can somebody provide another mechanism to configure a non default<br>
> channel name on startup?<br>
><br>
><br>
> --<br>
> Best regards,<br>
><br>
</div></div>> *Dennis Brouwer*<br>
> Extraordinary Goalkeeper<br>
<span class="">><br>
><br>
><br>
><br>
> ZEEF - Kizitos B.V.<br>
> Amstelboulevard 184<br>
> 1096 HM Amsterdam<br>
</span>> <a href="http://www.ZEEF.com" rel="noreferrer" target="_blank">www.ZEEF.com</a> <<a href="http://www.zeef.com/" rel="noreferrer" target="_blank">http://www.zeef.com/</a>><br>
<span class="">> US: <a href="tel:%2B1%20%28415%29%20992-9409" value="+14159929409">+1 (415) 992-9409</a><br>
> NL: <a href="tel:%2B31%20%28085%29%20888-3186" value="+31858883186">+31 (085) 888-3186</a><br>
><br>
><br>
</span>> _______________________________________________<br>
> wildfly-dev mailing list<br>
> <a href="mailto:wildfly-dev@lists.jboss.org">wildfly-dev@lists.jboss.org</a><br>
> <a href="https://lists.jboss.org/mailman/listinfo/wildfly-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/wildfly-dev</a><br>
><br>
<span class=""><font color="#888888"><br>
<br>
--<br>
Brian Stansberry<br>
Senior Principal Software Engineer<br>
JBoss by Red Hat<br>
_______________________________________________<br>
wildfly-dev mailing list<br>
<a href="mailto:wildfly-dev@lists.jboss.org">wildfly-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/wildfly-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/wildfly-dev</a><br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature"><div dir="ltr"><div>Best regards,<br>
<br>
<b>Dennis Brouwer</b><br>
Extraordinary Goalkeeper<br><br><br>
<img src="http://zeef.org/wp-content/themes/twentytwelve-zeef/images/zeef-logo.png" style="margin: 0px 2px; padding: 0px; border: 0px none; max-width: 100%; color: rgb(51, 51, 51); font-family: Arial,sans-serif; font-size: 14px; line-height: 20px;"><br style="color:rgb(51,51,51);font-family:Arial,sans-serif;font-size:14px;line-height:20px"><br style="color:rgb(51,51,51);font-family:Arial,sans-serif;font-size:14px;line-height:20px"><div style="margin:0px;padding:0px;color:rgb(51,51,51);font-family:Arial,sans-serif;font-size:14px;line-height:20px">ZEEF - Kizitos B.V.<br><div style="margin:0px;padding:0px">Amstelboulevard 184</div><div style="margin:0px;padding:0px">1096 HM Amsterdam</div></div><div style="margin:0px;padding:0px;color:rgb(51,51,51);font-family:Arial,sans-serif;font-size:14px;line-height:20px"><a href="http://www.zeef.com/" rel="nofollow" style="color:rgb(67,118,187);text-decoration:none" target="_blank">www.ZEEF.com</a></div><span style="font-family:Arial,sans-serif;font-size:14px;line-height:20px">US: </span><a rel="nofollow" style="color:rgb(67,118,187);font-family:Arial,sans-serif;font-size:14px;line-height:20px">+1 (415) 992-9409</a><div style="margin:0px;padding:0px;color:rgb(51,51,51);font-family:Arial,sans-serif;font-size:14px;line-height:20px">NL: <a rel="nofollow" style="color:rgb(67,118,187)">+31 (085) 888-3186</a></div></div></div></div>
</div></div>