This is a proposal to develop an easy to use, readable Anootation based
Data publisher for BAM.
When using the AsyncDataPublisher / LoadBalancingDataPublisher, the
programmer must do a significant amount of boilerplate work before he
publish data to the stream. See [1].
This will be really easy if we can have annotation based data publisher
which can be used in the following way.
We write a POJO, annotated with Some Stream Meta Data.
*Example:*
@DataStream(name="stat.data.stream", version="1.0.0", nickName="nick name",
description="the description")
public class StatDataStreamEvent{
@Column(name="serverName", order=2)
private String serverName;
@Column(order = 1) // no column name defined. so the name will be
timestamp
private long timestamp;
@Column(name="id", type=DataType.STRING, order = 3) // the column data
type is String though the field is int. (example only)
private int statId;
// getters and setters
....
....
}
*Publishing:*
StatDataStreamEvent event = new StatDataStreamEvent();
event.setServerName("The server Name");
event.setTimestamp(System.currentTimeMillis());
event.setStatId(5000);
DataPublisher.publish(event);
Please improve this with your valuable ideas.
[1]
http://wso2.com/library/articles/2012/07/creating-custom-agents-publish-events-bamcep/
--
K.D. Chamil Jeewantha
Associate Technical Lead
WSO2, Inc.; http://wso2.com
Mobile: +94716813892
_______________________________________________
Architecture mailing list
[email protected]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture