activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Bain <tb...@alumni.duke.edu>
Subject Re: Duplicate Messages in the Message Store
Date Tue, 18 Apr 2017 04:34:01 GMT
Based on the doGetLastMessageStoreSequenceId() method in
https://fisheye.apache.org/browse/activemq-6/activemq-jdbc-store/src/main/java/org/apache/activemq/store/jdbc/adapter/DefaultJDBCAdapter.java?r=d54d046b8a8f2e9e5c0a28e1f8c7634b3c8b18e4&r=d54d046b8a8f2e9e5c0a28e1f8c7634b3c8b18e4&r=d54d046b8a8f2e9e5c0a28e1f8c7634b3c8b18e4&r=c5cf03806d646045e01f6cd382504fa73dedfeee&r=d54d046b8a8f2e9e5c0a28e1f8c7634b3c8b18e4&r=d54d046b8a8f2e9e5c0a28e1f8c7634b3c8b18e4&r=d54d046b8a8f2e9e5c0a28e1f8c7634b3c8b18e4&r=d54d046b8a8f2e9e5c0a28e1f8c7634b3c8b18e4,
if all messages have been consumed, acked, and deleted, the ID 0 will be
computed as the max value in the store, so I believe that the next ID used
will be 1.  But I'm not sure that that information helps you investigate
the behavior you're seeing during a failover event.

Are you able to reproduce this behavior reliably, in a minimal test
configuration?  The smoothest path forward would be for you to find a way
to reliably reproduce it and then submit a JIRA entry with the full details
of how to reproduce the problem, so that someone else could figure out
what's going on and address any bug that turns out to be the root cause of
the behavior.

Tim

On Fri, Apr 14, 2017 at 1:51 AM, srivmeka <srivmeka.career@gmail.com> wrote:

> Hi,
> Am facing issue with broker trying to insert duplicate message into
> activemq_msgs.
>
> This was observed during
> 1) Broker fail over
> 2) Data center/Application fail over where the primary broker changes per
> data center, note there is no broker shutdown here.
>
> I am using JDBC persistent Adapter and
> <broker brokerName="partner-broker"
> xmlns="http://activemq.apache.org/schema/core">
>                 <persistenceAdapter>
>                         <jdbcPersistenceAdapter
> dataSource="#amq-dataSource"
> useDatabaseLock="false"/>
>                 </persistenceAdapter>
>                 <transportConnectors>
>
>                         <transportConnector name="openwire1"
> uri="tcp://${activemq.broker1.hostname}:${activemq.broker1.
> portId}?maximumConnections=1000"/>
>                 </transportConnectors>
>         </broker>
>
> I have difficulty in understanding how broker inserts messages into message
> queues.
> The code in activemq jar does explain that it gets the max(ID) for next
> sequence generator but when is this really happening? Is there any caching
> mechanism here? What is the message is already consumed and deleted, how
> can
> it get the MAX(ID)?
>
> Thanks,
> Sri
>
>
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.
> nabble.com/Duplicate-Messages-in-the-Message-Store-tp4724959.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>

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