Separate netty connections for producer and consumer?
mlange Apr 24, 2014 9:05 AMI am trying to use different acceptors for producer and consumer clients. Defined three acceptors in domain.xml (one for producers, one for consumers one for clustering communication):
<acceptors>
<!-- producer -->
<netty-acceptor name="netty-producer-acceptor" socket-binding="messaging-producer-acceptor">
<param key="use-nio" value="true"/>
<param key="batch-delay" value="50"/>
<param key="direct-deliver" value="false"/>
</netty-acceptor>
<netty-acceptor name="netty-consumer-acceptor" socket-binding="messaging-consumer-acceptor">
<!-- consumer -->
<param key="use-nio" value="true"/>
<param key="batch-delay" value="50"/>
<param key="direct-deliver" value="false"/>
</netty-acceptor>
<netty-acceptor name="netty-cluster-acceptor" socket-binding="messaging-internal-acceptor">
<!-- for clustering -->
<param key="use-nio" value="true"/>
<param key="batch-delay" value="50"/>
<param key="direct-deliver" value="false"/>
</netty-acceptor>
<!-- referenced in cluster connection-->
<connectors>
<netty-connector name="netty-internal-connector" socket-binding="messaging-internal-acceptor"/>
</connectors>
All of them have a different socket binding and are thus listening on another port.
<socket-binding name="messaging-producer-acceptor" port="11830"/>
<socket-binding name="messaging-consumer-acceptor" port="11831"/>
<socket-binding name="messaging-internal-acceptor" port="11832"/>
On the client side different connection factories are used for the producer and for the consumer:
<tx-connection-factory>
<jndi-name>HornetqProducerPooledConnectionFactory</jndi-name>
<config-property name="ConnectionParameters" type="java.lang.String">host=host1;port=11830</config-property>
<tx-connection-factory>
<jndi-name>HornetqProducerPooledConnectionFactory</jndi-name>
<config-property name="ConnectionParameters" type="java.lang.String">host=host1;port=11831</config-property>
What I am seeing is that the client has one initial connection to the first acceptor (11830) and the other connections lead to the third acceptor (port 11832), although it has port 11830 defined in its ConnectionParameters.
Do you have any idea why this happens and how is it possible to achieve a clear separattion of producer and consumer traffic?
Thanks!