Search code examples
javaapache-mina

Apache Mina ExecutorFilter


I have an application based on Apache Mina 2.0.4 in which I am using ExecutorFilter to create a thread on message_received event.

I found that in production environment, at some point of time ExecutorFilter is not creating threads. Instead it blocks the request message.

Can any one guide on how to properly use ExecutorFilter? I am expecting up to 100 simultaneously connections to my application.

This is my class which override ExecutorFilter class-

public class OneIExecutorFilter extends ExecutorFilter {

    public OneIExecutorFilter(IoEventType...eventTypes){
        super(eventTypes);
    }

    @Override
    public void sessionCreated(NextFilter nextFilter, IoSession session)
            throws Exception {      
        super.sessionCreated(nextFilter, session);
    }   

    @Override
    protected void fireEvent(IoFilterEvent event) {             
        super.fireEvent(event);     
    }   
}

Solution

  • You're probably running out of threads. Try using the ExecutorFilter(int maximumPoolSize, IoEventType... eventTypes) constructor with maximumPoolSize set to more than 100.