外观
Docker 验证证据
🔨 构建/检查
pulsar-admin topics create🚀 运行/交互
pulsar-client produce → consumedocker-session.out.txt
## status
[cli-tools] $ bin/pulsar-admin brokers healthcheck
ok
[cli-tools] $ bin/pulsar-admin topics stats persistent://public/default/orders-cli
{
"msgRateIn" : 0.0,
"msgThroughputIn" : 0.0,
"msgRateOut" : 0.0,
"msgThroughputOut" : 0.0,
"bytesInCounter" : 0,
"msgInCounter" : 0,
"systemTopicBytesInCounter" : 0,
"bytesOutCounter" : 0,
"msgOutCounter" : 0,
"bytesOutInternalCounter" : 0,
"averageMsgSize" : 0.0,
"msgChunkPublished" : false,
"storageSize" : 0,
"backlogSize" : 0,
"backlogQuotaLimitSize" : 10737418240,
"backlogQuotaLimitTime" : -1,
"oldestBacklogMessageAgeSeconds" : -1,
"publishRateLimitedTimes" : 0,
"earliestMsgPublishTimeInBacklogs" : 0,
"offloadedStorageSize" : 0,
"lastOffloadLedgerId" : 0,
"lastOffloadSuccessTimeStamp" : 0,
"lastOffloadFailureTimeStamp" : 0,
"ongoingTxnCount" : 0,
"abortedTxnCount" : 0,
"committedTxnCount" : 0,
"publishers" : [ ],
"waitingPublishers" : 0,
"subscriptions" : { },
"replication" : { },
"deduplicationStatus" : "Disabled",
"nonContiguousDeletedMessagesRanges" : 0,
"nonContiguousDeletedMessagesRangesSerializedSize" : 0,
"delayedMessageIndexSizeInBytes" : 0,
"compaction" : {
"lastCompactionRemovedEventCount" : 0,
"lastCompactionSucceedTimestamp" : 0,
"lastCompactionFailedTimestamp" : 0,
"lastCompactionDurationTimeInMills" : 0
},
"ownerBroker" : "localhost:8080",
"topicCreationTimeStamp" : 1787498265476,
"lastPublishTimeStamp" : 0
}
## create
[cli-tools] $ bin/pulsar-admin topics create persistent://public/default/orders-cli
## produce
[cli-tools] $ bin/pulsar-client produce -m order-cli-1,order-cli-2,order-cli-3 persistent://public/default/orders-cli
Aug 23, 2026 3:17:52 PM io.opentelemetry.api.GlobalOpenTelemetry maybeAutoConfigureAndSetGlobal
INFO: AutoConfiguredOpenTelemetrySdk found on classpath but automatic configuration is disabled. To enable, run your JVM with -Dotel.java.global-autoconfigure.enabled=true
2026-08-23T15:17:53,012+0000 [pulsar-client-io-1-3] INFO org.apache.pulsar.client.impl.ConnectionPool - [[id: 0x189dbd4a, L:/127.0.0.1:38926 - R:localhost/127.0.0.1:6650]] Connected to server {}
2026-08-23T15:17:53,195+0000 [pulsar-client-io-1-3] INFO org.apache.pulsar.client.impl.ProducerStatsRecorderImpl - Starting Pulsar producer perf with config: {"topicName":"persistent://public/default/orders-cli","producerName":null,"sendTimeoutMs":30000,"blockIfQueueFull":false,"maxPendingMessages":1000,"maxPendingMessagesAcrossPartitions":50000,"messageRoutingMode":"RoundRobinPartition","hashingScheme":"JavaStringHash","cryptoFailureAction":"FAIL","batchingMaxPublishDelayMicros":1000,"batchingPartitionSwitchFrequencyByPublishDelay":10,"batchingMaxMessages":1000,"batchingMaxBytes":131072,"batchingEnabled":true,"chunkingEnabled":false,"chunkMaxMessageSize":-1,"encryptionKeys":[],"compressionType":"NONE","compressMinMsgBodySize":4096,"initialSequenceId":null,"autoUpdatePartitions":true,"autoUpdatePartitionsIntervalSeconds":60,"multiSchema":true,"accessMode":"Shared","lazyStartPartitionedProducers":false,"properties":{},"initialSubscriptionName":null,"replProducer":false,"nonPartitionedTopicExpected":false} {}
2026-08-23T15:17:53,221+0000 [pulsar-client-io-1-3] INFO org.apache.pulsar.client.impl.ProducerStatsRecorderImpl - Pulsar client config: {"serviceUrl":"pulsar://localhost:6650/","serviceUrlQuarantineInitDurationMs":60000,"serviceUrlQuarantineMaxDurationMs":86400000,"authPluginClassName":null,"authParams":null,"authParamMap":null,"originalPrincipal":null,"operationTimeoutMs":30000,"lookupTimeoutMs":30000,"statsIntervalSeconds":60,"numIoThreads":4,"numListenerThreads":4,"connectionsPerBroker":1,"connectionMaxIdleSeconds":60,"useTcpNoDelay":true,"useTls":false,"tlsKeyFilePath":"","tlsCertificateFilePath":"","tlsTrustCertsFilePath":"","tlsAllowInsecureConnection":false,"tlsHostnameVerificationEnable":false,"sslFactoryPlugin":"org.apache.pulsar.common.util.DefaultPulsarSslFactory","sslFactoryPluginParams":null,"concurrentLookupRequest":5000,"maxLookupRequest":50000,"maxLookupRedirects":20,"maxNumberOfRejectedRequestPerConnection":50,"keepAliveIntervalSeconds":30,"connectionTimeoutMs":10000,"requestTimeoutMs":60000,"readTimeoutMs":60000,"autoCertRefreshSeconds":300,"initialBackoffIntervalNanos":100000000,"maxBackoffIntervalNanos":60000000000,"enableBusyWait":false,"listenerName":null,"useKeyStoreTls":false,"sslProvider":null,"tlsKeyStoreType":"JKS","tlsKeyStorePath":"","tlsKeyStorePassword":"*****","tlsTrustStoreType":"JKS","tlsTrustStorePath":"","tlsTrustStorePassword":"*****","tlsCiphers":[],"tlsProtocols":[],"memoryLimitBytes":0,"proxyServiceUrl":null,"proxyProtocol":null,"enableTransaction":false,"dnsLookupBindAddress":null,"dnsLookupBindPort":0,"dnsServerAddresses":[],"socks5ProxyAddress":null,"socks5ProxyUsername":null,"socks5ProxyPassword":null,"description":null,"lookupProperties":{},"tracingEnabled":false,"openTelemetry":null} {}
2026-08-23T15:17:53,234+0000 [pulsar-client-io-1-3] INFO org.apache.pulsar.client.impl.ProducerImpl - [persistent://public/default/orders-cli] [null] Creating producer on cnx [id: 0x189dbd4a, L:/127.0.0.1:38926 - R:localhost/127.0.0.1:6650] {}
2026-08-23T15:17:53,243+0000 [pulsar-client-io-1-3] INFO org.apache.pulsar.client.impl.ProducerImpl - [persistent://public/default/orders-cli] [standalone-0-3] Created producer on cnx [id: 0x189dbd4a, L:/127.0.0.1:38926 - R:localhost/127.0.0.1:6650] {}
2026-08-23T15:17:53,295+0000 [main] INFO org.apache.pulsar.client.impl.ProducerStatsRecorderImpl - [persistent://public/default/orders-cli] [standalone-0-3] --- Publish throughput: 43.37 msg/s --- 0.00 Mbit/s --- Latency: med: 3.000 ms - 95pct: 26.000 ms - 99pct: 26.000 ms - 99.9pct: 26.000 ms - max: 26.000 ms --- BatchSize: med: 1.000 - 95pct: 1.000 - 99pct: 1.000 - 99.9pct: 1.000 - max: 1.000 --- MsgSize: med: 11.000 bytes - 95pct: 11.000 bytes - 99pct: 11.000 bytes - 99.9pct: 11.000 bytes - max: 11.000 bytes --- Ack received rate: 43.37 ack/s --- Failed messages: 0 --- Pending messages: 0 {}
2026-08-23T15:17:53,298+0000 [pulsar-client-io-1-3] INFO org.apache.pulsar.client.impl.ProducerImpl - [persistent://public/default/orders-cli] [standalone-0-3] Closed Producer {}
2026-08-23T15:17:53,300+0000 [main] INFO org.apache.pulsar.client.impl.PulsarClientImpl - Client closing. URL: pulsar://localhost:6650/ {}
2026-08-23T15:17:53,306+0000 [pulsar-client-io-1-3] INFO org.apache.pulsar.client.impl.ClientCnx - [id: 0x189dbd4a, L:/127.0.0.1:38926 ! R:localhost/127.0.0.1:6650] Disconnected {}
2026-08-23T15:17:55,316+0000 [main] INFO org.apache.pulsar.client.cli.PulsarClientTool - 3 messages successfully produced {}
## consume
[cli-tools] $ sh -c timeout -k 5 120 bin/pulsar-client consume -n 3 -s orders-cli-sub --subscription-position Earliest persistent://public/default/orders-cli; rc=$?; if [ $rc -ne 0 ] && [ $rc -ne 124 ]; then exit $rc; fi
Aug 23, 2026 3:17:56 PM io.opentelemetry.api.GlobalOpenTelemetry maybeAutoConfigureAndSetGlobal
INFO: AutoConfiguredOpenTelemetrySdk found on classpath but automatic configuration is disabled. To enable, run your JVM with -Dotel.java.global-autoconfigure.enabled=true
2026-08-23T15:17:57,226+0000 [pulsar-client-io-1-3] INFO org.apache.pulsar.client.impl.ConnectionPool - [[id: 0x60e478e9, L:/127.0.0.1:38930 - R:localhost/127.0.0.1:6650]] Connected to server {}
2026-08-23T15:17:57,420+0000 [pulsar-client-lookup-15-1] INFO org.apache.pulsar.client.impl.ConsumerStatsRecorderImpl - Starting Pulsar consumer status recorder with config: {"topicNames":["persistent://public/default/orders-cli"],"topicsPattern":null,"subscriptionName":"orders-cli-sub","subscriptionType":"Exclusive","subscriptionProperties":null,"subscriptionMode":"Durable","receiverQueueSize":1000,"acknowledgementsGroupTimeMicros":100000,"maxAcknowledgmentGroupSize":1000,"negativeAckRedeliveryDelayMicros":60000000,"negativeAckPrecisionBitCnt":8,"maxTotalReceiverQueueSizeAcrossPartitions":50000,"consumerName":null,"ackTimeoutMillis":0,"tickDurationMillis":1000,"priorityLevel":0,"maxPendingChunkedMessage":10,"autoAckOldestChunkedMessageOnQueueFull":false,"expireTimeOfIncompleteChunkedMessageMillis":60000,"cryptoFailureAction":"FAIL","properties":{},"readCompacted":false,"subscriptionInitialPosition":"Earliest","patternAutoDiscoveryPeriod":60,"regexSubscriptionMode":"PersistentOnly","deadLetterPolicy":null,"retryEnable":false,"autoUpdatePartitions":true,"autoUpdatePartitionsIntervalSeconds":60,"replicateSubscriptionState":false,"resetIncludeHead":false,"batchIndexAckEnabled":true,"ackReceiptEnabled":false,"poolMessages":true,"startPaused":false,"autoScaledReceiverQueueSizeEnabled":false,"topicConfigurations":[],"maxPendingChuckedMessage":10} {}
2026-08-23T15:17:57,444+0000 [pulsar-client-lookup-15-1] INFO org.apache.pulsar.client.impl.ConsumerStatsRecorderImpl - Pulsar client config: {"serviceUrl":"pulsar://localhost:6650/","serviceUrlQuarantineInitDurationMs":60000,"serviceUrlQuarantineMaxDurationMs":86400000,"authPluginClassName":null,"authParams":null,"authParamMap":null,"originalPrincipal":null,"operationTimeoutMs":30000,"lookupTimeoutMs":30000,"statsIntervalSeconds":60,"numIoThreads":4,"numListenerThreads":4,"connectionsPerBroker":1,"connectionMaxIdleSeconds":60,"useTcpNoDelay":true,"useTls":false,"tlsKeyFilePath":"","tlsCertificateFilePath":"","tlsTrustCertsFilePath":"","tlsAllowInsecureConnection":false,"tlsHostnameVerificationEnable":false,"sslFactoryPlugin":"org.apache.pulsar.common.util.DefaultPulsarSslFactory","sslFactoryPluginParams":null,"concurrentLookupRequest":5000,"maxLookupRequest":50000,"maxLookupRedirects":20,"maxNumberOfRejectedRequestPerConnection":50,"keepAliveIntervalSeconds":30,"connectionTimeoutMs":10000,"requestTimeoutMs":60000,"readTimeoutMs":60000,"autoCertRefreshSeconds":300,"initialBackoffIntervalNanos":100000000,"maxBackoffIntervalNanos":60000000000,"enableBusyWait":false,"listenerName":null,"useKeyStoreTls":false,"sslProvider":null,"tlsKeyStoreType":"JKS","tlsKeyStorePath":"","tlsKeyStorePassword":"*****","tlsTrustStoreType":"JKS","tlsTrustStorePath":"","tlsTrustStorePassword":"*****","tlsCiphers":[],"tlsProtocols":[],"memoryLimitBytes":0,"proxyServiceUrl":null,"proxyProtocol":null,"enableTransaction":false,"dnsLookupBindAddress":null,"dnsLookupBindPort":0,"dnsServerAddresses":[],"socks5ProxyAddress":null,"socks5ProxyUsername":null,"socks5ProxyPassword":null,"description":null,"lookupProperties":{},"tracingEnabled":false,"openTelemetry":null} {}
2026-08-23T15:17:57,464+0000 [pulsar-client-io-1-3] INFO org.apache.pulsar.client.impl.ConsumerImpl - [persistent://public/default/orders-cli][orders-cli-sub] Subscribing to topic on cnx [id: 0x60e478e9, L:/127.0.0.1:38930 - R:localhost/127.0.0.1:6650], consumerId 0 {}
2026-08-23T15:17:57,478+0000 [pulsar-client-io-1-3] INFO org.apache.pulsar.client.impl.ConsumerImpl - [persistent://public/default/orders-cli][orders-cli-sub] Subscribed to topic on localhost/127.0.0.1:6650 -- consumer: 0 {}
----- got message -----
publishTime:[1787498273257], eventTime:[0], key:[null], properties:[], content:order-cli-1
----- got message -----
publishTime:[1787498273282], eventTime:[0], key:[null], properties:[], content:order-cli-2
----- got message -----
publishTime:[1787498273287], eventTime:[0], key:[null], properties:[], content:order-cli-3
2026-08-23T15:17:57,576+0000 [pulsar-client-io-1-3] INFO org.apache.pulsar.client.impl.ConsumerImpl - [persistent://public/default/orders-cli] [orders-cli-sub] Closed consumer {}
2026-08-23T15:17:57,577+0000 [main] INFO org.apache.pulsar.client.impl.PulsarClientImpl - Client closing. URL: pulsar://localhost:6650/ {}
2026-08-23T15:17:57,586+0000 [pulsar-client-io-1-3] INFO org.apache.pulsar.client.impl.ClientCnx - [id: 0x60e478e9, L:/127.0.0.1:38930 ! R:localhost/127.0.0.1:6650] Disconnected {}
2026-08-23T15:17:59,602+0000 [main] INFO org.apache.pulsar.client.cli.PulsarClientTool - 3 messages successfully consumed {}
## verify
[cli-tools] $ sh -c bin/pulsar-admin topics stats persistent://public/default/orders-cli && bin/pulsar-admin topics subscriptions persistent://public/default/orders-cli
{
"msgRateIn" : 0.0,
"msgThroughputIn" : 0.0,
"msgRateOut" : 0.0,
"msgThroughputOut" : 0.0,
"bytesInCounter" : 144,
"msgInCounter" : 3,
"systemTopicBytesInCounter" : 0,
"bytesOutCounter" : 144,
"msgOutCounter" : 3,
"bytesOutInternalCounter" : 0,
"averageMsgSize" : 0.0,
"msgChunkPublished" : false,
"storageSize" : 144,
"backlogSize" : 0,
"backlogQuotaLimitSize" : 10737418240,
"backlogQuotaLimitTime" : -1,
"oldestBacklogMessageAgeSeconds" : -1,
"publishRateLimitedTimes" : 0,
"earliestMsgPublishTimeInBacklogs" : 0,
"offloadedStorageSize" : 0,
"lastOffloadLedgerId" : 0,
"lastOffloadSuccessTimeStamp" : 0,
"lastOffloadFailureTimeStamp" : 0,
"ongoingTxnCount" : 0,
"abortedTxnCount" : 0,
"committedTxnCount" : 0,
"publishers" : [ ],
"waitingPublishers" : 0,
"subscriptions" : {
"orders-cli-sub" : {
"msgRateOut" : 0.0,
"msgThroughputOut" : 0.0,
"bytesOutCounter" : 144,
"msgOutCounter" : 3,
"msgRateRedeliver" : 0.0,
"messageAckRate" : 0.0,
"chunkedMessageRate" : 0.0,
"msgBacklog" : 0,
"backlogSize" : 0,
"earliestMsgPublishTimeInBacklog" : 0,
"msgBacklogNoDelayed" : 0,
"blockedSubscriptionOnUnackedMsgs" : false,
"msgDelayed" : 0,
"msgInReplay" : 0,
"unackedMessages" : 0,
"type" : "Exclusive",
"msgRateExpired" : 0.0,
"msgExpired" : 0,
"totalMsgExpired" : 0,
"lastExpireTimestamp" : 0,
"lastConsumedFlowTimestamp" : 1787498277479,
"lastConsumedTimestamp" : 0,
"lastAckedTimestamp" : 0,
"lastMarkDeleteAdvancedTimestamp" : 1787498277580,
"consumers" : [ ],
"isDurable" : true,
"isReplicated" : false,
"allowOutOfOrderDelivery" : false,
"consumersAfterMarkDeletePosition" : { },
"drainingHashesCount" : 0,
"drainingHashesClearedTotal" : 0,
"drainingHashesUnackedMessages" : 0,
"nonContiguousDeletedMessagesRanges" : 0,
"nonContiguousDeletedMessagesRangesSerializedSize" : 0,
"delayedMessageIndexSizeInBytes" : 0,
"subscriptionProperties" : { },
"filterProcessedMsgCount" : 0,
"filterAcceptedMsgCount" : 0,
"filterRejectedMsgCount" : 0,
"filterRescheduledMsgCount" : 0,
"dispatchThrottledMsgEventsBySubscriptionLimit" : 0,
"dispatchThrottledBytesEventsBySubscriptionLimit" : 0,
"dispatchThrottledMsgEventsByTopicLimit" : 0,
"dispatchThrottledBytesEventsByTopicLimit" : 0,
"dispatchThrottledMsgEventsByBrokerLimit" : 0,
"dispatchThrottledBytesEventsByBrokerLimit" : 0,
"replicated" : false,
"durable" : true
}
},
"replication" : { },
"deduplicationStatus" : "Disabled",
"nonContiguousDeletedMessagesRanges" : 0,
"nonContiguousDeletedMessagesRangesSerializedSize" : 0,
"delayedMessageIndexSizeInBytes" : 0,
"compaction" : {
"lastCompactionRemovedEventCount" : 0,
"lastCompactionSucceedTimestamp" : 0,
"lastCompactionFailedTimestamp" : 0,
"lastCompactionDurationTimeInMills" : 0
},
"ownerBroker" : "localhost:8080",
"topicCreationTimeStamp" : 1787498265476,
"lastPublishTimeStamp" : 1787498273287
}
orders-cli-sub