Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ActiveMQConnectionFactory sendTimeout

According to this config page on the ActiveMQ site, the connection.sendTimeout property is:

Time to wait on Message Sends for a Response, default value of zero indicates to wait forever. Waiting forever allows the broker to have flow control over messages coming from this client if it is a fast producer or there is no consumer such that the broker would run out of memory if it did not slow down the producer. Does not affect Stomp clients as the sends are ack'd by the broker. (Since ActiveMQ-CPP 2.2.1)

I'm having difficulty interpreting what this means (and what the sendTimeout property really is/what it does):

  • What is a "Message Sends" object?
  • Why would ActiveMQ be waiting for a response? Isn't it on the server-side of a JMS connection? Shouldn't it be waiting for a request?
  • What does it actually timeout? When should it be used?

Thanks in advance!

like image 244
IAmYourFaja Avatar asked Mar 09 '13 20:03

IAmYourFaja


1 Answers

The timeout affects the send of a Message by the client to the Broker. In the case where a send is not async then the client waits for the Broker to return a response indicating that the Message was received and added to the Message store. In some cases this can block for a long time if the Broker has engaged producer flow control because one of its preset memory limits has been reached. If the client application can't tolerate a long wait on send it could configure this timeout so that MessageProducer::send doesn't indefinitely block.

Messages are sent in synchronous mode either because the Connection was configured with alwaysSyncSend=true or because the MessageProducer is sending with the delivery mode set to Persistent.

In general this setting shouldn't need to be used if you've configured your Broker with limits that match your use case.

like image 170
Tim Bish Avatar answered Oct 29 '22 23:10

Tim Bish