On Thu, Nov 21, 2013 at 9:36 PM, Udara Liyanage <[email protected]> wrote:

> Hi,
>
> In the auto-scaler we have implemented chain of responsibility to process
> incoming messages/events from cloud controller.
> For instance when a cluster is created,
>
> * cc create a ClusterCreated event object
> * Convert the object to a json message
> * Set JMS header property which has the value equals to the class name of
> the event,ClusterCreated in this case.
>
> Then from the receiving end, auto scaler knows the class of the incoming
> message. Then AS send the message thru processer chain. Then AS can convert
> it to corresponding object since it knows the class the message is
> converted from.
>

This model is explicitly needed because we need to identify and ignore full
topology after first time without touching the message body.

But in CEP events, all the events are necessary to process. So i think this
model is fine.

>  Above is working fine. However when CEP sends the messages to AS, there
> is not JMS header since CEP doesn't has the ability to set custom headers
> to outgoing JMS messages. As a result AS cannot identify the class the
> message was converted from. As a work around the json message conversion is
> hard coded with attributes names it should receive (clusterid,value...).
> This is somewhat OK as long as only one message type is there. When there
> are multiple message types this becomes harder to maintain.
>
> Any better way of handling messages received from CEP?
>
>
> Touched, not typed. Erroneous words are a feature, not a typo.
>



-- 
--
Lahiru Sandaruwan
Software Engineer,
Platform Technologies,
WSO2 Inc., http://wso2.com
lean.enterprise.middleware

email: [email protected] cell: (+94) 773 325 954
blog: http://lahiruwrites.blogspot.com/
twitter: http://twitter.com/lahirus
linked-in: http://lk.linkedin.com/pub/lahiru-sandaruwan/16/153/146

Reply via email to