You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by khandelwalanuj <an...@gmail.com> on 2017/05/05 06:14:00 UTC

ActiveMQ with PostgreSQL: Not deleting persistent messages sent to a topic

Hi,

Using ActiveMQv5.11.1 

I am evaluating ActiveMQ with PostgreSQL JDBC adapter. 

I ran a test case where a durable subscriber was listening from a topic and
a publisher is publishing persistent messages. I observed that the messages
were stored in the DB (ACTIVEMQ_MSGS table) but even after successful
consumption by the consumer, these messages were not deleted from the
backend DB. However I have seen that this doesn't happen in case of queue.
Persistent messages sent to a queue are automatically deleted from the DB
once successfully consumed by the consumer. 

This is a very generic use case which should never happen.

Thanks,
Anuj



--
View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-with-PostgreSQL-Not-deleting-persistent-messages-sent-to-a-topic-tp4725654.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: ActiveMQ with PostgreSQL: Not deleting persistent messages sent to a topic

Posted by Tim Bain <tb...@alumni.duke.edu>.
The odds of that bug being prioritized for work will increase if you can
use a debugger to help figure out specifically what is failing in the code.
Nothing says that one of the developers won't prioritize it as-is, but your
odds would be better if you were able to say "here's the block of code with
the wrong logic."

But it's really your decision how important it is to you that the bug get
fixed as soon as possible.

Tim

On May 8, 2017 1:27 AM, "khandelwalanuj" <an...@gmail.com>
wrote:

> I think doSetLaskAck is working fine perfectly as I can see that the value
> of
> last ackd message is getting updated properly.
>
> I have logged a bug request  https://issues.apache.org/
> jira/browse/AMQ-6671
> for the same.
>
> Thanks,
> Anuj
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.
> nabble.com/ActiveMQ-with-PostgreSQL-Not-deleting-
> persistent-messages-sent-to-a-topic-tp4725654p4725733.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>

Re: ActiveMQ with PostgreSQL: Not deleting persistent messages sent to a topic

Posted by khandelwalanuj <an...@gmail.com>.
I think doSetLaskAck is working fine perfectly as I can see that the value of
last ackd message is getting updated properly. 

I have logged a bug request  https://issues.apache.org/jira/browse/AMQ-6671
for the same.

Thanks,
Anuj



--
View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-with-PostgreSQL-Not-deleting-persistent-messages-sent-to-a-topic-tp4725654p4725733.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: ActiveMQ with PostgreSQL: Not deleting persistent messages sent to a topic

Posted by Tim Bain <tb...@alumni.duke.edu>.
That's great news that it's reproducible, because that means you can set it
up in a test environment and attach a debugger to see what's happening and
why. I'd recommend setting a breakpoint on
http://activemq.apache.org/maven/5.12.0/apidocs/org/apache/activemq/store/jdbc/adapter/DefaultJDBCAdapter.html#doSetLastAck(org.apache.activemq.store.jdbc.TransactionContext,%20org.apache.activemq.command.ActiveMQDestination,%20org.apache.activemq.command.XATransactionId,%20java.lang.String,%20java.lang.String,%20long,%20long)
to start.

Tim

On May 5, 2017 7:24 AM, "khandelwalanuj" <an...@gmail.com>
wrote:

> No. There is only one durable subscriber, I have verified it.
>
> This is happening everytime, it's reproducible.
>
> More details:
>
> 1. 1 producer 1 durable subscriber. Subscriber is in auto_ack mode.
> 2. Producer sent 100 persistent messages to consumer
> 3. Consumer successfully consumed them.
> 4. DB still has those messages.
> 5. Stop producer and consumer both, but messages are still there.
> 6. Even after restarting broker, message does not get deleted.
>
> Thanks,
> Anuj
>
>
>
>
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.
> nabble.com/ActiveMQ-with-PostgreSQL-Not-deleting-
> persistent-messages-sent-to-a-topic-tp4725654p4725661.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>

Re: ActiveMQ with PostgreSQL: Not deleting persistent messages sent to a topic

Posted by khandelwalanuj <an...@gmail.com>.
No. There is only one durable subscriber, I have verified it. 

This is happening everytime, it's reproducible.

More details: 

1. 1 producer 1 durable subscriber. Subscriber is in auto_ack mode.
2. Producer sent 100 persistent messages to consumer 
3. Consumer successfully consumed them.
4. DB still has those messages.
5. Stop producer and consumer both, but messages are still there.
6. Even after restarting broker, message does not get deleted.

Thanks,
Anuj







--
View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-with-PostgreSQL-Not-deleting-persistent-messages-sent-to-a-topic-tp4725654p4725661.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: ActiveMQ with PostgreSQL: Not deleting persistent messages sent to a topic

Posted by Tim Bain <tb...@alumni.duke.edu>.
Have you used JMX to see if there are other durable subscriptions that have
not consumed the messages?

On May 5, 2017 12:26 AM, "khandelwalanuj" <an...@gmail.com>
wrote:

> Hi,
>
> Using ActiveMQv5.11.1
>
> I am evaluating ActiveMQ with PostgreSQL JDBC adapter.
>
> I ran a test case where a durable subscriber was listening from a topic and
> a publisher is publishing persistent messages. I observed that the messages
> were stored in the DB (ACTIVEMQ_MSGS table) but even after successful
> consumption by the consumer, these messages were not deleted from the
> backend DB. However I have seen that this doesn't happen in case of queue.
> Persistent messages sent to a queue are automatically deleted from the DB
> once successfully consumed by the consumer.
>
> This is a very generic use case which should never happen.
>
> Thanks,
> Anuj
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.
> nabble.com/ActiveMQ-with-PostgreSQL-Not-deleting-
> persistent-messages-sent-to-a-topic-tp4725654.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>