On Aug 10, 2013 7:14 AM, "Isuru Perera" <[email protected]> wrote: > > Hi all, > > > On Thu, Aug 8, 2013 at 9:13 AM, Isuru Perera <[email protected]> wrote: >> >> 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. > > I would like to start working on this. (I think it's better to remove MB features from Cloud Controller and make it more light-weight. Right now it takes about 1 minute to start). >
This is a PaaS and you do not do frequent restarts etc. Hence, IMO server start up time isn't a that critical concern. > We can then allow users to use any MB. Let's see whether we can use ActiveMQ and RabbitMQ > Your statement is misleading. We don't need to remove WSO2 MB features from CC in order to support other MBs. In fact the sole purpose of the email of mine was to introduce this extension point. IMO for the time being we just need to focus on using this extension point and provide support to other MBs. > I think this will not be a considerable effort. > > Suggestions? >> >> >> 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 <[email protected]> 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 > > > > > -- > Isuru Perera > about.me/chrishantha
