Carbon C5 - Server Configuration Model

classic Classic list List threaded Threaded
33 messages Options
12
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Carbon C5 - Server Configuration Model

Danesh Kuruppu
Hi all,

In Carbon C5, we are going to introduce new global configuration model where we have only one configuration file for all server configurations. So that user have to maintain only one config file for a server.

With New Configuration Model,
  • Global configuration file (deployment.yaml) includes minimal sets of configurations which need to override very often by default (e.g: server ports etc).
  • All user settable configurations must have default values and they are burnt into compile codes.
  • Any default configuration can overridden by adding the particular configuration to the global configuration file(deployment.yaml).
  • Defining all configurations in the configuration file in not required. add only if we need to override the default value.
  • If configurations are not specified in the configuration file, values defined in the bean class will apply by default.
In global configuration file (deployment.yaml),
  • Each component will have their own configurations with a unique namespace (e.g: wso2.carbon, wso2.transports.netty etc) and it will be a fragment of deployment.yaml file. Please find the sample file below.
  • At runtime, the relevant config bean will be generated by overriding the default values specified in bean class with values mentioned in deployment.yaml file.
Sample file looks like,
  # Carbon Configuration Parameters
wso2.carbon:
id: carbon-kernel
version: 5.2.0-SNAPSHOT
ports:
offset: 0
...

# Netty Transport Configurations
wso2.transports.netty:
listeners:
- id: msf4j-http
host: 127.0.0.1
port: 8080
bossThreadPoolSize: 2
workerThreadPoolSize: 250
parameters:
- name: "executor.workerpool.size"
value: 60
...
Along with the above design, we are going to introduce new annotation model to the configuration beans. So each component will have its configuration defined as one or more Java beans annotated with the following annotations
  • org.wso2.carbon.kernel.annotations.Configuration - Class level annotation, This corresponds to a configuration bean to be used by a component
  • org.wso2.carbon.kernel.annotations.Element - Field level annotation, This corresponds to a fields of the class
  • org.wso2.carbon.kernel.annotations.Ignore - Field level annotation, This is to specify that field needs to be ignored when the configuration is generated
Sample bean class looks like,
@Configuration(namespace = "wso2.carbon", description = "Carbon Configuration Parameters")
public class CarbonConfiguration {

@Element(description = "value to uniquely identify a server", required = true)
private String id = "carbon-kernel";

@Element(description = "server name")
private String name = "WSO2 Carbon Kernel";

@Element(description = "server version")
private String version = "5.2.0";

@Ignore
private String tenant = Constants.DEFAULT_TENANT;
...
}
So we are going to generate the relevant segment of the configuration file(for documentation purposes) automatically at compile time by reading above annotations and default values.

If anyone needs to override the default value, He needs to copy the particular segment of the configuration to the deployment.yaml and change the value.

Appreciate your input on this.

Thanks
--

Danesh Kuruppu

Senior Software Engineer | WSO2

Email: [hidden email]

Mobile: +94 (77) 1690552
Web: WSO2 Inc



_______________________________________________
Architecture mailing list
[hidden email]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Carbon C5 - Server Configuration Model

SajithAR Ariyarathna
Hi Danesh,

Do we really need the @Ignore annotation? IMO, we can ignore frields wich are not marked with @Element annotation, thus we don't need a separate annotation.

Thanks.

On Mon, Nov 21, 2016 at 11:32 PM, Danesh Kuruppu <[hidden email]> wrote:
Hi all,

In Carbon C5, we are going to introduce new global configuration model where we have only one configuration file for all server configurations. So that user have to maintain only one config file for a server.

With New Configuration Model,
  • Global configuration file (deployment.yaml) includes minimal sets of configurations which need to override very often by default (e.g: server ports etc).
  • All user settable configurations must have default values and they are burnt into compile codes.
  • Any default configuration can overridden by adding the particular configuration to the global configuration file(deployment.yaml).
  • Defining all configurations in the configuration file in not required. add only if we need to override the default value.
  • If configurations are not specified in the configuration file, values defined in the bean class will apply by default.
In global configuration file (deployment.yaml),
  • Each component will have their own configurations with a unique namespace (e.g: wso2.carbon, wso2.transports.netty etc) and it will be a fragment of deployment.yaml file. Please find the sample file below.
  • At runtime, the relevant config bean will be generated by overriding the default values specified in bean class with values mentioned in deployment.yaml file.
Sample file looks like,
  # Carbon Configuration Parameters
wso2.carbon:
id: carbon-kernel
version: 5.2.0-SNAPSHOT
ports:
offset: 0
...

# Netty Transport Configurations
wso2.transports.netty:
listeners:
- id: msf4j-http
host: 127.0.0.1
port: 8080
bossThreadPoolSize: 2
workerThreadPoolSize: 250
parameters:
- name: "executor.workerpool.size"
value: 60
...
Along with the above design, we are going to introduce new annotation model to the configuration beans. So each component will have its configuration defined as one or more Java beans annotated with the following annotations
  • org.wso2.carbon.kernel.annotations.Configuration - Class level annotation, This corresponds to a configuration bean to be used by a component
  • org.wso2.carbon.kernel.annotations.Element - Field level annotation, This corresponds to a fields of the class
  • org.wso2.carbon.kernel.annotations.Ignore - Field level annotation, This is to specify that field needs to be ignored when the configuration is generated
Sample bean class looks like,
@Configuration(namespace = "wso2.carbon", description = "Carbon Configuration Parameters")
public class CarbonConfiguration {

@Element(description = "value to uniquely identify a server", required = true)
private String id = "carbon-kernel";

@Element(description = "server name")
private String name = "WSO2 Carbon Kernel";

@Element(description = "server version")
private String version = "5.2.0";

@Ignore
private String tenant = Constants.DEFAULT_TENANT;
...
}
So we are going to generate the relevant segment of the configuration file(for documentation purposes) automatically at compile time by reading above annotations and default values.

If anyone needs to override the default value, He needs to copy the particular segment of the configuration to the deployment.yaml and change the value.

Appreciate your input on this.

Thanks
--

Danesh Kuruppu

Senior Software Engineer | WSO2

Email: [hidden email]

Mobile: <a href="tel:%2B94%20%2877%29%201690552" value="+94771690552" target="_blank">+94 (77) 1690552
Web: WSO2 Inc



_______________________________________________
Architecture mailing list
[hidden email]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture




--
Sajith Janaprasad Ariyarathna
Software Engineer; WSO2, Inc.;  http://wso2.com/


_______________________________________________
Architecture mailing list
[hidden email]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Carbon C5 - Server Configuration Model

Dilan Udara Ariyaratne
Hi Danesh,

Why are we going to duplicate all user-settable, default configuration values both at yaml level as well as Java bean level ?
Cannot we make the yaml as the one and only reference point ?

Thanks,
Dilan.


Dilan U. Ariyaratne
Senior Software Engineer
WSO2 Inc.
Mobile: +<a href="tel:%2B94766405580" value="+94766405580" target="_blank">94766405580
lean . enterprise . middleware


On Tue, Nov 22, 2016 at 10:19 AM, SajithAR Ariyarathna <[hidden email]> wrote:
Hi Danesh,

Do we really need the @Ignore annotation? IMO, we can ignore frields wich are not marked with @Element annotation, thus we don't need a separate annotation.

Thanks.

On Mon, Nov 21, 2016 at 11:32 PM, Danesh Kuruppu <[hidden email]> wrote:
Hi all,

In Carbon C5, we are going to introduce new global configuration model where we have only one configuration file for all server configurations. So that user have to maintain only one config file for a server.

With New Configuration Model,
  • Global configuration file (deployment.yaml) includes minimal sets of configurations which need to override very often by default (e.g: server ports etc).
  • All user settable configurations must have default values and they are burnt into compile codes.
  • Any default configuration can overridden by adding the particular configuration to the global configuration file(deployment.yaml).
  • Defining all configurations in the configuration file in not required. add only if we need to override the default value.
  • If configurations are not specified in the configuration file, values defined in the bean class will apply by default.
