make <socket-binding>'s port optional

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

make <socket-binding>'s port optional

Jeff Mesnil
Hi,

I am working on an issue in the domain model for HornetQ cluster
configuration[1].
To be configured properly, I want to specify only a multicast-address
and multicast-port but not the local port (and let the OS open one).

According to jboss-as-config XSD (and brian ;) ), it's correct, the port
attribute of socket-bindingType is indeed optional.
However, we had multiple places in the code where the port is considered
mandatory.

I have started to change these places to have a consistent semantic
between the XSD and the domain model but I have a test failing and I
can't figure out where is the code responsible for that.

In my branch, I have configured the messaging subsystem[2] with this
<socket-binding> (no port defined):

<socket-binding name="messaging-group" multicast-address="231.7.7.7"
multicast-port="9876"/>

But when I run the test suite, I end up with a standalone file[3] where
the port attribute is set to "undefined"

<socket-binding name="messaging-group" port="undefined"
multicast-address="231.7.7.7" multicast-port="9876"/>

Newbie question: where is the code in charge of generating the
standalone file from the messaging.xml subsystem? I am not yet familiar
with AS7 codebase...
AIUI, I need to make sure that if the port is not defined in the model,
it is not written to the XML either.

thanks,
jeff


[1] https://issues.jboss.org/browse/AS7-3881
[2] in build/src/main/resources/configuration/subsystems/messaging.xml
[3] in
testsuite/integration/smoke/target/jbossas/standalone/configuration/standalone-full-ha.xml

--
Jeff Mesnil
JBoss, a division of Red Hat
http://jmesnil.net/
_______________________________________________
jboss-as7-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
Reply | Threaded
Open this post in threaded view
|

Re: make <socket-binding>'s port optional

jtgreene
Administrator
On 3/19/12 10:57 AM, Jeff Mesnil wrote:

> Hi,
>
> I am working on an issue in the domain model for HornetQ cluster
> configuration[1].
> To be configured properly, I want to specify only a multicast-address
> and multicast-port but not the local port (and let the OS open one).
>
> According to jboss-as-config XSD (and brian ;) ), it's correct, the port
> attribute of socket-bindingType is indeed optional.
> However, we had multiple places in the code where the port is considered
> mandatory.
>
> I have started to change these places to have a consistent semantic
> between the XSD and the domain model but I have a test failing and I
> can't figure out where is the code responsible for that.
>
> In my branch, I have configured the messaging subsystem[2] with this
> <socket-binding>  (no port defined):
>
> <socket-binding name="messaging-group" multicast-address="231.7.7.7"
> multicast-port="9876"/>
>
> But when I run the test suite, I end up with a standalone file[3] where
> the port attribute is set to "undefined"
>
> <socket-binding name="messaging-group" port="undefined"
> multicast-address="231.7.7.7" multicast-port="9876"/>
>
> Newbie question: where is the code in charge of generating the
> standalone file from the messaging.xml subsystem? I am not yet familiar
> with AS7 codebase...
> AIUI, I need to make sure that if the port is not defined in the model,
> it is not written to the XML either.

It's in CommonXml in the controller module. I can see it does not check
to verify the attribute is defined.

--
Jason T. Greene
JBoss AS Lead / EAP Platform Architect
JBoss, a division of Red Hat
_______________________________________________
jboss-as7-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
Reply | Threaded
Open this post in threaded view
|

Re: make <socket-binding>'s port optional

Jeff Mesnil
On 03/19/2012 05:04 PM, Jason T. Greene wrote:
> On 3/19/12 10:57 AM, Jeff Mesnil wrote:
>> Newbie question: where is the code in charge of generating the
>> standalone file from the messaging.xml subsystem? I am not yet familiar
>> with AS7 codebase...
>> AIUI, I need to make sure that if the port is not defined in the model,
>> it is not written to the XML either.
>
> It's in CommonXml in the controller module. I can see it does not check
> to verify the attribute is defined.

D'uh! I modified the code to parse the socket-binding in the same file.
I lost my way after that :)

thanks jason!


--
Jeff Mesnil
JBoss, a division of Red Hat
http://jmesnil.net/
_______________________________________________
jboss-as7-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
Reply | Threaded
Open this post in threaded view
|

Re: make <socket-binding>'s port optional

