@Nullable
    @Override
    public Message decode(@Nonnull RawMessage rawMessage) {
        final String msg = new String(rawMessage.getPayload(), charset);
        try (Timer.Context ignored = this.decodeTime.time()) {
            final ResolvableInetSocketAddress address = rawMessage.getRemoteAddress();
            final InetSocketAddress remoteAddress;
            if (address == null) {
                remoteAddress = null;
            } else {
                remoteAddress = address.getInetSocketAddress();
            }
            return parse(msg, remoteAddress == null ? null : remoteAddress.getAddress(), rawMessage.getTimestamp());
        }
    }
@Test
    public void testDecodeStructuredIssue845() throws Exception {
        final Message message = codec.decode(buildRawMessage(STRUCTURED_ISSUE_845));

        assertNotNull(message);
        assertEquals("User page 13 requested", message.getMessage());
        assertEquals(new DateTime("2015-01-06T20:56:33.287Z", DateTimeZone.UTC), ((DateTime) message.getField("timestamp")).withZone(DateTimeZone.UTC));
        assertEquals("app-1", message.getField("source"));
        assertEquals(6, message.getField("level"));
        assertEquals("local7", message.getField("facility"));
        assertEquals("::ffff:132.123.15.30", message.getField("ip"));
        assertEquals("{c.corp.Handler}", message.getField("logger"));
        assertEquals("4ot7", message.getField("session"));
        assertEquals("user@example.com", message.getField("user"));
        assertEquals("Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/600.2.5 (KHTML, like Gecko) Version/7.1.2 Safari/537.85.11", message.getField("user-agent"));
        assertEquals("app", message.getField("application_name"));
        assertEquals(23, message.getField("facility_num"));
    }