In global configuration file (deployment.yaml),
  • Each component will have their own configurations with a unique namespace (e.g: wso2.carbon, wso2.transports.netty etc) and it will be a fragment of deployment.yaml file. Please find the sample file below.
  • At runtime, the relevant config bean will be generated by overriding the default values specified in bean class with values mentioned in deployment.yaml file.
Sample file looks like,
  # Carbon Configuration Parameters
wso2.carbon:
id: carbon-kernel
version: 5.2.0-SNAPSHOT
ports:
offset: 0
...

# Netty Transport Configurations
wso2.transports.netty:
listeners:
- id: msf4j-http
host: 127.0.0.1
port: 8080
bossThreadPoolSize: 2
workerThreadPoolSize: 250
parameters:
- name: "executor.workerpool.size"
value: 60
...
Along with the above design, we are going to introduce new annotation model to the configuration beans. So each component will have its configuration defined as one or more Java beans annotated with the following annotations
  • org.wso2.carbon.kernel.annotations.Configuration - Class level annotation, This corresponds to a configuration bean to be used by a component
  • org.wso2.carbon.kernel.annotations.Element - Field level annotation, This corresponds to a fields of the class
  • org.wso2.carbon.kernel.annotations.Ignore - Field level annotation, This is to specify that field needs to be ignored when the configuration is generated
Sample bean class looks like,
@Configuration(namespace = "wso2.carbon", description = "Carbon Configuration Parameters")
public class CarbonConfiguration {

@Element(description = "value to uniquely identify a server", required = true)
private String id = "carbon-kernel";

@Element(description = "server name")
private String name = "WSO2 Carbon Kernel";

@Element(description = "server version")
private String version = "5.2.0";

@Ignore
private String tenant = Constants.DEFAULT_TENANT;
...
}
So we are going to generate the relevant segment of the configuration file(for documentation purposes) automatically at compile time by reading above annotations and default values.

If anyone needs to override the default value, He needs to copy the particular segment of the configuration to the deployment.yaml and change the value.

Appreciate your input on this.

Thanks
--

Danesh Kuruppu

Senior Software Engineer | WSO2

Email: [hidden email]

Mobile: <a href="tel:%2B94%20%2877%29%201690552" value="+94771690552" target="_blank">+94 (77) 1690552
Web: WSO2 Inc



_______________________________________________
Architecture mailing list
[hidden email]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture




--
Sajith Janaprasad Ariyarathna
Software Engineer; WSO2, Inc.;  http://wso2.com/


_______________________________________________
Architecture mailing list
[hidden email]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture



_______________________________________________
Architecture mailing list
[hidden email]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Carbon C5 - Server Configuration Model

Susinda Perera
In reply to this post by SajithAR Ariyarathna
Hi Danesh

In configuration class, do we treat all properties as Strings? Or what if we make the parsing within this config class.?

Thanks
Susinda

On Tue, Nov 22, 2016 at 10:19 AM, SajithAR Ariyarathna <[hidden email]> wrote:
Hi Danesh,

Do we really need the @Ignore annotation? IMO, we can ignore frields wich are not marked with @Element annotation, thus we don't need a separate annotation.

Thanks.

On Mon, Nov 21, 2016 at 11:32 PM, Danesh Kuruppu <[hidden email]> wrote:
Hi all,

In Carbon C5, we are going to introduce new global configuration model where we have only one configuration file for all server configurations. So that user have to maintain only one config file for a server.

With New Configuration Model,
  • Global configuration file (deployment.yaml) includes minimal sets of configurations which need to override very often by default (e.g: server ports etc).
  • All user settable configurations must have default values and they are burnt into compile codes.
  • Any default configuration can overridden by adding the particular configuration to the global configuration file(deployment.yaml).
  • Defining all configurations in the configuration file in not required. add only if we need to override the default value.
  • If configurations are not specified in the configuration file, values defined in the bean class will apply by default.
In global configuration file (deployment.yaml),
  • Each component will have their own configurations with a unique namespace (e.g: wso2.carbon, wso2.transports.netty etc) and it will be a fragment of deployment.yaml file. Please find the sample file below.
  • At runtime, the relevant config bean will be generated by overriding the default values specified in bean class with values mentioned in deployment.yaml file.
Sample file looks like,
  # Carbon Configuration Parameters
wso2.carbon:
id: carbon-kernel
version: 5.2.0-SNAPSHOT
ports:
offset: 0
...

# Netty Transport Configurations
wso2.transports.netty:
listeners:
- id: msf4j-http
host: 127.0.0.1
port: 8080
bossThreadPoolSize: 2
workerThreadPoolSize: 250
parameters:
- name: "executor.workerpool.size"
value: 60
...
Along with the above design, we are going to introduce new annotation model to the configuration beans. So each component will have its configuration defined as one or more Java beans annotated with the following annotations
  • org.wso2.carbon.kernel.annotations.Configuration - Class level annotation, This corresponds to a configuration bean to be used by a component
  • org.wso2.carbon.kernel.annotations.Element - Field level annotation, This corresponds to a fields of the class
  • org.wso2.carbon.kernel.annotations.Ignore - Field level annotation, This is to specify that field needs to be ignored when the configuration is generated
Sample bean class looks like,
@Configuration(namespace = "wso2.carbon", description = "Carbon Configuration Parameters")
public class CarbonConfiguration {

@Element(description = "value to uniquely identify a server", required = true)
private String id = "carbon-kernel";

@Element(description = "server name")
private String name = "WSO2 Carbon Kernel";

@Element(description = "server version")
private String version = "5.2.0";

@Ignore
private String tenant = Constants.DEFAULT_TENANT;
...
}
So we are going to generate the relevant segment of the configuration file(for documentation purposes) automatically at compile time by reading above annotations and default values.

If anyone needs to override the default value, He needs to copy the particular segment of the configuration to the deployment.yaml and change the value.

Appreciate your input on this.

Thanks
--

Danesh Kuruppu

Senior Software Engineer | WSO2

Email: [hidden email]

Mobile: <a href="tel:%2B94%20%2877%29%201690552" value="+94771690552" target="_blank">+94 (77) 1690552
Web: WSO2 Inc



_______________________________________________
Architecture mailing list
[hidden email]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture




--
Sajith Janaprasad Ariyarathna
Software Engineer; WSO2, Inc.;  http://wso2.com/


_______________________________________________
Architecture mailing list
[hidden email]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture




--
Susinda Perera
Software Engineer
B.Sc.(Eng), M.Sc(Computer Science), AMIE(SL)
Mobile:(+94)716049075
Blog: susinda.blogspot.com
WSO2 Inc. http://wso2.com/
Tel : 94 11 214 5345 Fax :94 11 2145300


_______________________________________________
Architecture mailing list
[hidden email]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Carbon C5 - Server Configuration Model

Afkham Azeez-2
In reply to this post by SajithAR Ariyarathna


On Tue, Nov 22, 2016 at 10:19 AM, SajithAR Ariyarathna <[hidden email]> wrote:
Hi Danesh,

Do we really need the @Ignore annotation? IMO, we can ignore frields wich are not marked with @Element annotation, thus we don't need a separate annotation.

@Element is optional. By default all fields will become config elements. That is how it works in popular frameworks such as JAXB. So we are giving a simple way to specify that some fileds shouldn't become config elements.
 

Thanks.

On Mon, Nov 21, 2016 at 11:32 PM, Danesh Kuruppu <[hidden email]> wrote:
Hi all,

In Carbon C5, we are going to introduce new global configuration model where we have only one configuration file for all server configurations. So that user have to maintain only one config file for a server.

