@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 testIssue3502() throws Exception {
        // https://github.com/Graylog2/graylog2-server/issues/3502
        final RawMessage rawMessage = buildRawMessage("<6>0 2017-02-15T16:01:07.000+01:00 hostname test - - -  test 4");
        final Message message = codec.decode(rawMessage);

        assertNotNull(message);
        assertEquals("test 4", message.getMessage());
        assertEquals(new DateTime(2017, 2, 15, 15, 1, 7, DateTimeZone.UTC), message.getTimestamp());
        assertEquals("hostname", message.getSource());
        assertEquals(6, message.getField("level"));
        assertEquals("kernel", message.getField("facility"));
        assertEquals("test", message.getField("application_name"));
        assertEquals(0, message.getField("facility_num"));
    }