"Stuck" emails in queues after post condition test (JEMH-5366)

Scenario

While adding a post function to a workflow transition in order to send a custom email through JEMH, I've used the test function (a valid issue Id was provided).

Test emails weren't sent so I've checked logs and found :

2017-02-06 11:29:41,676 Caesium-1-1 ERROR ServiceRunner [c.j.j.e.s.scheduler.jobs.TransportSendJob] Unable to send item, cannot locate the related transport with key [default-email]

This line is repeated every minutes for each (failed) tests I've made.

Additional information : once published in workflow, the post-function effectively sent the exepected emails.

Is there any way to purge this or to provide the [default-email] ?

Resolution

Rest service wasn't checking for DEFAULT_EMAIL, so enqueued a transport message but the messages wont be consumed. Have to adda n upgrade task to delete such messages in latest version, have to give a SQL query to delete transport messages from db.

if (transportKey==null|| transportKey.equals(IJEMHTemplateManager.DEFAULT_EMAIL)) { fMessageManager.sendAdHocMessage(templateSetId, transientVars, context); }

Changes implemented SINCE 2.1.5