Look for the ClientManager component in the application.xml file.
<component> <role>org.apache.geronimo.gbuild.agent.ClientManager</role> <implementation>org.apache.geronimo.gbuild.agent.ClientManager</implementation> <configuration> <broker-url>tcp://ci.gbuild.org:16161</broker-url> <ping-interval>300000</ping-interval> <reconnect-attempts>10</reconnect-attempts> <reconnect-delay>600000</reconnect-delay> </configuration> </component>
The ClientManager is just a bunch of code that represents the connection and jms session open with the jms broker (activemq). It's in here as a component so all things that wish to consume or produce mesages can simply have a reference to it and do not need to worry about maintaining or reestablishing connections. The ClientManager establishes a connection to the broker when the Agent starts. If the connection is dropped for some reason, the ClientManager will block all the Agents using it while it tries several times to create a new connection to the broker.
The ClientManager will also send a ping notification on a ping topic which serves two purposes:
- It helps to keep the connection alive on networks that automatically close connections it sees as inactive.
- It allows one to easily see which agents are active in the build network.
The URL of the JMS broker – i.e. the thing managing the distributed Queues and Topics.
A value in milliseconds of how often the ClientManager should send a ping message onto the ping topic. A value of 300000 would be 5 minutes.
How many attempts in a row without success should the ClientManager try to reconnect before giving up. Something above 3 is strongly advisable. Sometimes the broker needs to be restarted or there is a hiccup in the connection and connections go away for a few seconds or even minutes.
How long in milliseconds should the ClientManager wait after a failed reconnect attempt before it tries again. Ideally the reconnect-attepmts and reconnect-delay setting should total up to something that gives you at least 10 minutes of tolerance on bad connections. Even 1 hour would be totally fine.