mina-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fred.ac <fred...@scarlet.be>
Subject messageReceived before the messageSent event
Date Wed, 16 May 2007 08:02:08 GMT
Dear all,

We are using Mina 1.1.0 with spring integration to implement a TCP protocol.
Sometimes when the client sends a message and is waiting for a
response it receives the messageReceived before the messageSent event
(IoHandler).
The problem we have is that the protocol is controlled by a state
machine (serviceCoordinator) and of course if we receive a response
before knowing that the request was sent it gives an error.
The server replies immediately when it receives a request, if we slown
down the server we correctly receive the messageReceived after the
messageSent event in the client.
When we were using Mina 0.9.4 we didn't have this problem.
Could someone explain me how to solve it, i.e. how to "force" a
messageSent before a messageReceived event.

Many thanks

Cheers,
Frédéric.

Here is our spring config :

<bean id="mapsBinding" class="org.apache.mina.integration.spring.Binding">
        <property name="address" value=":${tams.tci.maps.port}"/>
        <property name="handler">
            <ref local="serviceCoordinator"/>  <== implements
messageReceived and messageSent methods (IoHandler)

        </property>
        <property name="serviceConfig">
            <bean
class="org.apache.mina.transport.socket.nio.SocketAcceptorConfig">
                <property name="threadModel">
                    <bean
class="org.apache.mina.integration.spring.ExecutorThreadModelFactoryBean">
                        <property name="serviceName" value="MAPSIoWorker"/>
                        <property name="executor">
                            <bean
class="org.apache.mina.integration.spring.ThreadPoolExecutorFactoryBean">
                                <property name="corePoolSize" value="1"/>
                                <property name="maxPoolSize" value="10"/>
                                <property name="keepAliveSeconds" value="60"/>
                            </bean>
                        </property>
                    </bean>
                </property>
                <property name="filterChainBuilder">
                    <bean
class="org.apache.mina.integration.spring.DefaultIoFilterChainBuilderFactoryBean">
                        ...
                    </bean>
                </property>
                <property name="reuseAddress" value="true"/>
            </bean>
        </property>
</bean>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message