Package org.acemq.amqp.core
Class StringCodec
java.lang.Object
org.acemq.amqp.core.StringCodec
- All Implemented Interfaces:
Codec
Reads and writes UTF-8 text.
Dependency free, so the core has a working codec whatever else is on the classpath. Structured payloads belong in JSON or a schema-aware format.
An object that is not text is refused rather than written out. This used to call
String.valueOf, which turned an object with no toString into
OrderPlaced@4b1210ee on the wire: published, confirmed, and useless to whoever read
it, with nothing anywhere reporting a problem. A publish that cannot mean what the caller
intended should fail at the publish.
-
Constructor Details
-
StringCodec
public StringCodec()
-
-
Method Details
-
contentType
- Specified by:
contentTypein interfaceCodec- Returns:
- the content type this codec produces, for example
application/json
-
encode
-
decode
-
canDecode
-