public boolean decode(final String in) {
        String[] strs = in.split(SEPARATOR);
        if (strs.length >= 5) {
            this.topicName = strs[0];

            this.readQueueNums = Integer.parseInt(strs[1]);

            this.writeQueueNums = Integer.parseInt(strs[2]);

            this.perm = Integer.parseInt(strs[3]);

            this.topicFilterType = TopicFilterType.valueOf(strs[4]);

            if (strs.length >= 6) {
                try {
                    this.attributes = JSON.parseObject(strs[5], ATTRIBUTES_TYPE_REFERENCE.getType());
                } catch (Exception e) {
                    // ignore exception when parse failed, cause map's key/value can have ' ' char.
                }
            }

            return true;
        }

        return false;
    }
@Test
    public void testDecode() {
        String encode = "topic 8 8 6 SINGLE_TAG {\"message.type\":\"FIFO\"}";
        TopicConfig decodeTopicConfig = new TopicConfig();
        decodeTopicConfig.decode(encode);

        TopicConfig topicConfig = new TopicConfig();
        topicConfig.setTopicName(topicName);
        topicConfig.setReadQueueNums(queueNums);
        topicConfig.setWriteQueueNums(queueNums);
        topicConfig.setPerm(perm);
        topicConfig.setTopicFilterType(topicFilterType);
        topicConfig.setTopicMessageType(TopicMessageType.FIFO);

        assertThat(decodeTopicConfig).isEqualTo(topicConfig);
    }