This message was deleted.
# general
s
This message was deleted.
d
Can you share your producer config? Pulsar determines “duplicates” using a combination of the producer name and an auto-generated sequence ID. You might be using the same producer name in 2 or more producer instances, which would lead to these types of warnings/errors
j
hmm. I guess we would need to define "instance"
each of the reader threads are using the same producer object
and I only have 1 instance of the application running right now.
d
Ok, instance = a separate Producer object instance
j
ok. that is a good thing for me to check and make sure I'm not injecting a separate object into each reader thread
d
you can also check that using the
pulsar-admin topic stats
command, which will show the attached producers on a given topic.
j
I didn't get the flood of errors when running with a single slice
d
I guess I need you to define “slice” 😃
j
its an ElasticSearch term
sliced queries have multiple concurrent readers
each reading a portion of the results
👍 1
in our reader code its all async returns using a worker thread pool
ok, just looking at the code its not immediately clear if multiple producers are being generated. We are using a springboot pulsar helper: https://docs.spring.io/spring-pulsar/docs/current-SNAPSHOT/reference/html/ so I'm just going to kick off another data load and see what pulsar thinks.
👍 2
1 producer
lots of warnings
it looks like there are multiple producers, but they are 1 per partition
🤔 1
the topic is configured with 10 partitions.
so it looks like there is a producer configured for each partition, with an ID that matches the partition number
yeah, and I can see it when the job shuts down, a snippet:
Copy code
[2023-02-01 21:35:14.720] INFO  [pulsar-client-io-1-5] [org.apache.pulsar.client.impl.ProducerImpl - 1040]: [<persistent://q6/default/bnr_legacy-partition-0>] [test-dataout-producer] Closed Producer
[2023-02-01 21:35:14.722] INFO  [pulsar-client-io-1-7] [org.apache.pulsar.client.impl.ProducerImpl - 1040]: [<persistent://q6/default/bnr_legacy-partition-1>] [test-dataout-producer] Closed Producer
d
Have you configured message deduplication on your Pulsar cluster?
j
Let me ask devops.
we did not configure deduplication on the brokers.
We can.
d
Where are you seeing these warning messages?
j
they are getting logged by the Java pulsar client running in my producer code
so that is all running inside an application I wrote to load some of our data in pulsar
I guess its an INFO line, not a warning.
I have resolved this. It was related to having multiple threads calling in to the same PulsarTemplate from the Springboot Pulsar library. I put a synchronized block around the access of the PulsarTemplate and everything is running smoothly now
👍 2
Well, it is running smoothly, but slowly. That synchronization has a noticable impact on performance
d
Scale out the number of PulsarTemplates ?
c
Hi @Jeff Bolle and hello @David K I saw the post on Stackoverfow and my good friend @Alexander Preuss alerted me to this thread. Jeff, I am going to look into why you are seeing this w/o the synchronization - you should not be. Did you happen to try the Reactive template?
@David K do you think this could be related to not having de-duplication enabled on the broker?
d
I don’t @Chris Bono, based on the code block generating the INFO message, this is happening on the client side. And thank you for taking a look at this, I really appreciate it
c
K. I have not had a chance to dig in yet. Just coming off 36 hr power outage from ice storm in Austin. I plan on digging in and I will ping back here what I find - just to close the loop.
d
Yikes, stay warm. 🧊
👍 1
j
Thank you both! I really appreciate it. I haven't had a chance to try the reactive client yet. I've been dealing with a variety of other issues not related to this over the past few days as well.
c
You are more than welcome. No worries on not trying Reactive client yet. What version of spring-pulsar are you using? We fixed some things related to thread safety w/ the template when the schema varies across template use (this is the
0.1.1-SNAPSHOT
)
j
I'm using the snapshot version of spring pulsar, I think my latest tests downloaded jars with today's date in the build, but I'll have to check in a couple hours after I get kids to bed.
Ahh, the schema changing across template use is definitely my case. We use protobuf for serialization and I've written my code to generically handle any of the various object types. I have separate config that determines where to publish each object type. You should be able to see most / all of this in the code block in stack overflow. I wasn't clear on the proper template usage when I have to handle a large number of different object types.
c
I am pretty sure you are on the latest code as I see you using
.withSchema(
on the builder. I created https://github.com/spring-projects-experimental/spring-pulsar/issues/310 to track this and for us to further communicate on the issue. I want to be sure not to abuse this channel or put too much back/forth on the SO while. investigating. But I want to be able to communicate w/ you Jeff as I find things etc.. Once I take deeper look I will update the above ticket. Thx again for the report Jeff - sorry you are running into issues. We will get you squared away. Thx David for helping look into it - much appreciated.
j
Sounds good! We can move the conversation to that issue.
👍 1