Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REQ: Add missing functions to Stomp class #19

Open
djBo opened this issue Dec 10, 2012 · 0 comments
Open

REQ: Add missing functions to Stomp class #19

djBo opened this issue Dec 10, 2012 · 0 comments

Comments

@djBo
Copy link

djBo commented Dec 10, 2012

Hi,

This is a feature request.

I have modified my own running code to implement this correctly, based on the 1.0.0 version.

The missing functions are: setConnectTimeout and setMaxAttempts

I added the following code after setReadTimeout:

/**
 * Set timeout to wait for connection
 *
 * @param int $seconds_to_wait Seconds to wait for connection
 */
public function setConnectTimeout($seconds) {
    $this->_connect_timeout_seconds = $seconds;
}

/**
 * Set maximum connect attempts
 */
public function setMaxAttempts($max) {
    $this->_attempts = $max;
}

setConnectTimeout allows to set an explicit connect timeout, instead of using the default 60 seconds.
setMaxAttempts allows to explicitly set the amounts of attempts to perform, instead of the default 10.

Reason:
When adding CRUD operations using ActiveMQ, the CouchDB server might at times be very busy. To make sure that messages from the queue are handles quickly, we set the connect timeout to 1 second, and the max attempts to 1. This ensures the queue won't fall behind in message handling.

Besides the above, each obvious field can be set except these two :)

With kind regards,
Rory Slegtenhorst

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant