DatagramAcceptor doesn't configure a user-defined FilterChain configuration on 
bind.
------------------------------------------------------------------------------------

         Key: DIRMINA-222
         URL: http://issues.apache.org/jira/browse/DIRMINA-222
     Project: Directory MINA
        Type: Bug

    Versions: 0.9.4    
    Reporter: Trustin Lee
 Assigned to: Trustin Lee 
     Fix For: 0.9.5


A bug report from Rob Butler:

Hello all,

I just started using the Spring integration package for Mina 0.9.4 and ran into 
a problem.  It seems as though the DatagramAcceptor doesn't make use of the 
DatagramAcceptorConfig properly because any filters in the config are not used.

To confirm this was not a spring specific problem I re-implemented all the 
configuration in code.  Please see below:

IoAcceptor datagramAcceptor = new DatagramAcceptor();
IoAcceptor socketAcceptor = new SocketAcceptor();

DefaultIoFilterChainBuilder fcBuilder = new DefaultIoFilterChainBuilder();
fcBuilder.addLast("LOGGER", new LoggingFilter());
fcBuilder.addLast("CODEC", new ProtocolCodecFilter(new MyCodecFactory()));

DatagramAcceptorConfig datagramConfig = new DatagramAcceptorConfig();
datagramConfig.setFilterChainBuilder(fcBuilder);

SocketAcceptorConfig socketConfig = new SocketAcceptorConfig();
socketConfig.setFilterChainBuilder(fcBuilder);


socketAcceptor.bind(new InetSocketAddress( PORT ), new MyProtocolHandler(), 
socketConfig);
datagramAcceptor.bind(new InetSocketAddress( PORT ), new MyProtocolHandler(), 
datagramConfig);

As you can see the same DefaultIoFilterChainBuilder is being used for both the 
SocketAcceptor and the DatagramAcceptor.  The SocketAcceptor works fine and all 
filters and the codec are invoked.  The DatagramAcceptor does nothing and no 
filters are invoked.  If I manually register the filters in the 
MyProtocolHandler.sessionCreated method everything works fine.  But I'd rather 
control these using the acceptorConfigs.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to