Question

I have two source servers server#0 and server#1, and a target server server#2. Each source servers have a core bridge to connect to server#2. (All servers are standalone and 2.2.14)

  1. server#0 have a queue q#0 (source)
  2. server#1 have a queue q#1 (source)
  3. server#2 have a queue q#2 (target)

Consider this scenario:

  1. The client sends messages to q#0
  2. q#2 receives all messages successfully (via bridge)
  3. The client sends messages to q#1
  4. server#2 says: duplicate message detected (for each messages) and nothing added to q#2 from q#1

Server#2 message when receiving message form q#1:

[Old I/O server worker (parentId: 2184190, [id: 0x002153fe, localhost/127.0.0.1:6445])] 
14-Nov 13:38:27,300 WARNING [PostOfficeImpl]  Duplicate message detected through the bridge - message will not be routed. 
Message information: ServerMessage[messageID=25769805298,priority=4, bodySize=302,expiration=0, durable=true, address=jms.queue.target, properties=TypedProperties[{_HQ_BRIDGE_DUP=[B@1ff447b}]]@32041289

Be notice that when the client starts sending message to q#1 instead of q#0, and then sending message to q#0, this problem happened again! (for q#1 messages)

Is it a bug? What should i do?

Server#0 (hornetq-configuration):

<queues>
    <queue name="jms.queue.source">
        <address>jms.queue.source</address>
    </queue>
</queues>

<bridges>
    <bridge name="bridge-to-server2">
        <queue-name>jms.queue.source</queue-name>
        <forwarding-address>jms.queue.target</forwarding-address>
        <reconnect-attempts>-1</reconnect-attempts>
        <static-connectors>
            <connector-ref>remote-connector</connector-ref>
        </static-connectors>
   </bridge>
</bridges>

<!-- connector to server#2 -->
<connector name="remote-connector">
    <factory-class>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory
    </factory-class>
    <param key="host" value="localhost" />
    <param key="port" value="6445" />
</connector>

Server#1 (hornetq-configuration):

<queues>
    <queue name="jms.queue.source">
        <address>jms.queue.source</address>
    </queue>
</queues>

<bridges>
    <bridge name="bridge-to-server2">
         <queue-name>jms.queue.source</queue-name>
         <forwarding-address>jms.queue.target</forwarding-address>
         <reconnect-attempts>-1</reconnect-attempts>
         <static-connectors>
             <connector-ref>remote-connector</connector-ref>
         </static-connectors>
    </bridge>
</bridges>

<!-- connector to server#2 -->
<connector name="remote-connector">
    <factory-class>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory
    </factory-class>
    <param key="host" value="localhost" />
    <param key="port" value="6445" />
</connector>

Server#2 (hornetq-configuration):

<connectors>
    <connector name="netty-connector">
         <factory-class>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory
         </factory-class>
         <param key="host" value="localhost" />
         <param key="port" value="6445" />
    </connector>
</connectors>

<acceptors>
     <acceptor name="netty-acceptor">
          <factory-class>org.hornetq.core.remoting.impl.netty.NettyAcceptorFactory
          </factory-class>
          <param key="host" value="localhost" />
          <param key="port" value="6445" />
     </acceptor>
</acceptors>

Server#2 (hornetq-jms):

<queue name="target">
    <entry name="/queue/target" />
</queue>
Was it helpful?

Solution

It was a bug and it has been fixed already:

https://issues.jboss.org/browse/HORNETQ-1072

OTHER TIPS

You should check the parameter

use-duplicate-detection

in your HornetQ-configuration.xml file.

The default value is true so try to set it to false.

In case you could check the new HornetQ book

www.amazon.com/dp/1849518408/?tag=packtpubli-20

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top