With New Configuration Model,
  • Global configuration file (deployment.yaml) includes minimal sets of configurations which need to override very often by default (e.g: server ports etc).
  • All user settable configurations must have default values and they are burnt into compile codes.
  • Any default configuration can overridden by adding the particular configuration to the global configuration file(deployment.yaml).
  • Defining all configurations in the configuration file in not required. add only if we need to override the default value.
  • If configurations are not specified in the configuration file, values defined in the bean class will apply by default.
In global configuration file (deployment.yaml),
  • Each component will have their own configurations with a unique namespace (e.g: wso2.carbon, wso2.transports.netty etc) and it will be a fragment of deployment.yaml file. Please find the sample file below.
  • At runtime, the relevant config bean will be generated by overriding the default values specified in bean class with values mentioned in deployment.yaml file.
Sample file looks like,
  # Carbon Configuration Parameters
wso2.carbon:
id: carbon-kernel
version: 5.2.0-SNAPSHOT
ports:
offset: 0
...

# Netty Transport Configurations
wso2.transports.netty:
listeners:
- id: msf4j-http
host: 127.0.0.1
port: 8080
bossThreadPoolSize: 2
workerThreadPoolSize: 250
parameters:
- name: "executor.workerpool.size"
value: 60
...
Along with the above design, we are going to introduce new annotation model to the configuration beans. So each component will have its configuration defined as one or more Java beans annotated with the following annotations
  • org.wso2.carbon.kernel.annotations.Configuration - Class level annotation, This corresponds to a configuration bean to be used by a component
  • org.wso2.carbon.kernel.annotations.Element - Field level annotation, This corresponds to a fields of the class
  • org.wso2.carbon.kernel.annotations.Ignore - Field level annotation, This is to specify that field needs to be ignored when the configuration is generated
Sample bean class looks like,
@Configuration(namespace = "wso2.carbon", description = "Carbon Configuration Parameters")
public class CarbonConfiguration {

@Element(description = "value to uniquely identify a server", required = true)
private String id = "carbon-kernel";

@Element(description = "server name")
private String name = "WSO2 Carbon Kernel";

@Element(description = "server version")
private String version = "5.2.0";

@Ignore
private String tenant = Constants.DEFAULT_TENANT;
...
}
So we are going to generate the relevant segment of the configuration file(for documentation purposes) automatically at compile time by reading above annotations and default values.

If anyone needs to override the default value, He needs to copy the particular segment of the configuration to the deployment.yaml and change the value.

Appreciate your input on this.

Thanks
--

Danesh Kuruppu

Senior Software Engineer | WSO2

Email: [hidden email]

Mobile: <a href="tel:%2B94%20%2877%29%201690552" value="+94771690552" target="_blank">+94 (77) 1690552
Web: WSO2 Inc



_______________________________________________
Architecture mailing list
[hidden email]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture




--
Sajith Janaprasad Ariyarathna
Software Engineer; WSO2, Inc.;  http://wso2.com/




--
Afkham Azeez
Director of ArchitectureWSO2, Inc.; http://wso2.com
Member; Apache Software Foundation; http://www.apache.org/

email:
[hidden email] cell: +94 77 3320919
blog:
http://blog.afkham.org
twitter:
http://twitter.com/afkham_azeez
linked-in:
http://lk.linkedin.com/in/afkhamazeez

Lean . Enterprise . Middleware

_______________________________________________
Architecture mailing list
[hidden email]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Carbon C5 - Server Configuration Model

Nuwan Dias
In reply to this post by Danesh Kuruppu
Can you also provide an example bean class for the netty listener? That would make it clear how the bean class and its nested classes would be annotated when array elements come into play.

Have we thought about secure vault too?

On Mon, Nov 21, 2016 at 11:32 PM, Danesh Kuruppu <[hidden email]> wrote:
Hi all,

In Carbon C5, we are going to introduce new global configuration model where we have only one configuration file for all server configurations. So that user have to maintain only one config file for a server.

With New Configuration Model,
  • Global configuration file (deployment.yaml) includes minimal sets of configurations which need to override very often by default (e.g: server ports etc).
  • All user settable configurations must have default values and they are burnt into compile codes.
  • Any default configuration can overridden by adding the particular configuration to the global configuration file(deployment.yaml).
  • Defining all configurations in the configuration file in not required. add only if we need to override the default value.
  • If configurations are not specified in the configuration file, values defined in the bean class will apply by default.
In global configuration file (deployment.yaml),
  • Each component will have their own configurations with a unique namespace (e.g: wso2.carbon, wso2.transports.netty etc) and it will be a fragment of deployment.yaml file. Please find the sample file below.
  • At runtime, the relevant config bean will be generated by overriding the default values specified in bean class with values mentioned in deployment.yaml file.
Sample file looks like,
  # Carbon Configuration Parameters
wso2.carbon:
id: carbon-kernel
version: 5.2.0-SNAPSHOT
ports:
offset: 0
...

# Netty Transport Configurations
wso2.transports.netty:
listeners:
- id: msf4j-http
host: 127.0.0.1
port: 8080
bossThreadPoolSize: 2
workerThreadPoolSize: 250
parameters:
- name: "executor.workerpool.size"
value: 60
...
Along with the above design, we are going to introduce new annotation model to the configuration beans. So each component will have its configuration defined as one or more Java beans annotated with the following annotations
  • org.wso2.carbon.kernel.annotations.Configuration - Class level annotation, This corresponds to a configuration bean to be used by a component
  • org.wso2.carbon.kernel.annotations.Element - Field level annotation, This corresponds to a fields of the class
  • org.wso2.carbon.kernel.annotations.Ignore - Field level annotation, This is to specify that field needs to be ignored when the configuration is generated
Sample bean class looks like,
@Configuration(namespace = "wso2.carbon", description = "Carbon Configuration Parameters")
public class CarbonConfiguration {

@Element(description = "value to uniquely identify a server", required = true)
private String id = "carbon-kernel";

@Element(description = "server name")
private String name = "WSO2 Carbon Kernel";

@Element(description = "server version")
private String version = "5.2.0";

@Ignore
private String tenant = Constants.DEFAULT_TENANT;
...
}
So we are going to generate the relevant segment of the configuration file(for documentation purposes) automatically at compile time by reading above annotations and default values.

If anyone needs to override the default value, He needs to copy the particular segment of the configuration to the deployment.yaml and change the value.

Appreciate your input on this.

Thanks
--

Danesh Kuruppu

Senior Software Engineer | WSO2

Email: [hidden email]

Mobile: <a href="tel:%2B94%20%2877%29%201690552" value="+94771690552" target="_blank">+94 (77) 1690552
Web: WSO2 Inc



_______________________________________________
Architecture mailing list
[hidden email]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture




--
Nuwan Dias

Software Architect - WSO2, Inc. http://wso2.com
Phone : +94 777 775 729

_______________________________________________
Architecture mailing list
[hidden email]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Carbon C5 - Server Configuration Model

Danesh Kuruppu
In reply to this post by Dilan Udara Ariyaratne
Hi Dilan,

Why are we going to duplicate all user-settable, default configuration values both at yaml level as well as Java bean level ?
Cannot we make the yaml as the one and only reference point ?

We are not duplicating the default configuration values. only place we specify default values is in Java bean level. There is no yaml file with default values. We put configs in the deployment.yaml, only if we need to override the default value.  
--

Danesh Kuruppu

Senior Software Engineer | WSO2

Email: [hidden email]

Mobile: +94 (77) 1690552
Web: WSO2 Inc



_______________________________________________
Architecture mailing list
[hidden email]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Carbon C5 - Server Configuration Model

Danesh Kuruppu
In reply to this post by Susinda Perera
Hi Susinda,

In configuration class, do we treat all properties as Strings? Or what if we make the parsing within this config class.?

No, we can have any type. and we don't need to parse within the config class. My example bit confusing, it has only String values. meant to show how to add annotations.
We can write normal bean class with default values, only addition is to put annotations to the class.
We use snakeYAML apis to load bean class from yaml configs.

