You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/10/27 11:45:26 UTC

[GitHub] [pulsar] ATaurenRideRocket opened a new issue, #18224: [Bug] deliverAfter not work

ATaurenRideRocket opened a new issue, #18224:
URL: https://github.com/apache/pulsar/issues/18224

   ### Search before asking
   
   - [X] I searched in the [issues](https://github.com/apache/pulsar/issues) and found nothing similar.
   
   
   ### Version
   
   pulsar server- 2.8.1
   pulsar client - 2.8.1
   
   ### Minimal reproduce step
   
   producer.newMessage()
                          .value(json)
                          .deliverAfter(2, TimeUnit.SECONDS)
                          .send();
   
   
   ### What did you expect to see?
   
   when i set 2 seconds,i want to see the send time :<1666854402823>, recieve time <1666854404823>
   
   ### What did you see instead?
   
   when i set 2 seconds,i want to see the send time :<1666854402823>, recieve time <1666854402847>
   
   ### Anything else?
   
   The question is when i set the value of deliverAfter to 1 seconds or 2 seconds, the function is not work, unless Greater than or equal to 3 seconds.
   
   ### Are you willing to submit a PR?
   
   - [ ] I'm willing to submit a 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: commits-unsubscribe@pulsar.apache.org.apache.org

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


[GitHub] [pulsar] tisonkun commented on issue #18224: [Bug] deliverAfter not work

Posted by GitBox <gi...@apache.org>.
tisonkun commented on issue #18224:
URL: https://github.com/apache/pulsar/issues/18224#issuecomment-1340531812

   @a11enhuang Thanks for your update. Could you prepare a demo repo so that we can reproduce the case you describe here?


-- 
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: commits-unsubscribe@pulsar.apache.org

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


[GitHub] [pulsar] ATaurenRideRocket commented on issue #18224: [Bug] deliverAfter not work

Posted by GitBox <gi...@apache.org>.
ATaurenRideRocket commented on issue #18224:
URL: https://github.com/apache/pulsar/issues/18224#issuecomment-1294308875

   > @ATaurenRideRocket Delayed message feature and Shared subscription is required.
   I did.
   pulsarClient.newConsumer()
                           .messageListener(consumer)
                           .receiverQueueSize(properties.getReceiverQueueSize())
                           .topics(topicList)
                           .subscriptionName(properties.getSubscriptionName())
                           .subscriptionType(SubscriptionType.Shared)
                           .negativeAckRedeliveryDelay(properties.getRedeliveryDelay(), TimeUnit.SECONDS)
                           .ackTimeout(1, TimeUnit.MINUTES)
                           .subscribe();


-- 
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: commits-unsubscribe@pulsar.apache.org

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


[GitHub] [pulsar] codelipenghui commented on issue #18224: [Bug] deliverAfter not work

Posted by GitBox <gi...@apache.org>.
codelipenghui commented on issue #18224:
URL: https://github.com/apache/pulsar/issues/18224#issuecomment-1293456627

   @ATaurenRideRocket Delayed message feature and Shared subscription is required.


-- 
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: commits-unsubscribe@pulsar.apache.org

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


[GitHub] [pulsar] tisonkun commented on issue #18224: [Bug] deliverAfter not work

Posted by GitBox <gi...@apache.org>.
tisonkun commented on issue #18224:
URL: https://github.com/apache/pulsar/issues/18224#issuecomment-1339570833

   Closed as answer. Not a bug.


-- 
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: commits-unsubscribe@pulsar.apache.org

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


[GitHub] [pulsar] tisonkun closed issue #18224: [Bug] deliverAfter not work

Posted by GitBox <gi...@apache.org>.
tisonkun closed issue #18224: [Bug] deliverAfter not work
URL: https://github.com/apache/pulsar/issues/18224


-- 
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: commits-unsubscribe@pulsar.apache.org

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


[GitHub] [pulsar] a11enhuang commented on issue #18224: [Bug] deliverAfter not work

Posted by GitBox <gi...@apache.org>.
a11enhuang commented on issue #18224:
URL: https://github.com/apache/pulsar/issues/18224#issuecomment-1342771750

   I wrote a test case that reproduces the issue:
   This is the code when the producer sends the message
   ```java
   producer.newMessage()
                   .value("hello")
                   .deliverAfter(2L, TimeUnit.SECONDS)
                   .send();
   ```
   Here is the code for the consumer to receive the message:
   ```java
   Consumer<byte[]> consumer = client.newConsumer()
                   .subscriptionType(SubscriptionType.Shared)
                   .subscribe();
   Message<byte[]> message = consumer.receive();
   ```
   When the producer sends the message, the consumer receives the message immediately.


-- 
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: commits-unsubscribe@pulsar.apache.org

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


[GitHub] [pulsar] a11enhuang commented on issue #18224: [Bug] deliverAfter not work

Posted by GitBox <gi...@apache.org>.
a11enhuang commented on issue #18224:
URL: https://github.com/apache/pulsar/issues/18224#issuecomment-1342772981

   I wrote a test case that reproduces the issue:
   This is the code when the producer sends the message
   ```java
   producer.newMessage()
                   .value("hello")
                   .deliverAfter(2L, TimeUnit.SECONDS)
                   .send();
   ```
   Here is the code for the consumer to receive the message:
   ```java
   Consumer<byte[]> consumer = client.newConsumer()
                   .subscriptionType(SubscriptionType.Shared)
                   .subscribe();
   Message<byte[]> message = consumer.receive();
   ```
   When the producer sends the message, the consumer receives the message immediately.


-- 
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: commits-unsubscribe@pulsar.apache.org

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


[GitHub] [pulsar] a11enhuang commented on issue #18224: [Bug] deliverAfter not work

Posted by GitBox <gi...@apache.org>.
a11enhuang commented on issue #18224:
URL: https://github.com/apache/pulsar/issues/18224#issuecomment-1340527899

   I think this error is real. My client and server versions are the latest `2.10.1`, and my `SubscriptionType=Shared`. When I try to send a message:
   ```
   messageBuilder.deliverAfter(2, TimeUnit.SECONDS);
   ```
   Messages appear to be consumed immediately without delay.
   I tried increasing the delay time:
   ```
   messageBuilder.deliverAfter(20, TimeUnit.SECONDS);
   ```
   It received the message after 10 seconds.
   I compared the time of `Pulsar Broker` with the time of the business server, they are equal.
   `deliverAfter` seems to be buggy.
   


-- 
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: commits-unsubscribe@pulsar.apache.org

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


[GitHub] [pulsar] codelipenghui commented on issue #18224: [Bug] deliverAfter not work

Posted by GitBox <gi...@apache.org>.
codelipenghui commented on issue #18224:
URL: https://github.com/apache/pulsar/issues/18224#issuecomment-1294363626

   Ok. Looks like it should be related to the ticket time
   
   https://github.com/apache/pulsar/blob/8f8637a75e05f271bdc8fa2081284d39bc5de972/conf/broker.conf#L548-L553
   
   You can try to reduce the ticket time or just make the delayed time > 2s (5s or 10s)


-- 
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: commits-unsubscribe@pulsar.apache.org

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


[GitHub] [pulsar] leizhiyuan commented on issue #18224: [Bug] deliverAfter not work

Posted by GitBox <gi...@apache.org>.
leizhiyuan commented on issue #18224:
URL: https://github.com/apache/pulsar/issues/18224#issuecomment-1306861127

   if your client time and server time is not equal, this will happen ,if your server has gc pause, it will also get 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: commits-unsubscribe@pulsar.apache.org

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


[GitHub] [pulsar] github-actions[bot] commented on issue #18224: [Bug] deliverAfter not work

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on issue #18224:
URL: https://github.com/apache/pulsar/issues/18224#issuecomment-1374686319

   The issue had no activity for 30 days, mark with Stale label.


-- 
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: commits-unsubscribe@pulsar.apache.org

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