public interface Message
Represents a generic message in a Message Queue (MQ) system. This interface defines the basic structure and
operations for a message, including retrieving its topic and content.
- Since:
- Java 17+
- Author:
- Kimi Liu
-
Method Details
-
topic
String topic()Retrieves the topic associated with this message. The topic is used to categorize messages and for routing in MQ systems.- Returns:
- The topic of the message as a
String.
-
content
byte[] content()Retrieves the raw content of the message as a byte array. This method provides the message payload in its original binary format.- Returns:
- The message content as a
byte[].
-
content
Retrieves the message content as a string, decoding it using the specified character set. This is a convenience method for converting the byte array content into a readable string.
-