org.nofdev.topic.TopicMessage.groovy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of service-topic-consumer Show documentation
Show all versions of service-topic-consumer Show documentation
The basic componet of Nofdev Topic framework
package org.nofdev.topic
import groovy.transform.CompileStatic
/**
* Created by Liutengfei on 2016/5/6 0006.
*/
@CompileStatic
class TopicMessage {
Map headers
T payload
void addHeader(String key, String value) {
if (this.headers) {
this.headers.put(key, value)
} else {
this.headers = new HashMap()
this.headers.put(key, value)
}
}
}