@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 testDecodeStructuredWithFullMessage() throws Exception {
        when(configuration.getBoolean(SyslogCodec.CK_STORE_FULL_MESSAGE)).thenReturn(true);

        final Message message = codec.decode(buildRawMessage(STRUCTURED));

        assertNotNull(message);
        assertEquals("BOMAn application event log entry", message.getMessage());
        assertEquals(new DateTime("2012-12-25T22:14:15.003Z", DateTimeZone.UTC), ((DateTime) message.getField("timestamp")).withZone(DateTimeZone.UTC));
        assertEquals("mymachine.example.com", message.getField("source"));
        assertEquals(5, message.getField("level"));
        assertEquals("local4", message.getField("facility"));
        assertEquals(STRUCTURED, message.getField("full_message"));
        assertEquals("Application", message.getField("eventSource"));
        assertEquals("1011", message.getField("eventID"));
        assertEquals("3", message.getField("iut"));
        assertEquals("evntslog", message.getField("application_name"));
        assertEquals(20, message.getField("facility_num"));
    }