René's URL Explorer Experiment


Title: 订阅的触发时机是什么? · apache/iotdb · Discussion #14620 · GitHub

Open Graph Title: 订阅的触发时机是什么? · apache/iotdb · Discussion #14620

X Title: 订阅的触发时机是什么? · apache/iotdb · Discussion #14620

Description: 订阅的触发时机是什么?

Open Graph Description: 我现在正在测试订阅相关的内容,使用了文档里的示例代码。现在测试的效果是: 当插入第一条数据时(创建Timeseries)会在控制台打印插入的数据。 当重新启动时会打印全部的数据(没设置起止时间) 但是在执行过程中并没有打印新插入的数据。 private void pollConsumer (String topic, String host, Integer port) { final Pr...

X Description: 我现在正在测试订阅相关的内容,使用了文档里的示例代码。现在测试的效果是: 当插入第一条数据时(创建Timeseries)会在控制台打印插入的数据。 当重新启动时会打印全部的数据(没设置起止时间) 但是在执行过程中并没有打印新插入的数据。 private void pollConsumer (String topic, String host, Integer port) { final Pr...

Opengraph URL: https://github.com/apache/iotdb/discussions/14620

X: @github

direct link

Domain: patch-diff.githubusercontent.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"QAPage","mainEntity":{"@type":"Question","name":"订阅的触发时机是什么?","text":"

我现在正在测试订阅相关的内容,使用了文档里的示例代码。现在测试的效果是:
\n当插入第一条数据时(创建Timeseries)会在控制台打印插入的数据。
\n当重新启动时会打印全部的数据(没设置起止时间)
\n但是在执行过程中并没有打印新插入的数据。

\n
    private void pollConsumer (String topic, String host, Integer port) {\n        final Properties config = new Properties();\n        config.put(ConsumerConstant.CONSUMER_ID_KEY, \"c2\");\n        config.put(ConsumerConstant.CONSUMER_GROUP_ID_KEY, \"cg1\");\n\n        final SubscriptionPullConsumer consumer1 = new SubscriptionPullConsumer(config);\n\n        consumer1.open();\n        consumer1.subscribe(topic);\n\n//        Set<String> set = new HashSet<>();\n//        set.add(topic);\n\n        for (int i = 0;i < 100;i++) {\n            LockSupport.parkNanos(500);\n            final List<SubscriptionMessage> messages = consumer1.poll(1000);\n            for (final SubscriptionMessage message : messages) {\n                for (final SubscriptionSessionDataSet dataSet : message.getSessionDataSetsHandler()) {\n                    System.out.println(dataSet.getColumnNames());\n                    System.out.println(dataSet.getColumnTypes());\n                    while (dataSet.hasNext()) {\n                        System.out.println(dataSet.next());\n                        Tablet tablet = dataSet.getTablet();\n                    }\n                }\n            }\n        }\n\n        consumer1.unsubscribe(topic);\n        consumer1.close();\n    }\n
\n

控制台打印

\n
2041 [main] INFO  o.a.i.s.s.c.SubscriptionPullConsumer - SubscriptionPullConsumer SubscriptionPullConsumer{subscribedTopicNames=[topic01], consumerGroupId=cg1, isClosed=false, consumerId=c2, fileSaveDir=E:\\test\\TestUDF\\iotdb-subscription, autoCommit=true} poll empty message from topics [topic01] after 1000 millisecond(s) \n[Time, root.sky.a.temperature]\n[INT64, DOUBLE]\n1735868811188\t-1.0\n1735868817134\t-2.0\n[Time, root.sky.a.temperature]\n[INT64, DOUBLE]\n1735869028109\t-2.0\n1735869030243\t-2.0\n3291 [main] INFO  o.a.i.s.s.c.SubscriptionPullConsumer - SubscriptionPullConsumer SubscriptionPullConsumer{subscribedTopicNames=[topic01], consumerGroupId=cg1, isClosed=false, consumerId=c2, fileSaveDir=E:\\test\\TestUDF\\iotdb-subscription, autoCommit=true} poll empty message from topics [topic01] after 1000 millisecond(s) \n4140 [main] INFO  o.a.i.s.s.c.SubscriptionPullConsumer - SubscriptionPullConsumer SubscriptionPullConsumer{subscribedTopicNames=[topic01], consumerGroupId=cg1, isClosed=false, consumerId=c2, fileSaveDir=E:\\test\\TestUDF\\iotdb-subscription, autoCommit=true} poll empty message from topics [topic01] after 1000 millisecond(s) \n...\n
\n

在循环的过程中仅会在创建 timeseries 时打印新增的数据。

","upvoteCount":1,"answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"

新增的数据在 flush 后会触发订阅,可以在命令行中手动执行 flush 命令观察是否打印了新插入的数据

","upvoteCount":3,"url":"https://github.com/apache/iotdb/discussions/14620#discussioncomment-11722436"}}}

route-pattern/_view_fragments/Voltron::DiscussionsFragmentsController/show/:user_id/:repository/:discussion_number/discussion_layout(.:format)
route-controllervoltron_discussions_fragments
route-actiondiscussion_layout
fetch-noncev2:68428d5d-2b09-8b89-cf69-a1da9fc2ebbf
current-catalog-service-hash9f0abe34da433c9b6db74bffa2466494a717b579a96b30a5d252e5090baea7be
request-idD1BA:66920:1CCBD12:26CED15:6992E8C0
html-safe-nonce99f519f23603cc885a363e7b491bd330f6633583ecb0dcc775d0bd6ff69baf06
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMUJBOjY2OTIwOjFDQ0JEMTI6MjZDRUQxNTo2OTkyRThDMCIsInZpc2l0b3JfaWQiOiI0MTMxODM0MTY2MzA3MzgzNDg4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac6da24c966775b62e268ff589224484b1eb4ad9d88c3bead47cee07b3392bb94b
hovercard-subject-tagdiscussion:7773140
github-keyboard-shortcutsrepository,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/discussions_fragments/discussion_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/Voltron::DiscussionsFragmentsController/show/apache/iotdb/14620/discussion_layout
twitter:imagehttps://opengraph.githubassets.com/68e08c06d330cc2511ee2d5cec9ae54e1756d2537d9b64c81943df2f396789e2/apache/iotdb/discussions/14620
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/68e08c06d330cc2511ee2d5cec9ae54e1756d2537d9b64c81943df2f396789e2/apache/iotdb/discussions/14620
og:image:alt我现在正在测试订阅相关的内容,使用了文档里的示例代码。现在测试的效果是: 当插入第一条数据时(创建Timeseries)会在控制台打印插入的数据。 当重新启动时会打印全部的数据(没设置起止时间) 但是在执行过程中并没有打印新插入的数据。 private void pollConsumer (String topic, String host, Integer port) { final Pr...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None42c603b9d642c4a9065a51770f75e5e27132fef0e858607f5c9cb7e422831a7b
turbo-cache-controlno-preview
go-importgithub.com/apache/iotdb git https://github.com/apache/iotdb.git
octolytics-dimension-user_id47359
octolytics-dimension-user_loginapache
octolytics-dimension-repository_id158975124
octolytics-dimension-repository_nwoapache/iotdb
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id158975124
octolytics-dimension-repository_network_root_nwoapache/iotdb
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release84dcb133269e3cfe6e0296cc85fbacb92cae92bb
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://patch-diff.githubusercontent.com/apache/iotdb/discussions/14620#start-of-content
https://patch-diff.githubusercontent.com/
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fapache%2Fiotdb%2Fdiscussions%2F14620
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fapache%2Fiotdb%2Fdiscussions%2F14620
Sign up https://patch-diff.githubusercontent.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fdiscussions_fragments%2Fdiscussion_layout&source=header-repo&source_repo=apache%2Fiotdb
Reloadhttps://patch-diff.githubusercontent.com/apache/iotdb/discussions/14620
Reloadhttps://patch-diff.githubusercontent.com/apache/iotdb/discussions/14620
Reloadhttps://patch-diff.githubusercontent.com/apache/iotdb/discussions/14620
apache https://patch-diff.githubusercontent.com/apache
iotdbhttps://patch-diff.githubusercontent.com/apache/iotdb
Notifications https://patch-diff.githubusercontent.com/login?return_to=%2Fapache%2Fiotdb
Fork 1.1k https://patch-diff.githubusercontent.com/login?return_to=%2Fapache%2Fiotdb
Star 6.3k https://patch-diff.githubusercontent.com/login?return_to=%2Fapache%2Fiotdb
Code https://patch-diff.githubusercontent.com/apache/iotdb
Issues 409 https://patch-diff.githubusercontent.com/apache/iotdb/issues
Pull requests 200 https://patch-diff.githubusercontent.com/apache/iotdb/pulls
Discussions https://patch-diff.githubusercontent.com/apache/iotdb/discussions
Actions https://patch-diff.githubusercontent.com/apache/iotdb/actions
Wiki https://patch-diff.githubusercontent.com/apache/iotdb/wiki
Security 0 https://patch-diff.githubusercontent.com/apache/iotdb/security
Insights https://patch-diff.githubusercontent.com/apache/iotdb/pulse
Code https://patch-diff.githubusercontent.com/apache/iotdb
Issues https://patch-diff.githubusercontent.com/apache/iotdb/issues
Pull requests https://patch-diff.githubusercontent.com/apache/iotdb/pulls
Discussions https://patch-diff.githubusercontent.com/apache/iotdb/discussions
Actions https://patch-diff.githubusercontent.com/apache/iotdb/actions
Wiki https://patch-diff.githubusercontent.com/apache/iotdb/wiki
Security https://patch-diff.githubusercontent.com/apache/iotdb/security
Insights https://patch-diff.githubusercontent.com/apache/iotdb/pulse
Answered https://patch-diff.githubusercontent.com/apache/iotdb/discussions/14620#discussioncomment-11722436
VGalaxieshttps://patch-diff.githubusercontent.com/VGalaxies
StrongManLi https://patch-diff.githubusercontent.com/StrongManLi
Q&Ahttps://patch-diff.githubusercontent.com/apache/iotdb/discussions/categories/q-a
订阅的触发时机是什么? https://patch-diff.githubusercontent.com/apache/iotdb/discussions/14620#top
StrongManLi https://patch-diff.githubusercontent.com/StrongManLi
Answered https://patch-diff.githubusercontent.com/apache/iotdb/discussions/14620#discussioncomment-11722436
VGalaxieshttps://patch-diff.githubusercontent.com/VGalaxies
Return to tophttps://patch-diff.githubusercontent.com/apache/iotdb/discussions/14620#top
Please reload this pagehttps://patch-diff.githubusercontent.com/apache/iotdb/discussions/14620
https://patch-diff.githubusercontent.com/apache/iotdb/discussions/14620
StrongManLi https://patch-diff.githubusercontent.com/StrongManLi
Jan 3, 2025 https://patch-diff.githubusercontent.com/apache/iotdb/discussions/14620#discussion-7773140
Give feedback.https://patch-diff.githubusercontent.com/apache/iotdb/discussions/14620
VGalaxies https://patch-diff.githubusercontent.com/VGalaxies
Jan 3, 2025 https://github.com/apache/iotdb/discussions/14620#discussioncomment-11722436
View full answer https://patch-diff.githubusercontent.com/apache/iotdb/discussions/14620#discussioncomment-11722436
Oldest https://patch-diff.githubusercontent.com/apache/iotdb/discussions/14620?sort=old
Newest https://patch-diff.githubusercontent.com/apache/iotdb/discussions/14620?sort=new
Top https://patch-diff.githubusercontent.com/apache/iotdb/discussions/14620?sort=top
Please reload this pagehttps://patch-diff.githubusercontent.com/apache/iotdb/discussions/14620
https://patch-diff.githubusercontent.com/apache/iotdb/discussions/14620
VGalaxies https://patch-diff.githubusercontent.com/VGalaxies
Jan 3, 2025 https://patch-diff.githubusercontent.com/apache/iotdb/discussions/14620#discussioncomment-11722436
Give feedback.https://patch-diff.githubusercontent.com/apache/iotdb/discussions/14620
https://patch-diff.githubusercontent.com/StrongManLi
Please reload this pagehttps://patch-diff.githubusercontent.com/apache/iotdb/discussions/14620
https://patch-diff.githubusercontent.com/apache/iotdb/discussions/14620
StrongManLihttps://patch-diff.githubusercontent.com/StrongManLi
Jan 3, 2025 https://patch-diff.githubusercontent.com/apache/iotdb/discussions/14620#discussioncomment-11723166
Give feedback.https://patch-diff.githubusercontent.com/apache/iotdb/discussions/14620
https://patch-diff.githubusercontent.com/SteveYurongSu
Please reload this pagehttps://patch-diff.githubusercontent.com/apache/iotdb/discussions/14620
https://patch-diff.githubusercontent.com/apache/iotdb/discussions/14620
SteveYurongSuhttps://patch-diff.githubusercontent.com/SteveYurongSu
Jul 7, 2025 https://patch-diff.githubusercontent.com/apache/iotdb/discussions/14620#discussioncomment-13678204
Give feedback.https://patch-diff.githubusercontent.com/apache/iotdb/discussions/14620
https://patch-diff.githubusercontent.com/RitchieShi
Please reload this pagehttps://patch-diff.githubusercontent.com/apache/iotdb/discussions/14620
https://patch-diff.githubusercontent.com/apache/iotdb/discussions/14620
RitchieShihttps://patch-diff.githubusercontent.com/RitchieShi
Oct 21, 2025 https://patch-diff.githubusercontent.com/apache/iotdb/discussions/14620#discussioncomment-14735572
Give feedback.https://patch-diff.githubusercontent.com/apache/iotdb/discussions/14620
StrongManLihttps://patch-diff.githubusercontent.com/StrongManLi
Sign up for freehttps://patch-diff.githubusercontent.com/join?source=comment-repo
Sign in to commenthttps://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fapache%2Fiotdb%2Fdiscussions%2F14620
🙏 Q&A https://patch-diff.githubusercontent.com/apache/iotdb/discussions/categories/q-a
https://patch-diff.githubusercontent.com/StrongManLi
https://patch-diff.githubusercontent.com/RitchieShi
https://patch-diff.githubusercontent.com/SteveYurongSu
https://patch-diff.githubusercontent.com/VGalaxies
https://patch-diff.githubusercontent.com/apache/iotdb/discussions/14620
https://patch-diff.githubusercontent.com/settings/replies?return_to=1
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.