Hi, all

Since I want to control incoming messages retrieved from SMSC, I decided
to use ReadThrottleFilter to block excessive messages.

The code snippet listed as below:

        // Executor used to control read throttle
        private ScheduledExecutorService throttleExecutor = Executors
                        .newScheduledThreadPool(1);

                connector = new NioSocketConnector();
                connector.setConnectTimeout(connectTimeout);
                connector.getFilterChain().addLast("codec",
                                new ProtocolCodecFilter(new
SMPPCodecFactory(false)));
                connector.getFilterChain().addLast("exec", new
ExecutorFilter());
                connector.getFilterChain().addLast("throttle",
                                new
ReadThrottleFilter(throttleExecutor));


But under high workload, the system still throw such exception:

Exception in thread "pool-5-thread-3" java.lang.OutOfMemoryError: Java
heap space

Who can tell me how can I achieve flow control aim? Does
readThrottleFilter can't limit message flow?

BR
andeson

Reply via email to