You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/09/28 23:59:57 UTC

[GitHub] [pulsar-dotpulsar] aintJoshinya opened a new pull request, #110: modified the "hello world" to fix first run issue

aintJoshinya opened a new pull request, #110:
URL: https://github.com/apache/pulsar-dotpulsar/pull/110

   the current "hello world" will not show a consumed message the very first time it is run. On subsequent runs, it will work, but it isn't entirely clear from the code alone why it works on subsequent runs.
   
   I don't entirely understand why the order matters here, but I believe it isn't showing the consumed message on the first run because the subscription is created after the producer sends a message. It seems that by default, a new subscription will not consume messages that are created before it.
   
   An alternative solution would be to create the consumer with the "InitialPosition" option set to Earliest (".InitialPosition(SubscriptionInitialPosition.Earliest"), but I think it's preferable to minimize optional configuration in a hello world like this.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar-dotpulsar] blankensteiner merged pull request #110: modified the "hello world" to fix first run issue

Posted by GitBox <gi...@apache.org>.
blankensteiner merged PR #110:
URL: https://github.com/apache/pulsar-dotpulsar/pull/110


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar-dotpulsar] blankensteiner commented on pull request #110: modified the "hello world" to fix first run issue

Posted by GitBox <gi...@apache.org>.
blankensteiner commented on PR #110:
URL: https://github.com/apache/pulsar-dotpulsar/pull/110#issuecomment-1263140651

   Hi @aintJoshinya 
   Thanks for the PR!
   I agree with the minimal optional configuration, but setting the initial position is the right solution and one I find people missing, so it could be wise to show it in that example. It will ensure that it works no matter how you arrange the code.
   If you can change the fix to set the initial position, I will be happy to merge the PR :-)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar-dotpulsar] aintJoshinya commented on pull request #110: modified the "hello world" to fix first run issue

Posted by GitBox <gi...@apache.org>.
aintJoshinya commented on PR #110:
URL: https://github.com/apache/pulsar-dotpulsar/pull/110#issuecomment-1263815938

   @blankensteiner gotcha! Thanks for the feedback! I've revised the update.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar-dotpulsar] blankensteiner commented on pull request #110: modified the "hello world" to fix first run issue

Posted by GitBox <gi...@apache.org>.
blankensteiner commented on PR #110:
URL: https://github.com/apache/pulsar-dotpulsar/pull/110#issuecomment-1264043353

   Thanks! :-)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org