stratos-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Isuru Perera <chrishan...@gmail.com>
Subject Re: Cloud Controller - Create an extension point to attach different configuration (topology) publishers
Date Thu, 08 Aug 2013 03:43:09 GMT
Hi,

+1 for the approach!

I think this is a good start to remove Message Broker features in Cloud
Controller eventually.

Perhaps we could modify the default implementation to be more generic as we
could use AMQP.

As you said, we could also have generic subscriber in ELB and Stratos
Controller.

I would like to see the code in Apache Git. :)

Thanks!

Best Regards,


On Wed, Aug 7, 2013 at 10:35 PM, Nirmal Fernando <nirmal070125@gmail.com>wrote:

> Hi All,
>
> I worked on the $subject as and when I got time. And believe that I
> clearly separated out and provided an extension point to add any custom
> topology publisher.
>
> While doing this I had to change the current configuration of topology
> publisher as below:
>
>    * <topologySync enable="true">
>         <!-- properties related to topology syncher -->
>         <property name="className"
> value="org.apache.stratos.cloud.controller.ABC"/>
>         <property name="mbServerUrl" value="localhost:5674"/>
>         <property name="cron" value="1 * * * * ? *"/>
>     </topologySync>*
>
>
> If you want to plug a new implementation instead of using the default
> implementation (WSO2MBTopologyPublisher), you should extend the following
> abstract class and configure it using a property (eg: *<property
> name="className" value="org.apache.stratos.cloud.controller.ABC"/>)*.
>
> *package org.apache.stratos.cloud.controller.interfaces;
>
> /**
>  * All custom implementations of Topology Publisher should extend this
> abstract class.
>  */
> public abstract class TopologyPublisher {
>
>     /**
>      * This operation will be called once in order to initialize this
> publisher.
>      */
>     public abstract void init();
>
>     /**
>      * When a message is ready to be published to a certain topic, this
> operation will be called.
>      * @param topicName name of the topic to be published.
>      * @param message message to be published.
>      */
>     public abstract void publish(String topicName, String message);
>
>     /**
>      * Cron expression which explains the frequency that the topology
> publishing happens.
>      * @return cron expression
>      */
>     public abstract String getCron();
>
> }*
>
> You have the freedom to get any necessary parameters for your custom
> topology publisher implementation, due to the nature of the configuration
> shown above. Any number of properties are allowed and those can be
> retrieved via the object model.
>
> eg:
>
>         *TopologyConfig config = FasterLookUpDataHolder.getInstance()
>                 .getTopologyConfig();
>         String cron =
> config.getProperty(CloudControllerConstants.CRON_ELEMENT);*
>
> With this extension point in hand, you can easily make Cloud Controller to
> publish topology information into another topic provider (Qpid etc.).
>
> *I invite you to leverage this capability and help Apache Stratos to be
> compatible with other message broker implementations.
>
> *
> *Thanks.
> *
>
> PS: We need the same kind of extensibility in the subscriber side. I will
> have a look on to it too.
>
> --
> Best Regards,
> Nirmal
>
> C.S.Nirmal J. Fernando
> Senior Software Engineer,
> WSO2 Inc.
>
> Blog: http://nirmalfdo.blogspot.com/
>



-- 
Isuru Perera
about.me/chrishantha

Mime
View raw message