Jeff Mesnil
In reply to this post by jtgreene
> On 3/19/12 10:57 AM, Jeff Mesnil wrote:
>> I am working on an issue in the domain model for HornetQ cluster
>> configuration[1].
>> To be configured properly, I want to specify only a multicast-address
>> and multicast-port but not the local port (and let the OS open one).


I fixed the code to use properly a socket-binding for HornetQ cluster
configuration.

Now, I want to be able to run separate clusters on the same network
(that's the original issue raised by QA ).
I will do that by adding a property extension to the messaging-group's
multicast-address:

<socket-binding name="messaging-group"
multicast-address="${jboss.hornetq.cluster.address:231.7.7.7}"
multicast-port="9876"/>

1) What's the convention for naming this property?
jboss.hornetq.cluster.address or jboss.messaging.group.address something
else?

2) At first, I wanted to run separate clusters using port offset.
However there is nothing similar for the multicast-port. Does that make
sense to add it or is it really specific to this HornetQ conf?


thanks,
jeff

[1] https://issues.jboss.org/browse/JBPAPP-8178

--
Jeff Mesnil
JBoss, a division of Red Hat
http://jmesnil.net/
_______________________________________________
jboss-as7-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
Reply | Threaded
Open this post in threaded view
|

Re: make <socket-binding>'s port optional

kkhan

On 20 Mar 2012, at 10:38, Jeff Mesnil wrote:

>> On 3/19/12 10:57 AM, Jeff Mesnil wrote:
>>> I am working on an issue in the domain model for HornetQ cluster
>>> configuration[1].
>>> To be configured properly, I want to specify only a multicast-address
>>> and multicast-port but not the local port (and let the OS open one).
>
>
> I fixed the code to use properly a socket-binding for HornetQ cluster
> configuration.
>
> Now, I want to be able to run separate clusters on the same network
> (that's the original issue raised by QA ).
> I will do that by adding a property extension to the messaging-group's
> multicast-address:
>
> <socket-binding name="messaging-group"
> multicast-address="${jboss.hornetq.cluster.address:231.7.7.7}"
> multicast-port="9876"/>
>
> 1) What's the convention for naming this property?
> jboss.hornetq.cluster.address or jboss.messaging.group.address something
> else?
I think jboss.messaging.group.address looks more the convention used already for the socket bindings
>
> 2) At first, I wanted to run separate clusters using port offset.
> However there is nothing similar for the multicast-port. Does that make
> sense to add it or is it really specific to this HornetQ conf?

I think something specific makes it look too "complex" for your average user, so perhaps simply
> <socket-binding name="messaging-group"
> multicast-address="${jboss.messaging.group.address:231.7.7.7}"
> multicast-port="${jboss.messaging.group.port:9876}"/>


Then whatever starts the two clusters uses different values for the port for the two clusters?

>
>
> thanks,
> jeff
>
> [1] https://issues.jboss.org/browse/JBPAPP-8178
>
> --
> Jeff Mesnil
> JBoss, a division of Red Hat
> http://jmesnil.net/
> _______________________________________________
> jboss-as7-dev mailing list
> [hidden email]
> https://lists.jboss.org/mailman/listinfo/jboss-as7-dev


_______________________________________________
jboss-as7-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
Reply | Threaded
Open this post in threaded view
|

Re: make <socket-binding>'s port optional

Jeff Mesnil
On 03/20/2012 11:57 AM, Kabir Khan wrote:
>> 1) What's the convention for naming this property?
>> jboss.hornetq.cluster.address or jboss.messaging.group.address something
>> else?
> I think jboss.messaging.group.address looks more the convention used already for the socket bindings

ok
>> 2) At first, I wanted to run separate clusters using port offset.
>> However there is nothing similar for the multicast-port. Does that make
>> sense to add it or is it really specific to this HornetQ conf?
>
> I think something specific makes it look too "complex" for your average user, so perhaps simply
>> <socket-binding name="messaging-group"
>> multicast-address="${jboss.messaging.group.address:231.7.7.7}"
>> multicast-port="${jboss.messaging.group.port:9876}"/>

Yeah, good suggestion, I'll do it.

thanks,
jeff

--
Jeff Mesnil
JBoss, a division of Red Hat
http://jmesnil.net/
_______________________________________________
jboss-as7-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev