0

Scenario: Users are taking a long quiz. I store the current score and location in the quiz after each interaction. I want to store in the DB only the last interaction the user did during this current launch.

Right now I achieve this via Redis, were every time I store the last interaction I overwrite the previous one.

Can this be achieved via Apache's ActiveMQ "Classic" where each user can have his messages grouped and I consume only the last message received in the group?

2 Answers 2

1

I'm not aware of any automated way to do this in ActiveMQ 5.x, but you can do with with ActiveMQ Artemis using a "last value" queue. This feature allows you to set a special property on a message to a particular value and any time another message with that same property value arrives on the queue it will replace the previous one.

To be clear, Artemis has backwards compatibility support for ActiveMQ 5.x clients (which using the OpenWire protocol).

Sign up to request clarification or add additional context in comments.

3 Comments

Sadly, switching a Message system is not an available option for me at this time. serverfault.com/questions/873533/…
LVQ functionality is not something that is supported in ActiveMQ 5.x
Thanks for the confirmation, Tim.
0

This can be done with an ActiveMQ 5.x Topic and a subscription recovery policy

You don't really need a queue when you enable this type of feature.

See LastImageSubscriptionRecoveryPolicy here: Subscription Recovery Policy

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.