[jboss-jira] [JBoss JIRA] (JGRP-1596) Allow to configure a channel with properties as well as url

Ittay Dror (JIRA) jira-events at lists.jboss.org
Tue Feb 19 02:41:57 EST 2013


    [ https://issues.jboss.org/browse/JGRP-1596?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12754893#comment-12754893 ] 

Ittay Dror commented on JGRP-1596:
----------------------------------

Well, there are two options. One is to use the "raw" configuration variables:

Properties overrides = new Properties();
overrides.put("TCP.bind_addr", 7000);

new JChannel(configFile, overrides)

The second is to give properties that are used to resolved values, instead or in addition the System.getProperty:
Properties overrides = new Properties();
overrides.put("jgroups.tcp.address", 7000);

// in the configuration file: <TCP bind_addr="${jgropus.tcp.address:7800}" ...
new JChannel(configFile, overrides)


I like the second option better as it allows the client to determine the variable names to be meaningful to him/her
                
> Allow to configure a channel with properties as well as url
> -----------------------------------------------------------
>
>                 Key: JGRP-1596
>                 URL: https://issues.jboss.org/browse/JGRP-1596
>             Project: JGroups
>          Issue Type: Feature Request
>            Reporter: Ittay Dror
>            Assignee: Bela Ban
>
> Currently, if I want to start 2 channels with the same configuration file, I'll get a lot of "discarded message from different cluster". I can use system properties to tweak the port setting in the file, but this is not thread safe. 
> I suggest adding a constructor `public JChannel(URL properties, Properties vars) throws Exception` that will use the 'vars' properties to interpolate the variables found in the properties file.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the jboss-jira mailing list