Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If the producer message generated by pulsar client is encapsulated as a function, only one message can be sent in a topic #314

Open
Mr-lq7 opened this issue Jun 21, 2024 · 0 comments

Comments

@Mr-lq7
Copy link

Mr-lq7 commented Jun 21, 2024

Environmental Info:
rust pulsar client sdk Version: v6.3.0

Node(s) CPU architecture, OS, and Version:

host machine: Linux SMP Sat Oct 7 17:52:50 CST 2023 x86_64 x86_64 x86_64 GNU/Linux

Pulsar Cluster Configuration:

I Install the pulsar cluster version, the link: https://github.com/apache/pulsar-helm-chart/tree/pulsar-2.9.4 ,the docker image version of pulsar is 2.10.3

Describe the bug:

When I call the function send_msg twice,only one message sent successfully on the same topic,the other messages cannot sent successfully.

Steps To Reproduce:

  1. this is the send_msg function, it uses producer to send bytes array and the msg id will be printed if the message is sent;
image
  1. the load function calls the send_msg function
image
  1. when the send_msg is called twice by load function(step 2), the second message cannot sent successfully. The log is as follows:

[2024-06-19T06:21:07Z WARN pulsar::retry_op] Retry #0 -> connecting producer 0 :topic persistent://default/public/test,
Message sent successfully: CommandSendReceipt { producer_id: 0, sequence_id: 0, message_id: Some(MessageIdData { ledger_id: 5508, entry_id: 0, partition: None, batch_index: None, ack_set: [], batch_size: None, first_chunk_message_id: None }), **highest_sequence_id: Some(18446744073709551615) **}

[2024-06-19T06:21:08Z WARN pulsar::retry_op] Retry #0 -> connecting producer 1:topic persistent://default/public/test,
Message sent successfully: CommandSendReceipt { producer_id: 1, sequence_id: 0, message_id: Some(MessageIdData { ledger_id: 18446744073709551615, entry_id: 18446744073709551615, partition: None, batch_index: None, ack_set: [], batch_size: None, first_chunk_message_id: None }), **highest_sequence_id: Some(18446744073709551615) **}

We can find the second message's ledger_id is very strange, and the highest_sequence_id value ​​of both messages are weird ,too

  1. I use the pulsar-admin,command: pulsar-admin topics stats-internal persistent://default/public/test, finds that only the first message is sent successfully.

  2. But when the message is sent twice in send_msg, it works well, the code is as follows:

image
  1. When I use pulsar's command-line tools(pulsar-client) for production and consumption, I don't have a problem,so I think the pulsar server is OK. Thus, maybe some problems happen in rust pulsar sdk,or maybe because of the asynchronous problem, the message cannot be wrapped with send_msg.

This problem puzzles me very long time, how can I do? Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant