The page documents the current (trunk 2016-11-04, r1767914) behaviour of the WMC's message preview feature under the following test cases.
| Test Case | Message |
|---|---|
| small text message | JMS TextMessage "hello world" |
| large text message | JMS TextMessage "ABCD" repeated 16383 times (65532 length) |
| small map message | JMS MapMessage one key/value pair of each supported type. String pair value is (1) |
| large map message | JMS Map Message one key/value pair of each supported type. String pair value is (2) |
| small stream message | JMS Stream Message containing pair of each support type. String value is (1) |
| large stream message | JMS Stream Message containing pair of each support type. String value is (2) |
| small object message | JMS Object Message containing List comprising string value (1) and an integer |
| large object message | MS Object Message containing List comprising string value (2) and an integer |
large pdf file | JMS Bytes Message containing a PDF (2102551 bytes) |
(1) String "hello world"
(2) "ABCD" repeated 65535/4 times
| Test Case | Protocol 0-9/0-10 | ||
|---|---|---|---|
| Content Type | On screen preview | Content Download | |
| small text message | text/plain | complete string value | ditto preview |
| large text message | text/plain | truncated string value | complete string value |
| small map message (default) | amqp/map | Table containing name/value pairs Map entry with bytes array value is base64 encoded | The map's contents encoded as a AMQP 0-10 map
|
| large map message (default) | amqp/map | Table containing name/value pairs Map entry with bytes array value is array of ints | |
| small map message (legacy) | jms/map-message | Table containing name/value pairs Map entry with bytes array value is base64 encoded | Each written value is encoded by the TypedBytesContentWriter (2) |
| large map message (legacy) | jms/map-message | Table containing name/value pairs Map entry with bytes array value is array of ints | |
| small stream message | amqp/list | Table containing list values | The list's contents encoded as a AMQP 0-10 list |
| large stream message | amqp/list | Table containing list values | |
| small stream message (default - legacy) | jms/stream-message | No preview | Each written value is encoded by the TypedBytesContentWrite |
| large stream message (default - legacy) | jms/stream-message | No preview | |
| small object message | application/java-object-stream | No preview | Serialised object bytes |
| large object message | application/java-object-stream | No preview | |
large pdf file | application/octet-stream | No preview | the pdf file. |
| Test Case | Protocol 1.0 | ||
|---|---|---|---|
| Content Type | On screen preview | Content Download | |
| small text message | Not present in AMQP 1.0 | No preview present on screen but getContent but returnJson true returns the bytes of the application payload itself. Note Content size reported is the size of the immutable sections, not the size of the application payload. | All the sections that comprise the immutable bare message, encoded in AMQP 1.0
|
| large text message | |||
| small map message | |||
| large map message | |||
| small stream message | |||
| large stream message | |||
| small object message | |||
| large object message | |||
large pdf file | |||
(2) TypedBytesContentWriter is distinct from AMQP value system)
(3) http://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-messaging-v1.0-os.html#section-message-format
Content Download
returnJson is true, JSON is return regardless of the message's MIME type.This will mean:
WMC
I don't see a reasonable way to enable the application payload for AMQP 1.0 messages. The underlying problem is the inability to get the application payload separately from the store. If we wanted a AbstractQueue hack we could do something like the below, but I am not suggesting we do this.
private Content createMessageContent(final MessageReference<?> messageReference,
final boolean returnJson,
final long limit,
final boolean decompressBeforeLimiting)
...
if (serverMessage.getClass().endsWith("1_0"))
{
// Convert to internal message
return new MessageContent
{
// Stream the InternalMessage's content payload to the OutputStream
}
}
else
{
return new MessageContent(messageReference, limit, decompressBeforeLimiting);
}
|
I don't much like the getMessageContent's limit argument nor the ability to trim a structured message to provide a shortened by syntactically legal JSON response. As a user I think I would find the behaviour surprising.
I think I would have preferred that the REST API implemented RFC 7233 Ranges, and the REST API have the responsibility to chunk the response from getMessageContent. Chunks would not necessarily be syntactically valid JSON. The client would need to intercept the "206 Partial Content" response and know that the response is incomplete. In this case, the client would fallback back on showing a hex dump style preview of the raw content bytes itself.
The getMessageContent API would have no knowledge of chunking.
https://tools.ietf.org/rfc/rfc7233.txt