0

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?

  • Slow the producer down? This is not a problem from ActiveMQ, but a problem from the one using activeMQ. – Mark Jansen Sep 24 '15 at 09:05
  • What do you mean by "slow the producer down"? I don't want to introduce a sleep or such a hack, I am asking whether there is a facility for such purposes in the library. Plus, this example I took from the official website of ActiveMQ. It is not my production, for your information. –  Sep 24 '15 at 09:06

1 Answers1

0

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.

Tim Bish
  • 17,475
  • 4
  • 32
  • 42