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 2020/03/03 15:17:07 UTC

[GitHub] [pulsar] kevin-kosmos opened a new issue #6462: getLastMessageId from PulsarAdmin doesn't work with BatchMessageIdImpl

kevin-kosmos opened a new issue #6462: getLastMessageId from PulsarAdmin doesn't work with BatchMessageIdImpl
URL: https://github.com/apache/pulsar/issues/6462
 
 
   **Describe the bug**
   A topic created with a producer in batch mode generates batch messages id : ledgerId:entryId:partitionIndex:batchIndex.
   The getLastMessageId method return a MessageIdImpl which doesn't use the batchIndex parameter. 
   
   
   **To Reproduce**
   1. Send messages with a producer in batch mode : 
   `
   
           public class ProducerTest {
   	public static void main(String[] args) throws Exception {
   
   		try (PulsarClient client = PulsarClient.builder()
   				.serviceUrl("pulsar://localhost:6650")
   				.build()) {
   
   			Producer<String> producer = client
   					.newProducer(Schema.STRING)
   					.topic("topic")
   					.enableBatching(true)
   					.batchingMaxMessages(10)
   					.blockIfQueueFull(false)
   					.batchingMaxPublishDelay(100, TimeUnit.SECONDS)
   					.create();
   
   			CompletableFuture<MessageId> messageIdCompletableFuture = null;
   			for (int i = 0; i < 10; i++) {
   				messageIdCompletableFuture = producer.newMessage()
   						.value(String.valueOf(i))
   						.sendAsync();
   			}
   
   			messageIdCompletableFuture.get();
   		}
   	}
           }`
   
   2. Shows generated messages : 
   
   |value|__topic                          |__messageId              |__messageIdToString|
   |0    |persistent://public/default/topic|[08 F0 B6 02 10 00 20 00]|39792:0: -1:0       |
   |1    |persistent://public/default/topic|[08 F0 B6 02 10 00 20 01]|39792:0: -1:1       |
   |2    |persistent://public/default/topic|[08 F0 B6 02 10 00 20 02]|39792:0: -1:2       |
   |3    |persistent://public/default/topic|[08 F0 B6 02 10 00 20 03]|39792:0: -1:3       |
   |4    |persistent://public/default/topic|[08 F0 B6 02 10 00 20 04]|39792:0: -1:4       |
   |5    |persistent://public/default/topic|[08 F0 B6 02 10 00 20 05]|39792:0: -1:5       |
   |6    |persistent://public/default/topic|[08 F0 B6 02 10 00 20 06]|39792:0: -1:6       |
   |7    |persistent://public/default/topic|[08 F0 B6 02 10 00 20 07]|39792:0: -1:7       |
   |8    |persistent://public/default/topic|[08 F0 B6 02 10 00 20 08]|39792:0: -1:8       |
   |9    |persistent://public/default/topic|[08 F0 B6 02 10 00 20 09]|39792:0: -1:9       |
   
   3. Retrieve the last message id from pulsar admin and display it : 
   39792:0: -1
   
   
   **Expected behavior**
   It shoud return 39792:0: -1:9
   
   **Desktop (please complete the following information):**
    - OS: Ubuntu 18.04
    - Pulsar runs in docker standalone instance

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [pulsar] congbobo184 removed a comment on issue #6462: getLastMessageId from PulsarAdmin doesn't work with BatchMessageIdImpl

Posted by GitBox <gi...@apache.org>.
congbobo184 removed a comment on issue #6462: getLastMessageId from PulsarAdmin doesn't work with BatchMessageIdImpl
URL: https://github.com/apache/pulsar/issues/6462#issuecomment-596302092
 
 
   client will merge this batch give an entryId, send the entry to broker. 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [pulsar] congbobo184 edited a comment on issue #6462: getLastMessageId from PulsarAdmin doesn't work with BatchMessageIdImpl

Posted by GitBox <gi...@apache.org>.
congbobo184 edited a comment on issue #6462: getLastMessageId from PulsarAdmin doesn't work with BatchMessageIdImpl
URL: https://github.com/apache/pulsar/issues/6462#issuecomment-596302092
 
 
   client will merge this batch give an entryId, send the entry to broker. 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [pulsar] eladar2000 commented on issue #6462: getLastMessageId from PulsarAdmin doesn't work with BatchMessageIdImpl

Posted by GitBox <gi...@apache.org>.
eladar2000 commented on issue #6462: getLastMessageId from PulsarAdmin doesn't work with BatchMessageIdImpl
URL: https://github.com/apache/pulsar/issues/6462#issuecomment-596108894
 
 
   @congbobo184 I don't understand ? If the batchIndex is not stored on the broker side, all the messages of the same batch have the same Message id (as described before, the batch id is the only changing part in the id) ? So it is not possible to target a specific message created inside a batch ?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [pulsar] congbobo184 commented on issue #6462: getLastMessageId from PulsarAdmin doesn't work with BatchMessageIdImpl

Posted by GitBox <gi...@apache.org>.
congbobo184 commented on issue #6462: getLastMessageId from PulsarAdmin doesn't work with BatchMessageIdImpl
URL: https://github.com/apache/pulsar/issues/6462#issuecomment-596302092
 
 
   client will merge this batch give an entryId, send the entry to broker. so, i think you can setProperty for this message to target a specific message.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [pulsar] congbobo184 edited a comment on issue #6462: getLastMessageId from PulsarAdmin doesn't work with BatchMessageIdImpl

Posted by GitBox <gi...@apache.org>.
congbobo184 edited a comment on issue #6462: getLastMessageId from PulsarAdmin doesn't work with BatchMessageIdImpl
URL: https://github.com/apache/pulsar/issues/6462#issuecomment-596302092
 
 
   client will merge this batch give an entryId, send the entry to broker. so, i think you can setProperty for this message to target a specific message in a batch.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [pulsar] congbobo184 commented on issue #6462: getLastMessageId from PulsarAdmin doesn't work with BatchMessageIdImpl

Posted by GitBox <gi...@apache.org>.
congbobo184 commented on issue #6462: getLastMessageId from PulsarAdmin doesn't work with BatchMessageIdImpl
URL: https://github.com/apache/pulsar/issues/6462#issuecomment-596311640
 
 
   I will fix this, and every time it will return the last of batchIndex.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [pulsar] sijie closed issue #6462: getLastMessageId from PulsarAdmin doesn't work with BatchMessageIdImpl

Posted by GitBox <gi...@apache.org>.
sijie closed issue #6462: getLastMessageId from PulsarAdmin doesn't work with BatchMessageIdImpl
URL: https://github.com/apache/pulsar/issues/6462
 
 
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [pulsar] congbobo184 commented on issue #6462: getLastMessageId from PulsarAdmin doesn't work with BatchMessageIdImpl

Posted by GitBox <gi...@apache.org>.
congbobo184 commented on issue #6462: getLastMessageId from PulsarAdmin doesn't work with BatchMessageIdImpl
URL: https://github.com/apache/pulsar/issues/6462#issuecomment-595689426
 
 
   @kevin-kosmos  broker don't store the batchIndex, client only loop set batchIndex.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services