activemq icon indicating copy to clipboard operation
activemq copied to clipboard

WIP: Change interface JobScheduler remove signatures to provide control me…

Open kana-dowjones opened this issue 1 year ago • 5 comments

Use case:

When messages are deleted from the scheduler we need original message attributes, like user, timestamp etc. So the resulting message can have an acting user, who cancels the schedule, and an old user who scheduled the message

The only way to access old messages is to change the signature of a JobScheduler, which is called from SchedulerBroker.send(ProducerBrokerExchange producerExchange, final Message messageSend) method

kana-dowjones avatar Oct 10 '24 22:10 kana-dowjones

Hi @kana-dowjones why do we need those attributes? Could you elaborate on the benefit of this usecase?

And it would be great to capture this in a Jira ticket as well https://issues.apache.org/jira/projects/AMQ

kenliao94 avatar Oct 18 '24 07:10 kenliao94

When I said We need those attributes I meant this is our company system-specific case. We have a listener to send notifications about unscheduled messages to interested parties and naturally we need to include some attributes from the original message. Currently, when we delete messages from the scheduler all we have is jobId.

Do you want me to create a Jira ticket?

kana-dowjones avatar Oct 18 '24 13:10 kana-dowjones

@kana-dowjones yes please create a Jira ticket for further triage.

Personally I don't mind the change, but the change itself should benefit the whole community and not specific to a company requirement. So I am curious about what other people think.

kenliao94 avatar Oct 25 '24 19:10 kenliao94

Since this is for managing scheduled messages via the messaging API, I think the new methods can be additive, vs a refactor of existing methods which is a SPI breaking change. Management via JMX or other entry point would not have an associated message or messageId to use.

mattrpav avatar Oct 25 '24 19:10 mattrpav

The original intention was to define this API as disjoint from the Messages as that is not really necessary at this level, and given the changes are adding Message only to remove class, why would the other APIs not also take a Message as you create a scheduled message from an inbound Message. Overall the change fells like bad API design, but do as you will.

tabish121 avatar Oct 25 '24 19:10 tabish121