Reputation: 11118
I am testing how my code handles situation when machine doesn't have connection to TIBCO Server. I'm using TIBCO.EMS.dll version 8.5.0.5. I don't understand why with these settings it takes around 4 minutes 25 seconds to receive error.
_factory = new ConnectionFactory(URL);
_factory.SetConnAttemptCount(2);
//_factory.SetConnAttemptTimeout(1000);
_factory.SetConnAttemptDelay(1000);
_factory.SetReconnAttemptCount(2);
_factory.SetReconnAttemptDelay(1000);
//_factory.SetReconnAttemptTimeout(1000);
var conn = _factory.CreateConnection(username, password);
The error is:
Failed to connect to the server at...
. I am using tcp connection. Shouldn't it be maximum 2 x 1000ms (plus some delay between attempts)?
When I uncomment the timeout settings in code above I receive different error:
Failed to initialize connection before timeout
. Also after around 4 minutes 25 seconds.
This code is executed at service startup so I would prefer it to fail fast as it delays startup.
Upvotes: 0
Views: 305
Reputation: 422
If you are using a connection factory already defined in the target EMS server this is possible for the factory to be configured with none default connection / reconnection parameters.
From tibemsadmin you can use the show factory command to check if some specific values have been set.
See an example below:
show factory "QueueConnectionFactory"
Factory = QueueConnectionFactory
JNDI Names = "QueueConnectionFactory"
URL = tcp://7222
ClientID =
Load Balanced = no
connect_attempt_count = 6
connect_attempt_delay = 10000
connect_attempt_timeout = 1000
reconnect_attempt_count = 12
reconnect_attempt_delay = 10000
reconnect_attempt_timeout = 1000
Upvotes: 0