Thanks
--

Danesh Kuruppu

Senior Software Engineer | WSO2

Email: [hidden email]

Mobile: +94 (77) 1690552
Web: WSO2 Inc



_______________________________________________
Architecture mailing list
[hidden email]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Carbon C5 - Server Configuration Model

Danesh Kuruppu
In reply to this post by Nuwan Dias
Hi Nuwan,

Can you also provide an example bean class for the netty listener? That would make it clear how the bean class and its nested classes would be annotated when array elements come into play.

Please check TransportsConfiguration sample below. We need to mention the default values of an array or collection in class constructor as below.
@Configuration(namespace = "wso2.transports.netty", description = "Netty Transport Configurations")
public class TransportsConfiguration {

//default values of an array or collection need to mention in class constructor
public TransportsConfiguration() {
ListenerConfiguration listenerConfiguration = ListenerConfiguration();
listenerConfigurations = new HashSet<>();
listenerConfigurations.add(listenerConfiguration);

SenderConfiguration senderConfiguration = SenderConfiguration();
senderConfigurations = new HashSet<>();
senderConfigurations.add(senderConfiguration);

transportProperties = new HashSet<>();
}

@Element(description = "transport properties")
private Set<TransportProperty> transportProperties = Collections.EMPTY_SET;

@Element(description = "listener configurations")
private Set<ListenerConfiguration> listenerConfigurations;

@Element(description = "sender configurations")
private Set<SenderConfiguration> senderConfigurations;
 }
 
Have we thought about secure vault too?

Yes, we resolve all secure valut values and system property values in deployment.yaml before generating bean class.

Thanks
--

Danesh Kuruppu

Senior Software Engineer | WSO2

Email: [hidden email]

Mobile: +94 (77) 1690552
Web: WSO2 Inc



_______________________________________________
Architecture mailing list
[hidden email]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Carbon C5 - Server Configuration Model

Rukshan Premathunga
Hi Danesh,

Is this feature is available now? if so can you mention the kernel version please?

Thanks and Regards

On Tue, Nov 22, 2016 at 12:22 PM, Danesh Kuruppu <[hidden email]> wrote:
Hi Nuwan,

Can you also provide an example bean class for the netty listener? That would make it clear how the bean class and its nested classes would be annotated when array elements come into play.

Please check TransportsConfiguration sample below. We need to mention the default values of an array or collection in class constructor as below.
@Configuration(namespace = "wso2.transports.netty", description = "Netty Transport Configurations")
public class TransportsConfiguration {

//default values of an array or collection need to mention in class constructor
public TransportsConfiguration() {
ListenerConfiguration listenerConfiguration = ListenerConfiguration();
listenerConfigurations = new HashSet<>();
listenerConfigurations.add(listenerConfiguration);

SenderConfiguration senderConfiguration = SenderConfiguration();
senderConfigurations = new HashSet<>();
senderConfigurations.add(senderConfiguration);

transportProperties = new HashSet<>();
}

@Element(description = "transport properties")
private Set<TransportProperty> transportProperties = Collections.EMPTY_SET;

@Element(description = "listener configurations")
private Set<ListenerConfiguration> listenerConfigurations;

@Element(description = "sender configurations")
private Set<SenderConfiguration> senderConfigurations;
 }
 
Have we thought about secure vault too?

Yes, we resolve all secure valut values and system property values in deployment.yaml before generating bean class.

Thanks
--

Danesh Kuruppu

Senior Software Engineer | WSO2

Email: [hidden email]

Mobile: <a href="tel:%2B94%20%2877%29%201690552" value="+94771690552" target="_blank">+94 (77) 1690552
Web: WSO2 Inc



_______________________________________________
Architecture mailing list
[hidden email]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture




--
Rukshan Chathuranga.
Software Engineer.
WSO2, Inc.

_______________________________________________
Architecture mailing list
[hidden email]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Carbon C5 - Server Configuration Model

Danesh Kuruppu
Hi Rukshan,

No. We are going to include this in next kernel release(5.2.0).

Thanks
Danesh

On Mon, Nov 28, 2016 at 10:26 AM, Rukshan Premathunga <[hidden email]> wrote:
Hi Danesh,

Is this feature is available now? if so can you mention the kernel version please?

Thanks and Regards

On Tue, Nov 22, 2016 at 12:22 PM, Danesh Kuruppu <[hidden email]> wrote:
Hi Nuwan,

Can you also provide an example bean class for the netty listener? That would make it clear how the bean class and its nested classes would be annotated when array elements come into play.

Please check TransportsConfiguration sample below. We need to mention the default values of an array or collection in class constructor as below.
@Configuration(namespace = "wso2.transports.netty", description = "Netty Transport Configurations")
public class TransportsConfiguration {

//default values of an array or collection need to mention in class constructor
public TransportsConfiguration() {
ListenerConfiguration listenerConfiguration = ListenerConfiguration();
listenerConfigurations = new HashSet<>();
listenerConfigurations.add(listenerConfiguration);

SenderConfiguration senderConfiguration = SenderConfiguration();
senderConfigurations = new HashSet<>();
senderConfigurations.add(senderConfiguration);

transportProperties = new HashSet<>();
}

@Element(description = "transport properties")
private Set<TransportProperty> transportProperties = Collections.EMPTY_SET;

@Element(description = "listener configurations")
private Set<ListenerConfiguration> listenerConfigurations;

@Element(description = "sender configurations")
private Set<SenderConfiguration> senderConfigurations;
 }
 
Have we thought about secure vault too?

Yes, we resolve all secure valut values and system property values in deployment.yaml before generating bean class.

Thanks
--

Danesh Kuruppu

Senior Software Engineer | WSO2

Email: [hidden email]

Mobile: <a href="tel:%2B94%20%2877%29%201690552" value="+94771690552" target="_blank">+94 (77) 1690552
Web: WSO2 Inc



_______________________________________________
Architecture mailing list
[hidden email]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture




--
Rukshan Chathuranga.
Software Engineer.
WSO2, Inc.



--

Danesh Kuruppu

Senior Software Engineer | WSO2

Email: [hidden email]

Mobile: +94 (77) 1690552
Web: WSO2 Inc



_______________________________________________
Architecture mailing list
[hidden email]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Carbon C5 - Server Configuration Model

Dilan Udara Ariyaratne
Hi Danesh,

Referring to the following,

@Configuration(namespace = "wso2.carbon", description = "Carbon Configuration Parameters")
public class CarbonConfiguration {

@Element(description = "value to uniquely identify a server", required = true)
private String id = "carbon-kernel";

@Element(description = "server name")
private String name = "WSO2 Carbon Kernel";

@Element(description = "server version")
private String version = "5.2.0";
...
}

In a developer's perspective, it would be more meaningful to define any default value as a separate CONSTANT in the code level and
set any bean property similar to above with such a constant for better readability.

For ex:
@Configuration(namespace = "wso2.carbon", description = "Carbon Configuration Parameters")
public class CarbonConfiguration {

@Element(description = "value to uniquely identify a server", required = true)
private String id = CarbonConfigurationConstants.DEFAULT_ID;
@Element(description = "server name")
private String name = CarbonConfigurationConstants.DEFAULT_NAME;
@Element(description = "server version")
private String version = CarbonConfigurationConstants.DEFAULT_VERSION;
...
}

In the meantime, also have the following question.

If all user-configurable properties are not readily available in the .yaml file by default, how would a user know which
properties are configurable and which are not ?

Thanks,
Dilan.

Dilan U. Ariyaratne
Senior Software Engineer
WSO2 Inc.
Mobile: +<a href="tel:%2B94766405580" value="+94766405580" target="_blank">94766405580
lean . enterprise . middleware


On Mon, Nov 28, 2016 at 10:58 AM, Danesh Kuruppu <[hidden email]> wrote:
Hi Rukshan,

No. We are going to include this in next kernel release(5.2.0).

Thanks
Danesh

On Mon, Nov 28, 2016 at 10:26 AM, Rukshan Premathunga <[hidden email]> wrote:
Hi Danesh,

Is this feature is available now? if so can you mention the kernel version please?

Thanks and Regards

On Tue, Nov 22, 2016 at 12:22 PM, Danesh Kuruppu <[hidden email]> wrote:
Hi Nuwan,

Can you also provide an example bean class for the netty listener? That would make it clear how the bean class and its nested classes would be annotated when array elements come into play.

Please check TransportsConfiguration sample below. We need to mention the default values of an array or collection in class constructor as below.
@Configuration(namespace = "wso2.transports.netty", description = "Netty Transport Configurations")
public class TransportsConfiguration {

//default values of an array or collection need to mention in class constructor
public TransportsConfiguration() {
ListenerConfiguration listenerConfiguration = ListenerConfiguration();
listenerConfigurations = new HashSet<>();
listenerConfigurations.add(listenerConfiguration);

SenderConfiguration senderConfiguration = SenderConfiguration();
senderConfigurations = new HashSet<>();
senderConfigurations.add(senderConfiguration);

transportProperties = new HashSet<>();
}

@Element(description = "transport properties")
private Set<TransportProperty> transportProperties = Collections.EMPTY_SET;

@Element(description = "listener configurations")
private Set<ListenerConfiguration> listenerConfigurations;

@Element(description = "sender configurations")
private Set<SenderConfiguration> senderConfigurations;
 }
 
Have we thought about secure vault too?

Yes, we resolve all secure valut values and system property values in deployment.yaml before generating bean class.

Thanks
--

Danesh Kuruppu

Senior Software Engineer | WSO2

Email: [hidden email]

Mobile: <a href="tel:%2B94%20%2877%29%201690552" value="+94771690552" target="_blank">+94 (77) 1690552
Web: WSO2 Inc



_______________________________________________
Architecture mailing list
[hidden email]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture




--
Rukshan Chathuranga.
Software Engineer.
WSO2, Inc.



--

Danesh Kuruppu

Senior Software Engineer | WSO2

Email: [hidden email]

Mobile: <a href="tel:%2B94%20%2877%29%201690552" value="+94771690552" target="_blank">+94 (77) 1690552
Web: WSO2 Inc



_______________________________________________
Architecture mailing list
[hidden email]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture



_______________________________________________
Architecture mailing list
[hidden email]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Carbon C5 - Server Configuration Model

Ruwan Abeykoon
Hi Dilan,
-1 moving the default value in the properties to constants, since they are not constants. Most of the values within those defaults will be changed over the time, when we learn more about the system behavior, over many release cycles.

For the propose of readability and maintainability the original code looks better than the suggestion.

i.e
@Element(description = "server version")
private String version = "5.2.0";

is better than
@Element(description = "server version")
private String version = CarbonConfigurationConstants.DEFAULT_VERSION;

Cheers,
Ruwan

On Mon, Nov 28, 2016 at 9:08 PM, Dilan Udara Ariyaratne <[hidden email]> wrote:
Hi Danesh,

Referring to the following,

@Configuration(namespace = "wso2.carbon", description = "Carbon Configuration Parameters")
public class CarbonConfiguration {

@Element(description = "value to uniquely identify a server", required = true)
private String id = "carbon-kernel";

@Element(description = "server name")
private String name = "WSO2 Carbon Kernel";

@Element(description = "server version")
private String version = "5.2.0";
...
}

In a developer's perspective, it would be more meaningful to define any default value as a separate CONSTANT in the code level and
set any bean property similar to above with such a constant for better readability.

For ex:
@Configuration(namespace = "wso2.carbon", description = "Carbon Configuration Parameters")
public class CarbonConfiguration {

@Element(description = "value to uniquely identify a server", required = true)
private String id = CarbonConfigurationConstants.DEFAULT_ID;
@Element(description = "server name")
private String name = CarbonConfigurationConstants.DEFAULT_NAME;
@Element(description = "server version")
private String version = CarbonConfigurationConstants.DEFAULT_VERSION;
...
}

In the meantime, also have the following question.

If all user-configurable properties are not readily available in the .yaml file by default, how would a user know which
properties are configurable and which are not ?

Thanks,
Dilan.

Dilan U. Ariyaratne
Senior Software Engineer
WSO2 Inc.
Mobile: +<a href="tel:%2B94766405580" value="+94766405580" target="_blank">94766405580
lean . enterprise . middleware


On Mon, Nov 28, 2016 at 10:58 AM, Danesh Kuruppu <[hidden email]> wrote:
Hi Rukshan,

No. We are going to include this in next kernel release(5.2.0).

Thanks
Danesh

On Mon, Nov 28, 2016 at 10:26 AM, Rukshan Premathunga <[hidden email]> wrote:
Hi Danesh,

Is this feature is available now? if so can you mention the kernel version please?

Thanks and Regards

On Tue, Nov 22, 2016 at 12:22 PM, Danesh Kuruppu <[hidden email]> wrote:
Hi Nuwan,

Can you also provide an example bean class for the netty listener? That would make it clear how the bean class and its nested classes would be annotated when array elements come into play.

Please check TransportsConfiguration sample below. We need to mention the default values of an array or collection in class constructor as below.
@Configuration(namespace = "wso2.transports.netty", description = "Netty Transport Configurations")
public class TransportsConfiguration {

//default values of an array or collection need to mention in class constructor
public TransportsConfiguration() {
ListenerConfiguration listenerConfiguration = ListenerConfiguration();
listenerConfigurations = new HashSet<>();
listenerConfigurations.add(listenerConfiguration);

SenderConfiguration senderConfiguration = SenderConfiguration();
senderConfigurations = new HashSet<>();
senderConfigurations.add(senderConfiguration);

transportProperties = new HashSet<>();
}

@Element(description = "transport properties")
private Set<TransportProperty> transportProperties = Collections.EMPTY_SET;

@Element(description = "listener configurations")
private Set<ListenerConfiguration> listenerConfigurations;

@Element(description = "sender configurations")
private Set<SenderConfiguration> senderConfigurations;
 }
 
Have we thought about secure vault too?

Yes, we resolve all secure valut values and system property values in deployment.yaml before generating bean class.

Thanks
--

Danesh Kuruppu

Senior Software Engineer | WSO2

Email: [hidden email]

Mobile: <a href="tel:%2B94%20%2877%29%201690552" value="+94771690552" target="_blank">+94 (77) 1690552
Web: WSO2 Inc



_______________________________________________
Architecture mailing list
[hidden email]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture




--
Rukshan Chathuranga.
Software Engineer.
WSO2, Inc.



--

Danesh Kuruppu

Senior Software Engineer | WSO2

Email: [hidden email]

Mobile: <a href="tel:%2B94%20%2877%29%201690552" value="+94771690552" target="_blank">+94 (77) 1690552
Web: WSO2 Inc



_______________________________________________
Architecture mailing list
[hidden email]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture



_______________________________________________
Architecture mailing list
[hidden email]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture




--
Ruwan Abeykoon
Associate Director/Architect,
WSO2, Inc. http://wso2.com 
lean.enterprise.middleware.


_______________________________________________
Architecture mailing list
[hidden email]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Carbon C5 - Server Configuration Model

Dilan Udara Ariyaratne
Hi Ruwan,

The purpose of suggesting to move these default values to CONSTANTS is as follows.
Instead of simply setting a raw value to a bean property, by setting it up via a CONSTANT with a meaningful name like DEFAULT_VERSION brings
the message that unless you set an alternative value via the yaml file, a default value will be set via this CONSTANT.

It's true that a property like version would change from one release to another. But it remains as a CONSTANT for a particular release which we need to understand in my opinion.

Thanks,
Dilan.

Dilan U. Ariyaratne
Senior Software Engineer
WSO2 Inc.
Mobile: +<a href="tel:%2B94766405580" value="+94766405580" target="_blank">94766405580
lean . enterprise . middleware


On Tue, Nov 29, 2016 at 7:27 AM, Ruwan Abeykoon <[hidden email]> wrote:
Hi Dilan,
-1 moving the default value in the properties to constants, since they are not constants. Most of the values within those defaults will be changed over the time, when we learn more about the system behavior, over many release cycles.

For the propose of readability and maintainability the original code looks better than the suggestion.

i.e
@Element(description = "server version")
private String version = "5.2.0";

is better than
@Element(description = "server version")
private String version = CarbonConfigurationConstants.DEFAULT_VERSION;

Cheers,
Ruwan

On Mon, Nov 28, 2016 at 9:08 PM, Dilan Udara Ariyaratne <[hidden email]> wrote:
Hi Danesh,

Referring to the following,

@Configuration(namespace = "wso2.carbon", description = "Carbon Configuration Parameters")
public class CarbonConfiguration {

@Element(description = "value to uniquely identify a server", required = true)
private String id = "carbon-kernel";

@Element(description = "server name")
private String name = "WSO2 Carbon Kernel";

@Element(description = "server version")
private String version = "5.2.0";
...
}

In a developer's perspective, it would be more meaningful to define any default value as a separate CONSTANT in the code level and
set any bean property similar to above with such a constant for better readability.

For ex:
@Configuration(namespace = "wso2.carbon", description = "Carbon Configuration Parameters")
public class CarbonConfiguration {

@Element(description = "value to uniquely identify a server", required = true)
private String id = CarbonConfigurationConstants.DEFAULT_ID;
@Element(description = "server name")
private String name = CarbonConfigurationConstants.DEFAULT_NAME;
@Element(description = "server version")
private String version = CarbonConfigurationConstants.DEFAULT_VERSION;
...
}

In the meantime, also have the following question.

If all user-configurable properties are not readily available in the .yaml file by default, how would a user know which
properties are configurable and which are not ?

Thanks,
Dilan.

Dilan U. Ariyaratne
Senior Software Engineer
WSO2 Inc.
Mobile: +<a href="tel:%2B94766405580" value="+94766405580" target="_blank">94766405580
lean . enterprise . middleware


On Mon, Nov 28, 2016 at 10:58 AM, Danesh Kuruppu <[hidden email]> wrote:
Hi Rukshan,

No. We are going to include this in next kernel release(5.2.0).

Thanks
Danesh

On Mon, Nov 28, 2016 at 10:26 AM, Rukshan Premathunga <[hidden email]> wrote:
Hi Danesh,

Is this feature is available now? if so can you mention the kernel version please?

Thanks and Regards

On Tue, Nov 22, 2016 at 12:22 PM, Danesh Kuruppu <[hidden email]> wrote:
Hi Nuwan,

Can you also provide an example bean class for the netty listener? That would make it clear how the bean class and its nested classes would be annotated when array elements come into play.

Please check TransportsConfiguration sample below. We need to mention the default values of an array or collection in class constructor as below.
@Configuration(namespace = "wso2.transports.netty", description = "Netty Transport Configurations")
public class TransportsConfiguration {

//default values of an array or collection need to mention in class constructor
public TransportsConfiguration() {
ListenerConfiguration listenerConfiguration = ListenerConfiguration();
listenerConfigurations = new HashSet<>();
listenerConfigurations.add(listenerConfiguration);

SenderConfiguration senderConfiguration = SenderConfiguration();
senderConfigurations = new HashSet<>();
senderConfigurations.add(senderConfiguration);

transportProperties = new HashSet<>();
}

@Element(description = "transport properties")
private Set<TransportProperty> transportProperties = Collections.EMPTY_SET;

@Element(description = "listener configurations")
private Set<ListenerConfiguration> listenerConfigurations;

@Element(description = "sender configurations")
private Set<SenderConfiguration> senderConfigurations;
 }
 
Have we thought about secure vault too?

Yes, we resolve all secure valut values and system property values in deployment.yaml before generating bean class.

Thanks
--

Danesh Kuruppu

Senior Software Engineer | WSO2

Email: [hidden email]

Mobile: <a href="tel:%2B94%20%2877%29%201690552" value="+94771690552" target="_blank">+94 (77) 1690552
Web: WSO2 Inc



_______________________________________________
Architecture mailing list
[hidden email]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture




--
Rukshan Chathuranga.
Software Engineer.
WSO2, Inc.



--

Danesh Kuruppu

Senior Software Engineer | WSO2

Email: [hidden email]

Mobile: <a href="tel:%2B94%20%2877%29%201690552" value="+94771690552" target="_blank">+94 (77) 1690552
Web: WSO2 Inc



_______________________________________________
Architecture mailing list
[hidden email]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture



_______________________________________________
Architecture mailing list
[hidden email]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture




--
Ruwan Abeykoon
Associate Director/Architect,
WSO2, Inc. http://wso2.com 
lean.enterprise.middleware.


_______________________________________________
Architecture mailing list
[hidden email]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture



_______________________________________________
Architecture mailing list
[hidden email]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Carbon C5 - Server Configuration Model

Ramith Jayasinghe
to me that makes sense. we started having the same thing since mb v 3.0.0. it even put out a (helpful) warnings during the start up if any configuration is missing in the config file and (default) value server chose to go with.

On Tue, Nov 29, 2016 at 1:18 PM, Dilan Udara Ariyaratne <[hidden email]> wrote:
Hi Ruwan,

The purpose of suggesting to move these default values to CONSTANTS is as follows.
Instead of simply setting a raw value to a bean property, by setting it up via a CONSTANT with a meaningful name like DEFAULT_VERSION brings
the message that unless you set an alternative value via the yaml file, a default value will be set via this CONSTANT.

It's true that a property like version would change from one release to another. But it remains as a CONSTANT for a particular release which we need to understand in my opinion.

Thanks,
Dilan.

Dilan U. Ariyaratne
Senior Software Engineer
WSO2 Inc.
Mobile: +<a href="tel:%2B94766405580" value="+94766405580" target="_blank">94766405580
lean . enterprise . middleware


On Tue, Nov 29, 2016 at 7:27 AM, Ruwan Abeykoon <[hidden email]> wrote:
Hi Dilan,
-1 moving the default value in the properties to constants, since they are not constants. Most of the values within those defaults will be changed over the time, when we learn more about the system behavior, over many release cycles.

For the propose of readability and maintainability the original code looks better than the suggestion.

i.e
@Element(description = "server version")
private String version = "5.2.0";

is better than
@Element(description = "server version")
private String version = CarbonConfigurationConstants.DEFAULT_VERSION;

Cheers,
Ruwan

On Mon, Nov 28, 2016 at 9:08 PM, Dilan Udara Ariyaratne <[hidden email]> wrote:
Hi Danesh,

Referring to the following,

@Configuration(namespace = "wso2.carbon", description = "Carbon Configuration Parameters")
public class CarbonConfiguration {

@Element(description = "value to uniquely identify a server", required = true)
private String id = "carbon-kernel";

@Element(description = "server name")
private String name = "WSO2 Carbon Kernel";

@Element(description = "server version")
private String version = "5.2.0";
...
}

In a developer's perspective, it would be more meaningful to define any default value as a separate CONSTANT in the code level and
set any bean property similar to above with such a constant for better readability.

For ex:
@Configuration(namespace = "wso2.carbon", description = "Carbon Configuration Parameters")
public class CarbonConfiguration {

@Element(description = "value to uniquely identify a server", required = true)
private String id = CarbonConfigurationConstants.DEFAULT_ID;
@Element(description = "server name")
private String name = CarbonConfigurationConstants.DEFAULT_NAME;
@Element(description = "server version")
private String version = CarbonConfigurationConstants.DEFAULT_VERSION;
...
}

In the meantime, also have the following question.

If all user-configurable properties are not readily available in the .yaml file by default, how would a user know which
properties are configurable and which are not ?

Thanks,
Dilan.

Dilan U. Ariyaratne
Senior Software Engineer
WSO2 Inc.
Mobile: +<a href="tel:%2B94766405580" value="+94766405580" target="_blank">94766405580
lean . enterprise . middleware


On Mon, Nov 28, 2016 at 10:58 AM, Danesh Kuruppu <[hidden email]> wrote:
Hi Rukshan,

No. We are going to include this in next kernel release(5.2.0).

Thanks
Danesh

On Mon, Nov 28, 2016 at 10:26 AM, Rukshan Premathunga <[hidden email]> wrote:
Hi Danesh,

Is this feature is available now? if so can you mention the kernel version please?

Thanks and Regards

On Tue, Nov 22, 2016 at 12:22 PM, Danesh Kuruppu <[hidden email]> wrote:
Hi Nuwan,

Can you also provide an example bean class for the netty listener? That would make it clear how the bean class and its nested classes would be annotated when array elements come into play.

Please check TransportsConfiguration sample below. We need to mention the default values of an array or collection in class constructor as below.
@Configuration(namespace = "wso2.transports.netty", description = "Netty Transport Configurations")
public class TransportsConfiguration {

//default values of an array or collection need to mention in class constructor
public TransportsConfiguration() {
ListenerConfiguration listenerConfiguration = ListenerConfiguration();
listenerConfigurations = new HashSet<>();
listenerConfigurations.add(listenerConfiguration);

SenderConfiguration senderConfiguration = SenderConfiguration();
senderConfigurations = new HashSet<>();
senderConfigurations.add(senderConfiguration);

transportProperties = new HashSet<>();
}

@Element(description = "transport properties")
private Set<TransportProperty> transportProperties = Collections.EMPTY_SET;

@Element(description = "listener configurations")
private Set<ListenerConfiguration> listenerConfigurations;

@Element(description = "sender configurations")
private Set<SenderConfiguration> senderConfigurations;
 }
 
Have we thought about secure vault too?

Yes, we resolve all secure valut values and system property values in deployment.yaml before generating bean class.

Thanks
--

Danesh Kuruppu

Senior Software Engineer | WSO2

Email: [hidden email]

Mobile: <a href="tel:%2B94%20%2877%29%201690552" value="+94771690552" target="_blank">+94 (77) 1690552
Web: WSO2 Inc



_______________________________________________
Architecture mailing list
[hidden email]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture




--
Rukshan Chathuranga.
Software Engineer.
WSO2, Inc.



--

Danesh Kuruppu

Senior Software Engineer | WSO2

Email: [hidden email]

Mobile: <a href="tel:%2B94%20%2877%29%201690552" value="+94771690552" target="_blank">+94 (77) 1690552
Web: WSO2 Inc



_______________________________________________
Architecture mailing list
[hidden email]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture



_______________________________________________
Architecture mailing list
[hidden email]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture




--
Ruwan Abeykoon
Associate Director/Architect,
WSO2, Inc. http://wso2.com 
lean.enterprise.middleware.


_______________________________________________
Architecture mailing list
[hidden email]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture



_______________________________________________
Architecture mailing list
[hidden email]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture




--
Ramith Jayasinghe
Technical Lead
WSO2 Inc., http://wso2.com
lean.enterprise.middleware

E: [hidden email]
P: +94 777542851

_______________________________________________
Architecture mailing list
[hidden email]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Carbon C5 - Server Configuration Model

Abimaran Kugathasan
In reply to this post by Danesh Kuruppu
Hi Danesh,

On Mon, Nov 21, 2016 at 11:32 PM, Danesh Kuruppu <[hidden email]> wrote:
Hi all,

In Carbon C5, we are going to introduce new global configuration model where we have only one configuration file for all server configurations. So that user have to maintain only one config file for a server.

With New Configuration Model,
  • Global configuration file (deployment.yaml) includes minimal sets of configurations which need to override very often by default (e.g: server ports etc).
  • All user settable configurations must have default values and they are burnt into compile codes.
  • Any default configuration can overridden by adding the particular configuration to the global configuration file(deployment.yaml).
  • Defining all configurations in the configuration file in not required. add only if we need to override the default value.
  • If configurations are not specified in the configuration file, values defined in the bean class will apply by default.
In global configuration file (deployment.yaml),
  • Each component will have their own configurations with a unique namespace (e.g: wso2.carbon, wso2.transports.netty etc) and it will be a fragment of deployment.yaml file. Please find the sample file below.
  • At runtime, the relevant config bean will be generated by overriding the default values specified in bean class with values mentioned in deployment.yaml file.

Who will generate the relevant config beans? If it's by kernel, how does the kernel knows a bean from a product component? Will this lead to a cyclic dependency like product component should depend on kernel and the kernel should know the the product component to find the relevant config bean?
 
Sample file looks like,
  # Carbon Configuration Parameters
wso2.carbon:
id: carbon-kernel
version: 5.2.0-SNAPSHOT
ports:
offset: 0
...

# Netty Transport Configurations
wso2.transports.netty:
listeners:
- id: msf4j-http
host: 127.0.0.1
port: 8080
bossThreadPoolSize: 2
workerThreadPoolSize: 250
parameters:
- name: "executor.workerpool.size"
value: 60
...
Along with the above design, we are going to introduce new annotation model to the configuration beans. So each component will have its configuration defined as one or more Java beans annotated with the following annotations
  • org.wso2.carbon.kernel.annotations.Configuration - Class level annotation, This corresponds to a configuration bean to be used by a component
  • org.wso2.carbon.kernel.annotations.Element - Field level annotation, This corresponds to a fields of the class
  • org.wso2.carbon.kernel.annotations.Ignore - Field level annotation, This is to specify that field needs to be ignored when the configuration is generated
Sample bean class looks like,
@Configuration(namespace = "wso2.carbon", description = "Carbon Configuration Parameters")
public class CarbonConfiguration {

@Element(description = "value to uniquely identify a server", required = true)
private String id = "carbon-kernel";

@Element(description = "server name")
private String name = "WSO2 Carbon Kernel";

@Element(description = "server version")
private String version = "5.2.0";

@Ignore
private String tenant = Constants.DEFAULT_TENANT;
...
}
So we are going to generate the relevant segment of the configuration file(for documentation purposes) automatically at compile time by reading above annotations and default values.

If anyone needs to override the default value, He needs to copy the particular segment of the configuration to the deployment.yaml and change the value.

Appreciate your input on this.

Thanks
--

Danesh Kuruppu

Senior Software Engineer | WSO2

Email: [hidden email]

Mobile: <a href="tel:%2B94%20%2877%29%201690552" value="+94771690552" target="_blank">+94 (77) 1690552
Web: WSO2 Inc



_______________________________________________
Architecture mailing list
[hidden email]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture




--
Thanks
Abimaran Kugathasan
Senior Software Engineer - API Technologies

Mobile : +94 773922820

    


_______________________________________________
Architecture mailing list
[hidden email]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Carbon C5 - Server Configuration Model

Danesh Kuruppu
Hi Abimaran,

Kernel going to provide the relevant config object. There will be an osgi service to provide relevant object for the given bean class. Kernel doesn't need to know exact bean class. We use reflection to generate the bean class. Kernel will not dependent on any product component.

Thanks
Danesh

On Tue, Nov 29, 2016 at 10:23 PM, Abimaran Kugathasan <[hidden email]> wrote:
Hi Danesh,

On Mon, Nov 21, 2016 at 11:32 PM, Danesh Kuruppu <[hidden email]> wrote:
Hi all,

In Carbon C5, we are going to introduce new global configuration model where we have only one configuration file for all server configurations. So that user have to maintain only one config file for a server.

With New Configuration Model,
  • Global configuration file (deployment.yaml) includes minimal sets of configurations which need to override very often by default (e.g: server ports etc).
  • All user settable configurations must have default values and they are burnt into compile codes.
  • Any default configuration can overridden by adding the particular configuration to the global configuration file(deployment.yaml).
  • Defining all configurations in the configuration file in not required. add only if we need to override the default value.
  • If configurations are not specified in the configuration file, values defined in the bean class will apply by default.
In global configuration file (deployment.yaml),
  • Each component will have their own configurations with a unique namespace (e.g: wso2.carbon, wso2.transports.netty etc) and it will be a fragment of deployment.yaml file. Please find the sample file below.
  • At runtime, the relevant config bean will be generated by overriding the default values specified in bean class with values mentioned in deployment.yaml file.

Who will generate the relevant config beans? If it's by kernel, how does the kernel knows a bean from a product component? Will this lead to a cyclic dependency like product component should depend on kernel and the kernel should know the the product component to find the relevant config bean?
 
Sample file looks like,
  # Carbon Configuration Parameters
wso2.carbon:
id: carbon-kernel
version: 5.2.0-SNAPSHOT
ports:
offset: 0
...

# Netty Transport Configurations
wso2.transports.netty:
listeners:
- id: msf4j-http
host: 127.0.0.1
port: 8080
bossThreadPoolSize: 2
workerThreadPoolSize: 250
parameters:
- name: "executor.workerpool.size"
value: 60
...
Along with the above design, we are going to introduce new annotation model to the configuration beans. So each component will have its configuration defined as one or more Java beans annotated with the following annotations
  • org.wso2.carbon.kernel.annotations.Configuration - Class level annotation, This corresponds to a configuration bean to be used by a component
  • org.wso2.carbon.kernel.annotations.Element - Field level annotation, This corresponds to a fields of the class
  • org.wso2.carbon.kernel.annotations.Ignore - Field level annotation, This is to specify that field needs to be ignored when the configuration is generated
Sample bean class looks like,
@Configuration(namespace = "wso2.carbon", description = "Carbon Configuration Parameters")
public class CarbonConfiguration {

@Element(description = "value to uniquely identify a server", required = true)
private String id = "carbon-kernel";

@Element(description = "server name")
private String name = "WSO2 Carbon Kernel";

@Element(description = "server version")
private String version = "5.2.0";

@Ignore
private String tenant = Constants.DEFAULT_TENANT;
...
}
So we are going to generate the relevant segment of the configuration file(for documentation purposes) automatically at compile time by reading above annotations and default values.

If anyone needs to override the default value, He needs to copy the particular segment of the configuration to the deployment.yaml and change the value.

Appreciate your input on this.

Thanks
--

Danesh Kuruppu

Senior Software Engineer | WSO2

Email: [hidden email]

Mobile: <a href="tel:%2B94%20%2877%29%201690552" value="+94771690552" target="_blank">+94 (77) 1690552
Web: WSO2 Inc



_______________________________________________
Architecture mailing list
[hidden email]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture




--
Thanks
Abimaran Kugathasan
Senior Software Engineer - API Technologies

Mobile : <a href="tel:+94%2077%20392%202820" value="+94773922820" target="_blank">+94 773922820

    




--

Danesh Kuruppu

Senior Software Engineer | WSO2

Email: [hidden email]

Mobile: +94 (77) 1690552
Web: WSO2 Inc



_______________________________________________
Architecture mailing list
[hidden email]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Carbon C5 - Server Configuration Model

Danesh Kuruppu
In reply to this post by Dilan Udara Ariyaratne
Hi Dilan,

If all user-configurable properties are not readily available in the .yaml file by default, how would a user know which
properties are configurable and which are not ?

All the configurable properties and their default values will be documented. We are going to create this config document automatically by reading the config bean class (using maven plugin).
We need to decide whether we pack those config documents in the product or add to central location (doc page etc)

Thanks
--

Danesh Kuruppu

Senior Software Engineer | WSO2

Email: [hidden email]

Mobile: +94 (77) 1690552
Web: WSO2 Inc



_______________________________________________
Architecture mailing list
[hidden email]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Carbon C5 - Server Configuration Model

Jayanga Kaushalya
Hi,

If we are hard-coding default values to the bean class, are those values should be default to the component or to the product which is (frequently) using that component ? If we use default values related to the product then we can use that values directly in the specific product and if some other product is using that component, they have to override it in the deployment.yaml. For example product-is is using component identity-mgt. So what should be the default values for the config files coming from identity-mgt component ? Are those should be defaulted to the product-is related values or to the component related values and product-is should always override them from deployment.yaml.

Thanks! 

Jayanga Kaushalya
Software Engineer
Mobile: <a href="tel:+94%2077%20786%200160" value="+94777860160" target="_blank">+94777860160
WSO2 Inc. | http://wso2.com
lean.enterprise.middleware

On Wed, Nov 30, 2016 at 10:57 AM, Danesh Kuruppu <[hidden email]> wrote:
Hi Dilan,

If all user-configurable properties are not readily available in the .yaml file by default, how would a user know which
properties are configurable and which are not ?

All the configurable properties and their default values will be documented. We are going to create this config document automatically by reading the config bean class (using maven plugin).
We need to decide whether we pack those config documents in the product or add to central location (doc page etc)

Thanks
--

Danesh Kuruppu

Senior Software Engineer | WSO2

Email: [hidden email]

Mobile: <a href="tel:+94%2077%20169%200552" value="+94771690552" target="_blank">+94 (77) 1690552
Web: WSO2 Inc



_______________________________________________
Architecture mailing list
[hidden email]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture



_______________________________________________
Architecture mailing list
[hidden email]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Carbon C5 - Server Configuration Model

Danesh Kuruppu
Hi Jayanga,

it is defaulted to the component. any product which is using the component will get the same default values. If a product need values other than the default value, they have to override it in the deployment.yaml. default values should be component related values, not related for the specific product.

Thanks
Danesh

On Wed, Feb 1, 2017 at 3:58 AM, Jayanga Kaushalya <[hidden email]> wrote:
Hi,

If we are hard-coding default values to the bean class, are those values should be default to the component or to the product which is (frequently) using that component ? If we use default values related to the product then we can use that values directly in the specific product and if some other product is using that component, they have to override it in the deployment.yaml. For example product-is is using component identity-mgt. So what should be the default values for the config files coming from identity-mgt component ? Are those should be defaulted to the product-is related values or to the component related values and product-is should always override them from deployment.yaml.

Thanks! 

Jayanga Kaushalya
Software Engineer
Mobile: <a href="tel:+94%2077%20786%200160" value="+94777860160" target="_blank">+94777860160
WSO2 Inc. | http://wso2.com
lean.enterprise.middleware

On Wed, Nov 30, 2016 at 10:57 AM, Danesh Kuruppu <[hidden email]> wrote:
Hi Dilan,

If all user-configurable properties are not readily available in the .yaml file by default, how would a user know which
properties are configurable and which are not ?

All the configurable properties and their default values will be documented. We are going to create this config document automatically by reading the config bean class (using maven plugin).
We need to decide whether we pack those config documents in the product or add to central location (doc page etc)

Thanks
--

Danesh Kuruppu

Senior Software Engineer | WSO2

Email: [hidden email]

Mobile: <a href="tel:+94%2077%20169%200552" value="+94771690552" target="_blank">+94 (77) 1690552
Web: WSO2 Inc



_______________________________________________
Architecture mailing list
[hidden email]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture





--

Danesh Kuruppu

Senior Software Engineer | WSO2

Email: [hidden email]

Mobile: +94 (77) 1690552
Web: WSO2 Inc



_______________________________________________
Architecture mailing list
[hidden email]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
12
Loading...