Hi,
i have written a golang base message producer using the solace golang API/SDK.
I create random messages and can define a level of parallelism and a message length.
The program works fine and creates some 1k’s of messages per sec for 1k long messages. But after some time it always terminates with
{“level”:“info”,“msg”:“message published:{"message":"Yq4wR0ZPomc4B0w8bVwyLFxtwIkk0b5IcfbtvHlj8JrcnfraDXvR4bMtGIWJgZLKMf7c1q962BQHtiNfJbZVQWHj8XtyBCj9FgwC8D8QXzuaMGkRb1jRowzg0pftKATls2a93x4HBvtLRg0NN9wiYnRnIA8fnF7qUFVJ3piKMba43epRlkZdTx67d43tofLCkdtXUz0uWiuNncd3GNWYdKmvtRHcrlS3cofyPD8qPuidPdheiUlTf7iiM1f8wybm8Sy2GeDBjIfm9b7bzFaFTFE1Mp3FoQTz31pOU5qsO3txwaPdUa3oO76MCXZDTIMNIoLCY4dxFOvXnKlGpzrZpsRetSU7xoaR7hCFZNxRnKqLpItjO5gRKZdu4OfZLjWVIn9ljnKGinXNHpFLusDtFvRv356KaiOWYpav9ZwBzamuWTaPAHDqNLhFyGujxbNfGKGdoLpIYJyf5UCbYbK6m56v2Xsfe8ru4EHNnGTvcQ0Lh4Q0Mx3GnbDxAeUUXtgsqzlDYYBlULO8yduB3AuGG0hhXtF1LOMF8sOyySA2c1XVYp4A4v2Wgj069Tb4FVuib1gIm2PWTu7DwEPrnr4DYnl2RILVTuFZ13suN3N2WPfiy34YXGeMzTw9TXQ9Q8Tn67qY0owzCNhnzc2EHd7ONldDHg0QCsMRXAKnzYZhgbEmU0mi0qmC8nuU3ggMV4RETU7zSMp22SH7PIQO5OrTAOPeX426FP5U3XbCteCyQjxam3M2rrMuY2TqT9Wbeciywx7WWvKgyz9OWc8rDeD51SVFdN50d7DFDmlf4wl4nf5T1PIijUeQ8LdSIJ1c6Eg4PaTGpexGrhUP7LZC3mJlDu9pLWrsZyRNaLhzIrOuBVVKXOu5s2ybXhSpfQjtZfsVNdkWHNab3bkc7tbBlYk2TX0WmpgYTaPAShFWGQHHf01bpNX0fdoXDf3iYY7ZAVIknqWcfu3GvkSukcbvx0BFoV7iF7IjeAtn02Yz48jV","id":"3ec71a88-d228-48eb-8f1a-3f83b3f73045"}”,“time”:“2023-01-13T12:11:44Z”}
{“level”:“info”,“msg”:“topic: CXS/demo1/5/fb42d89f-d2f8-4500-8f46-9a0a5d6ff193”,“time”:“2023-01-13T12:11:44Z”}
2023/01/13 12:11:44 log.go:45: WARNING solClientMsg.c:1247 (7fdc277fe640) Bad msg_p pointer ‘0xfc000db6’ in solClient_msg_dup
panic: invalid configuration provided: error duplicating message: Bad msg_p pointer ‘0xfc000db6’ in solClient_msg_dup
As the data is random generated I can’t see how a duplicate message would come in play.
Can someone explain what is happening there and how to resolve?
can we see the code? Also, there are formatting options in this forum for codeblocks. You can use the 3 tildes (the ` character) to form the start and choose the paragraph formatter to end it.
this is a code block
getEnv(“PARALLEL_PRODUCER”)
defines the level of parallel internal instances this script runs - I used 10 to 40
getEnv(“AEM_TOPIC_PREFIX”)
just the topic prefix
Hi @ulrich ,
There is a bug in the Go API that prevents multiple goroutines from sharing the same DirectMessagePublisher instance that will be fixed in a future release. In the meantime, using one DirectMessagePublisher instance per goroutine will resolve the issue.
@ulrich the changed code provided was receive code, not publishing code. Was the error occurring on the receive side now?
Can you share the version of the Solace Go API?
@ulrich using your code and 40 parallel publishers, I do not hit your error (tried on a few different systems and let it run for a while). Are there any other details you can provide?
Unrelated to the problem, but you can have multiple direct publishers on the same messaging service (e.g. share the messaging service outside of the goroutines) instead of a separate messaging service per goroutine. This will use fewer client and server side resources.
I am back to
{“level”:“info”,“msg”:“message published:{"message":"6K1QlZmjQKqjigNX56UWX6B2SsoupmvHbJtYvCGUSoa9kq1gNoETHhvEbzjsA9Q48mGtR2hFqvMhJxFjzbHdvnALMzwEJDj853fpk4eX22GimZjZ0bj4jajKjHiJAr42FYsXvk4sU47t5xVSqrTFLcsBgzuS66CfSinDbxHb2o1MwMpFgWCFEZAhi7Wdz5k2JrsfZHcSJHa2lXflfIJlOast9K3ZUR0Ps1BU9gfWeipvS3UCss9Ifcker2LWlIU9CNz79NCQJELgqrecuZpf9TRQwI033OPJ3oGxgJrDlw2bzpk2CgYs56xETRxadynJF2oJJ3jBSATS4dTgvKwYfRTKDGo35Lo0jI42E2Ix6OnFGKqWgb0KQsEGc6EzaLWYKxtvRi6CcuPHU1TRiSpweVYTr1ssk4y7B4fwGTXFiHDj8pQMUEHsMAwb9Z5ICwklbK3IfScANldTBmsOvhZWjIM0qIsjJXVaqq0lw04FYU31ihh3fKvrKXQCXuvu3IlH9tI5MY44wwwQETwPph5ZMY5J9XYeirXq7qgWRzPOnUvHpjEiowuXoYCyUiwitFE4etVxa3B6chPb72pCxBYbv0l1PSkVoGSNRmrGMpZAjUPx7HyiU4vQW5ToOk9AQ0irtzZkdndnSbM82lNdFAWS1Nc6mm470OQdY74UZmxXQi6QZO3ZIR2PgWwXNWESuqZzbrHdB5qoot6j69NGaLeurAb4KJPcYL9XsbiK8CtWIeALsWUQuVnzIH1Jfjb93qCyljcEac1eMn0cHyx9nMKuLV0xWkHi29onncmiMZ4goSQLZJQ635dDLOoMHLZlPI2oxXNgqC4VbhRecfce3nijJVWBzko0KK0TwSF0zGF4yJWS2d0DuLoHoBIAYjn3TuIqeMahzwKQR5qm6XOXioMQvGI2ceJAOEU2RpP7ScI9DwHmHTwK6EwUiEfs97PXwm5Qhrj4PYJGamNY151hhiNLOuLoCWpLjNveNJgoQFHZ","id":"2a388f7b-d14a-4d10-9670-e1968f5d0d3b"}”,“time”:“2023-01-16T18:54:11Z”}
2023/01/16 18:54:11 log.go:45: WARNING solClientMsg.c:1247 (7fcf6effd640) Bad msg_p pointer ‘0xbc000ee7’ in solClient_msg_dup
{“level”:“info”,“msg”:“topic: CXS/demo1/37/8a584b2b-fbda-4cce-ac47-06d80a30b33d”,“time”:“2023-01-16T18:54:11Z”}
panic: invalid configuration provided: error duplicating message: Bad msg_p pointer ‘0xbc000ee7’ in solClient_msg_dup
goroutine 35 [running]:
main.main.func1(0x0?)
/home/azureuser/tmp/AdvancedEventMesh/cmd/producer/main.go:126 +0xa05
created by main.main
/home/azureuser/tmp/AdvancedEventMesh/cmd/producer/main.go:58 +0x94
exit status 2
data dog states no problems
after the call to Publish, like this:
publishErr := directPublisher.Publish(message, resource.TopicOf(topic))
if publishErr != nil {
panic(publishErr)
}
log.Info(“message published:”, messageBody)
message.Dispose()