Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.ms1.model;
- /**
- * Message object which contains information about topic which this message belongs to
- * and payload (data) of the message sent from any microservice. Payload is declared as Object,
- * as the most generic way to represent the data
- * @author Gordan Pendic
- *
- */
- public class Message {
- /**
- * Data for representing the topic for the specific message
- */
- private String topic;
- /**
- * Data which is contained in the message sent from any microservice
- */
- private Object payload;
- public Message(){}
- public Message(String topic, Object payload) {
- this.topic = topic;
- this.payload = payload;
- }
- public String getTopic() {
- return topic;
- }
- public void setTopic(String topic) {
- this.topic = topic;
- }
- public Object getPayload() {
- return payload;
- }
- public void setPayload(Object payload) {
- this.payload = payload;
- }
- @Override
- public String toString() {
- return "Message [topic=" + topic + ", payload=" + payload + "]";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement