why not use getHeaders().get(MessageHeaders.CONTENT_TYPE, String.class) instead of the cast?