hi,
I'm currently investigating MINA to use it as the transport layer
between clients and servers for the next major version of JBoss
Messaging (the JMS implementation of JBoss).[1][2]
One of our requirements is to support both TCP/IP & HTTP (and their SSL
flavours).
The clients and servers must run on only one protocol at the time but it
must be configurable by the user.
I'm wondering what is the best way to achieve that.
In my prototype, depending on a sys prop, the clients and server may
have 2 different filter chains
* in the TCP/IP case, both clients and server use a protocol codec
filter to encode/decode our high level JMS messages directly into MINA
IoBuffer
* in the HTTP case, the client and server use an IoFilter to transform
high level messages into HTTP requests/responses and a HTTP protocol
codec filter.
This means that we use only high level messages but we must provide for
each type of message both a codec (for TCP/IP) and a filter (for HTTP).
Does that sound sensible?
I'm wondering if it would not be simpler to provide just one way to
transform our messages into bytes and use them in both the codec
& the filter. wdyt?
I've also a concern with my handling of HTTP which is quite ugly.
I've not found in either asyncweb (from the sandbox) or mina-codec-http
a codec which supports the encoding/decoding of both HTTP request and
response.
This means that on the client, I use the codec provided by
mina-codec-http to encode request / decode response while on the server
I use the codec provided by asyncweb to decode request / encode response.
And my HTTP filter is an headache: it transforms JMS messages into
mina-codec-http's HttpRequestMessage when sending it.
But it receives a asyncweb's DefaultHttpRequest on the server...
It works but I find it quite weird to juggle between the 2 implementations.
Stupid question: Have I missed the obvious? :) Is there a "full" http
codec that I can use on both HTTP client & server?
If no, is it planned for MINA 2.0 to provide such codec?
Keep up the good work, MINA code is very cool to use,
jeff
[1] http://www.jboss.org/wiki/Wiki.jsp?page=JBossMessagingMinaIntegration
[2] http://www.jboss.org/index.html?module=bb&op=viewtopic&t=122712