  Several proofs have been published of the Mod Z gluing formula for the
eta-invariant of a Dirac operator. However, so far the integer contribution to
the gluing formula for the eta-invariant is left obscure in the literature. In
this article we present a gluing formula for the eta-invariant which expresses
the integer contribution as a triple index involving the boundary conditions
and the Calderon projectors of the two parts of the decomposition. The main
ingredients of our presentation are the Scott-Wojciechowski theorem for the
determinant of a Dirac operator on a manifold with boundary and the approach of
Bruning-Lesch to the mod Z gluing formula.
  Our presentation includes careful constructions of the Maslov index and
triple index in a symplectic Hilbert space. As a byproduct we give intuitively
appealing proofs of two theorems of Nicolaescu on the spectral flow of Dirac
operators.
  As an application of our methods, we carry out a detailed analysis of the
eta-invariant of the odd signature operator coupled to a flat connection using
adiabatic methods. This is used to extend the definition of the
Atiyah-Patodi-Singer rho-invariant to manifolds with boundary. We derive a
``non-additivity'' formula for the Atiyah-Patodi-Singer rho-invariant and
relate it to Wall's non-additivity formula for the signature of
even-dimensional manifolds.
