@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 testDecodeStructuredIssue549() throws Exception {
        final Message message = codec.decode(buildRawMessage(STRUCTURED_ISSUE_549));

        assertNotNull(message);
        assertEquals("RT_FLOW_SESSION_DENY [junos@2636.1.1.1.2.39 source-address=\"1.2.3.4\" source-port=\"56639\" destination-address=\"5.6.7.8\" destination-port=\"2003\" service-name=\"None\" protocol-id=\"6\" icmp-type=\"0\" policy-name=\"log-all-else\" source-zone-name=\"campus\" destination-zone-name=\"mngmt\" application=\"UNKNOWN\" nested-application=\"UNKNOWN\" username=\"N/A\" roles=\"N/A\" packet-incoming-interface=\"reth6.0\" encrypted=\"No\"]", message.getMessage());
        assertEquals(new DateTime("2014-05-01T08:26:51.179Z", DateTimeZone.UTC), ((DateTime) message.getField("timestamp")).withZone(DateTimeZone.UTC));
        assertEquals("1.2.3.4", message.getField("source-address"));
        assertEquals("56639", message.getField("source-port"));
        assertEquals("5.6.7.8", message.getField("destination-address"));
        assertEquals("2003", message.getField("destination-port"));
        assertEquals("None", message.getField("service-name"));
        assertEquals("6", message.getField("protocol-id"));
        assertEquals("0", message.getField("icmp-type"));
        assertEquals("log-all-else", message.getField("policy-name"));
        assertEquals("campus", message.getField("source-zone-name"));
        assertEquals("mngmt", message.getField("destination-zone-name"));
        assertEquals("UNKNOWN", message.getField("application"));
        assertEquals("UNKNOWN", message.getField("nested-application"));
        assertEquals("N/A", message.getField("username"));
        assertEquals("N/A", message.getField("roles"));
        assertEquals("reth6.0", message.getField("packet-incoming-interface"));
        assertEquals("No", message.getField("encrypted"));
        assertEquals(1, message.getField("facility_num"));
    }