I am attempting to integrate into an existing plugin in order to send e-mails based on some internal business logic using Atlassian's EventPublisher API which I am wiring from atlassian-spring-scanner v1 API.
Using the latest Atlassian sdk, I was successfully create a plugin in order to do so on a local build agent. Unfortunately, when I attempted to do the same thing on a remote build agent, I was unable to do so.
INFO | jvm 2 | 2018/01/21 21:28:54 | 2018-01-21 21:28:54,256 ERROR [remoteEventRebroadcasterMessageListenerContainer-1] [OsgiPlugin] Plugin 'com.hidden.notifications' never resolved service '&eventPublisher' with filter '(&(objectClass=com.atlassian.event.api.EventPublisher)(objectClass=com.atlassian.event.api.EventPublisher))'
I'm pretty sure my issue is as described in the following post which states that this API (and ApplicationProperties which I also tested) are not available on the remote agent classpath.
https://community.atlassian.com/t5/Answers-Developer-Questions/How-to-fix-my-addon-not-running-on-remote-agent-because-waiting/qaq-p/493627
Unfortunately, the work arounds mentioned will not work for me since I can't just pipe the data -- I need to use the capabilities of the EventPublisher API to send e-mails. I also can't create a custom EventListener to run on a local agent as I am dependent on deployment events which I don't believe Bamboo supports. Even if it does, I'd rather not go down this path as the business logic for sending e-mails would be dependent on several runtime variables.
Is there any other work around for what I would imagine could be a fairly common usecase in order to send e-mails using Atlassian's EventPublisher API from remote agents. My last resort was to create my own service. Thank you.