I have a CMS producer which sends message in a while loop. This is extremely fast and unnecessary. I would like to restrict this to 1 message per second or so.
BytesMessage *message = session->createBytesMessage();
message->setStringProperty("M_P_C_N","someMsg");
message->setStringProperty("M_P_T_N","someTopic");
message->writeBytes(data);
producer->send(message);
I was wondering if CMS has a function or a way to set the frequency of the sending?
There is no such facility in ActiveMQ-CPP. Controlling producer send rate is something your application needs to handle, the C++ client is only responsible for sending the messages, you are responsible for the logic surrounding what and when a message is sent.