有demo演示获取这些message的属性的代码吗?

这些信息都可以从consumer接收到的Message对象中获取:

  PulsarClient client = PulsarClient.builder()
                .serviceUrl(brokerUrl).lookupTimeout(60000,TimeUnit.MILLISECONDS)
                .build();
  Consumer<byte[]> consumer = pulsarClient.newConsumer()
    .topic("persistent://tenant/namespace/topic")
    .subscriptionName("sub_topic")
    .subscriptionType(SubscriptionType.Shared)
    .subscribe();

  while (true) {
                Message<byte[]> message = consumer.receive();

                byte[] payload = message.getData();
                String key = message.getKey();
                Map<String, String> prop = message.getProperties();
                String produceName = message.getProducerName();
                String topicName = message.getTopicName();
                byte[] version = message.getSchemaVersion();
                long sequenceId = message.getSequenceId();
                MessageId messageId = message.getMessageId();
                long publishTime = message.getPublishTime();
                long eventTime = message.getEventTime();

            }