Erlang/OTP Forums

Author Message

<  RabbitMQ mailing list  ~  how do I change the connection timeout in the java client

Guest
Posted: Thu Nov 05, 2009 9:28 am Reply with quote
Guest
Mark,

Mark Geib wrote:
> I need to be able to change the timeout for making a new connection to a
> broker to a smaller time. I have not been able to find out how to do
> this for the rabbitmq java client. Is there a way.??

Unfortunately javax.net.SocketFactory and its default implementations in
the JDK, which is what the Java client is using, do not appear to
support the setting of a connection timeout.

You could write your own implementation of the SocketFactory interface
that creates sockets with a connection timeout, and supply instances of
that implementation to com.rabbitmq.client.ConnectionFactory's
setSocketFactory method.


Regards,

Matthias.

_______________________________________________
rabbitmq-discuss mailing list
rabbitmq-discuss@lists.rabbitmq.com
http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
Post received from mailinglist
Guest
Posted: Thu Nov 05, 2009 4:16 pm Reply with quote
Guest
Thanks for the reply, darn.

Have you looked at XSocket. We have used it extensively, and it is very
flexible...

Mark.

Matthias Radestock wrote:
> Mark,
>
> Mark Geib wrote:
>> I need to be able to change the timeout for making a new connection to a
>> broker to a smaller time. I have not been able to find out how to do
>> this for the rabbitmq java client. Is there a way.??
>
> Unfortunately javax.net.SocketFactory and its default implementations in
> the JDK, which is what the Java client is using, do not appear to
> support the setting of a connection timeout.
>
> You could write your own implementation of the SocketFactory interface
> that creates sockets with a connection timeout, and supply instances of
> that implementation to com.rabbitmq.client.ConnectionFactory's
> setSocketFactory method.
>
>
> Regards,
>
> Matthias.
>

--
Principal Engineer
Cheyenne Software Engineering
mark.geib@echostar.com / 35-215

PGP fingerprint:6DFC 389D 9796 0188 92E5 58F5 34C5 6B47 D091 76FD

_______________________________________________
rabbitmq-discuss mailing list
rabbitmq-discuss@lists.rabbitmq.com
http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
Post received from mailinglist

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum