前回のエントリーでは、Spring Bootで@RestControllerアノテーションを使ったサーバを作り、 RestTemplateでクライアントを作ることで、リモートサービス呼び出しを実装しました。 http://d.hatena.ne.jp/cero-t/20150618/1434645164 しかしこの方法は、クライアント/サーバ間に何の契約もなく、 サーバから呼び出し元のクライアントをたどることもできません、 言ってしまえば、リフレクションによるメソッド呼び出しをしているようなものでした。 リモートサービス呼び出しにインタフェースを導入する この問題を解決するために、クライアント/サーバ間の契約として インタフェースを挟むことを検討します。 サンプルは、以下に置いています。 https://github.com/cero-t/moa-sample/tree/master/mo