Hi All,

In Apache Stratos (incubating) 4.0.0 we are using WSO2 CEP for aggregating
statistics events sent by load balancers and cartridge agents (agents in VM
instances). The aggregated values are used by the Autoscaler for taking
autoscaling decisions.

Here the events are sent to CEP using the default input adapter (via
Thrift) and the aggregated events are sent to an AMQP based message broker
using the JMS Output Adapter. Event formatters have been used for defining
the formats of the output messages.

*A Sample Event Formatter:*
<?xml version="1.0" encoding="UTF-8"?>
<eventFormatter name="AverageRequestsInflightEventFormatter"
  statistics="disable" trace="enable" xmlns="
http://wso2.org/carbon/eventformatter";>
  <from streamName="average_in_flight_requests" version="1.0.0"/>
  <mapping customMapping="enable" type="json">

<inline>{"average_in_flight_requests":{"cluster_id":"{{cluster_id}}","network_partition_id":"{{network_partition_id}}","value":"{{count}}"}}</inline>
  </mapping>
  <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
    <property
name="transport.jms.Destination">summarized-health-stats</property>
  </to>
</eventFormatter>

The above is a sample event formatter which defines an aggregated event.
Similarly there is a collection of events sent by CEP to the message
broker. For each event there is an event formatter defined.


*The Requirement:*
Here there is a requirement to include a set of AMQP Properties [1] in the
output message. These properties may include name value pairs specific for
each event:

*A Sample AMQP Message*
Message Properties:
event_class_name:
org.apache.stratos.messaging.event.health.stat.AverageInFlightRequests

Message Body:
{"average_in_flight_requests":{"cluster_id":"{{cluster_id}}","network_partition_id":"{{network_partition_id}}","value":"{{count}}"}}


*The Proposal:*
As I understood this functionality is not supported by the JMS Output
Adapter at the moment and I think it's logical since AMQP features should
not be included in JMS Output Adapter.

As a solution to this requirement I would like to implement an AMQP Output
Adapter on top of the JMS Output Adapter to support this functionality [2].
I will send more implementation design details in another mail as I
progress.

Really appreciate your thoughts on this.

[1]
http://en.wikipedia.org/wiki/Advanced_Message_Queuing_Protocol#Message_format
[2] http://docs.wso2.org/display/CEP300/Output+Event+Adaptors


Many Thanks
-- 
*Imesh Gunaratne*
Technical Lead
WSO2 Inc: http://wso2.com
T: +94 11 214 5345 M: +94 77 374 2057
W: http://imesh.gunaratne.org
Lean . Enterprise . Middleware
_______________________________________________
Architecture mailing list
Architecture@wso2.org
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture

Reply via email to