title: Spring messaging websockets - how to call setMessageCodec
body: <p>I am trying to use Spring websockets with <code>Genson</code> instead of <code>Jackson</code>. When I try and connect from a client I get the following:</p>
  
  <pre><code>java.lang.IllegalStateException: A SockJsMessageCodec is required but not available: Add Jackson 2 to the classpath, or configure a custom SockJsMessageCodec.
  </code></pre>
  
  <p>It would appear I need to set a custom message codec.</p>
  
  <p>I can see that a <code>.setMessageCodec</code> method appears on the <code>TransportHandlingSockJsService</code> but I can't see anywhere in the configuration options where I can actually set it.</p>
  
  <p>I think the the <code>.setMessageCodec</code> method should be present on the <code>SockJsServiceRegistration</code> class so it can be set from configuration...but it isn't...any ideas?</p>
  
  <p><strong>EDIT:</strong> I believe this is a bug so have raised: <a href="https://jira.spring.io/browse/SPR-12091" rel="nofollow">https://jira.spring.io/browse/SPR-12091</a></p>