betfair/cougar

Negatively cache missing deserializers in binary transport

Closed this issue · 1 comments

It should be a non breaking change to add parameters to a BSIDL operation response.

Functionally, that is the case and everything works as it should, but there is a performance impact... on older clients who do not know about the type of the new field, the Hessian deserializer gets asked for its class, 'misses' and throws an Exception. This Exception is then caught and logged.

This happens every time a call is made that returns a type that the client doesn't know about. In the case of a high volume service call, that means every single request/response will throw (and catch, and log and swallow) an exception, which is far from desirable, and has been measured at around 25 times slower than the happy path.

An enhancement is needed to introduce a negative cache, which will avoid the lookup cost and associated exception throwing and logging behavior.

The enhancement has been implemented already for Cougar 2.7, 2.8 and 2.9. I will submit a pull request at some point with the 3.0 changes.

Completed with the merge of #54.