|
||||||||||
上一个类 下一个类 | 框架 无框架 | |||||||||
摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 |
java.lang.Object com.taobao.metamorphosis.Message
public class Message
A message with topic and data,a string attribute is optional.
构造方法摘要 | |
---|---|
Message(String topic,
byte[] data)
|
|
Message(String topic,
byte[] data,
String attribute)
|
方法摘要 | |
---|---|
boolean |
equals(Object obj)
|
String |
getAttribute()
Returns the message's attribute,may be null. |
byte[] |
getData()
Returns message's payload |
long |
getId()
Returns the message's id.If it was sent success,the message id would be returned by broker,otherwise is zero. |
Partition |
getPartition()
Returns message's partition in broker,if it was sent fail,it would be null. |
String |
getTopic()
Returns message's topic |
boolean |
hasAttribute()
Returns whether the message has an attribute. |
int |
hashCode()
|
boolean |
isOrdered()
已过时。 |
boolean |
isReadOnly()
Returns whether the message is readonly. |
void |
setAttribute(String attribute)
Set message's attribute |
void |
setData(byte[] data)
Set the message's payload |
void |
setReadOnly(boolean readOnly)
Set the message to be readonly,but metamorphosis client and server could modify message's id,flag,partition.The readonly state is transient,it will not be persist in broker. |
void |
setRollbackOnly()
Set message to be in rollback only state.The state is transient,it's only valid in current message instance. |
void |
setTopic(String topic)
Set message's topic,if you want to send it,you must publish it at first with MessageProducer. |
从类 java.lang.Object 继承的方法 |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
构造方法详细信息 |
---|
public Message(String topic, byte[] data)
public Message(String topic, byte[] data, String attribute)
方法详细信息 |
---|
public void setRollbackOnly()
public boolean isReadOnly()
public void setReadOnly(boolean readOnly)
readOnly
- public boolean hasAttribute()
@Deprecated public boolean isOrdered()
public long getId()
public String getAttribute()
public void setAttribute(String attribute)
attribute
- public void setTopic(String topic)
topic
- MessageProducer.publish(String)
public void setData(byte[] data)
data
- public String getTopic()
public byte[] getData()
public int hashCode()
Object
中的 hashCode
public boolean equals(Object obj)
Object
中的 equals
public Partition getPartition()
|
||||||||||
上一个类 下一个类 | 框架 无框架 | |||||||||
摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 |